:root {
  --bg: #f4f7fb;
  --bg-2: #eef2ff;
  --card: rgba(255, 255, 255, 0.86);
  --card-solid: #ffffff;
  --text: #0f172a;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #d9e2ef;
  --line-soft: #edf2f7;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --accent-dark: #312e81;
  --soft-accent: #eef2ff;
  --success-soft: #ecfdf3;
  --warning-soft: #fffbeb;
  --danger-soft: #fef2f2;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.10);
  --shadow-soft: 0 18px 50px rgba(15, 23, 42, 0.07);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(circle at 10% 0%, rgba(79, 70, 229, 0.16), transparent 30rem),
    radial-gradient(circle at 90% 8%, rgba(6, 182, 212, 0.14), transparent 28rem),
    radial-gradient(circle at 50% 100%, rgba(236, 72, 153, 0.08), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: "Manrope", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

/* Shared */

.logo-lockup {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  gap: 12px;
  text-decoration: none;
}

.logo-lockup:hover {
  text-decoration: none;
}

.logo-lockup.compact {
  align-self: start;
}

.logo-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 15px;
  color: #ffffff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  letter-spacing: -0.04em;
  width: 42px;
}

.logo-lockup strong {
  display: block;
  font-size: 15px;
  line-height: 1.1;
}

.logo-lockup small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

/* Home */

.home-page {
  margin: 0 auto;
  max-width: 1120px;
  min-height: 100vh;
  padding: 28px 22px 64px;
}

.site-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 74px;
}

.hero-section {
  margin: 0 auto;
  max-width: 920px;
  text-align: center;
}

.hero-badge {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #344054;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  margin-bottom: 22px;
  padding: 8px 13px;
}

.pulse-dot {
  animation: pulse 1.8s ease-in-out infinite;
  background: var(--accent-2);
  border-radius: 999px;
  height: 8px;
  width: 8px;
}

.hero-section h1 {
  font-size: clamp(42px, 7.2vw, 82px);
  letter-spacing: -0.075em;
  line-height: 0.95;
  margin: 0 auto 22px;
  max-width: 920px;
}

.hero-copy {
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.65;
  margin: 0 auto 34px;
  max-width: 760px;
}

.ai-search-form {
  margin: 0 auto;
  max-width: 850px;
}

.ai-search-box {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(217, 226, 239, 0.9);
  border-radius: 999px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 10px;
  padding: 10px;
}

.upload-trigger {
  align-items: center;
  background: var(--soft-accent);
  border: 0;
  border-radius: 999px;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 700;
  height: 50px;
  justify-content: center;
  transition: transform 0.18s ease, background 0.18s ease;
  width: 50px;
}

.upload-trigger:hover {
  background: #e0e7ff;
  transform: translateY(-1px);
}

.ai-search-box input[type="text"] {
  background: transparent;
  border: 0;
  color: var(--text);
  flex: 1;
  font-size: 17px;
  font-weight: 500;
  min-width: 0;
  outline: none;
  padding: 16px 8px;
}

.ai-search-box input[type="text"]::placeholder {
  color: #98a2b3;
}

.primary-search-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: 0;
  border-radius: 999px;
  color: white;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 800;
  padding: 16px 26px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-search-button:hover {
  box-shadow: 0 14px 28px rgba(79, 70, 229, 0.24);
  transform: translateY(-1px);
}

.primary-search-button:disabled {
  cursor: not-allowed;
  opacity: 0.75;
  transform: none;
}

.search-support-row {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  margin: 14px 14px 0;
}

.region-control {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.region-control span {
  color: var(--muted);
}

.region-control input {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 10px;
  text-align: center;
  width: 58px;
}

#upload-status {
  margin: 0;
}

.prompt-chips {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  margin-top: 26px;
}

.prompt-chip {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #344054;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  padding: 10px 14px;
  transition: background 0.18s ease, transform 0.18s ease;
}

.prompt-chip:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.value-strip {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
  margin: 78px auto 0;
  max-width: 980px;
}

.value-strip article {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(217, 226, 239, 0.9);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: left;
}

.value-icon {
  align-items: center;
  background: var(--soft-accent);
  border-radius: 14px;
  color: var(--accent);
  display: inline-flex;
  font-size: 18px;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  margin-bottom: 16px;
  width: 38px;
}

.value-strip strong {
  display: block;
  font-size: 16px;
  margin-bottom: 7px;
}

.value-strip p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}

.mini-proof {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 34px auto 0;
  max-width: 600px;
  text-align: center;
}

/* Loading overlay */

.loading-overlay,
.detail-modal-overlay {
  align-items: center;
  backdrop-filter: blur(14px);
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 50;
}

.loader-modal {
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.12), transparent 18rem),
    var(--card-solid);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 30px;
  box-shadow: 0 35px 120px rgba(15, 23, 42, 0.28);
  max-width: 460px;
  padding: 32px;
  text-align: center;
  width: 100%;
}

.orbital-loader {
  height: 72px;
  margin: 0 auto 18px;
  position: relative;
  width: 72px;
}

.orbital-loader span {
  animation: orbit 1.6s linear infinite;
  border: 2px solid transparent;
  border-radius: 999px;
  border-top-color: var(--accent);
  inset: 0;
  position: absolute;
}

.orbital-loader span:nth-child(2) {
  animation-duration: 2.2s;
  border-top-color: var(--accent-2);
  inset: 10px;
}

.orbital-loader span:nth-child(3) {
  animation-duration: 1.1s;
  border-top-color: #ec4899;
  inset: 20px;
}

.loader-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.loader-modal h2 {
  font-size: 24px;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
}

.loader-modal > p:last-of-type {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.loader-progress {
  background: var(--line-soft);
  border-radius: 999px;
  height: 8px;
  margin-top: 26px;
  overflow: hidden;
}

.loader-progress span {
  animation: progressMove 2.2s ease-in-out infinite;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  display: block;
  height: 100%;
  width: 42%;
}

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

@keyframes progressMove {
  0% {
    transform: translateX(-110%);
  }
  50% {
    transform: translateX(55%);
  }
  100% {
    transform: translateX(250%);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.45;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Report */

.report-page {
  margin: 0 auto;
  max-width: 1240px;
  padding: 26px 22px 64px;
}

.report-topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

.excel-button,
.secondary-link-button {
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.excel-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  padding: 13px 18px;
}

.excel-button:hover,
.secondary-link-button:hover {
  text-decoration: none;
}

.secondary-link-button {
  background: var(--soft-accent);
  color: var(--accent-dark);
  padding: 12px 16px;
}

.report-hero-card {
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 24px;
}

.report-hero-card h1 {
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -0.055em;
  line-height: 1;
  margin: 0 0 10px;
}

.report-subtitle {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.alert-card {
  border-radius: var(--radius-lg);
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 16px 18px;
}

.alert-card.error {
  background: var(--danger-soft);
  border: 1px solid #fecaca;
}

.alert-card.warning {
  background: var(--warning-soft);
  border: 1px solid #fde68a;
}

.alert-card ul {
  margin-bottom: 0;
}

.results-card {
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.results-header {
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  padding: 22px 24px;
}

.results-header h2 {
  font-size: 22px;
  letter-spacing: -0.035em;
  margin: 0 0 4px;
}

.results-header p {
  color: var(--muted);
  margin: 0;
}

.movie-results-table {
  border-collapse: collapse;
  width: 100%;
}

.movie-results-table th {
  background: #f8fafc;
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 14px 18px;
  text-align: left;
  text-transform: uppercase;
}

.movie-results-table td {
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
  padding: 18px;
  vertical-align: middle;
}

.movie-main {
  max-width: 230px;
}

.movie-main strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.movie-main span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 4px;
}

.rating-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 112px;
}

.rating-pills span {
  background: #f8fafc;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: #344054;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 9px;
  white-space: nowrap;
}

.detail-short {
  max-width: 220px;
}

.detail-short strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.detail-short span {
  color: var(--muted);
  display: -webkit-box;
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ott-text {
  color: #344054;
  display: -webkit-box;
  line-height: 1.45;
  max-width: 240px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ott-status-pill {
  background: var(--soft-accent);
  border: 1px solid #dbe4ff;
  border-radius: 999px;
  color: var(--accent-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
  white-space: nowrap;
}

.table-action-cell {
  text-align: right;
}

.detail-open-button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 12px;
  white-space: nowrap;
}

.detail-open-button:hover {
  background: var(--soft-accent);
  border-color: #c7d2fe;
}

.mobile-card-list {
  display: none;
}

.ott-disclaimer {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  line-height: 1.6;
  margin: 18px 0;
  padding: 16px 18px;
}

.run-details-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-top: 18px;
  padding: 16px 18px;
}

.run-details-card summary {
  color: #344054;
  cursor: pointer;
  font-weight: 800;
}

.run-details-body {
  margin-top: 14px;
}

.run-details-body h2 {
  font-size: 16px;
}

.run-details-body ol {
  color: #475467;
  line-height: 1.6;
}

.run-details-body pre {
  background: #0f172a;
  border-radius: var(--radius-md);
  color: white;
  overflow: auto;
  padding: 14px;
}

/* Detail modal */

.detail-modal {
  background: var(--card-solid);
  border-radius: 30px;
  box-shadow: 0 35px 120px rgba(15, 23, 42, 0.34);
  max-height: 86vh;
  max-width: 760px;
  overflow: auto;
  padding: 28px;
  position: relative;
  width: 100%;
}

.modal-close-button {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #344054;
  cursor: pointer;
  display: flex;
  font-size: 24px;
  height: 40px;
  justify-content: center;
  position: absolute;
  right: 20px;
  top: 20px;
  width: 40px;
}

#detail-modal-content h2 {
  font-size: 30px;
  letter-spacing: -0.045em;
  line-height: 1.1;
  margin: 0 46px 8px 0;
}

.modal-subtitle {
  color: var(--muted);
  margin: 0 0 18px;
}

.modal-rating-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.modal-rating-row span {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 10px;
}

.modal-section {
  border-top: 1px solid var(--line-soft);
  padding-top: 18px;
  margin-top: 18px;
}

.modal-section h3,
.modal-grid h3 {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.modal-section p,
.modal-grid p {
  color: #475467;
  line-height: 1.65;
  margin: 0;
}

.modal-section ul {
  line-height: 1.8;
  margin: 0;
  padding-left: 18px;
}

.modal-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 18px;
}

.modal-grid > div {
  background: #f8fafc;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 14px;
}

/* Mobile cards */

.movie-mobile-card {
  background: #f8fafc;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.mobile-card-top {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.movie-mobile-card h3 {
  font-size: 18px;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin: 0 0 6px;
}

.movie-mobile-card p {
  color: #475467;
  line-height: 1.55;
  margin: 8px 0;
}

.rating-pills.mobile {
  flex-direction: row;
  flex-wrap: wrap;
  margin: 14px 0 10px;
}

.mobile-meta {
  font-size: 14px;
}

.mobile-ott {
  font-size: 14px;
}

.mobile-details {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}

.mobile-details summary {
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.detail-content {
  margin-top: 12px;
}

.detail-content ul {
  margin: 0;
  padding-left: 18px;
}

/* Responsive */

@media (max-width: 900px) {
  .value-strip {
    grid-template-columns: 1fr;
    max-width: 640px;
  }

  .report-hero-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .desktop-table-wrap {
    display: none;
  }

  .mobile-card-list {
    display: grid;
    gap: 14px;
    padding: 14px;
  }
}

@media (max-width: 640px) {
  .home-page,
  .report-page {
    padding: 20px 14px 44px;
  }

  .site-header {
    margin-bottom: 52px;
  }

  .hero-section {
    text-align: left;
  }

  .hero-section h1 {
    font-size: 44px;
    letter-spacing: -0.065em;
  }

  .hero-copy {
    font-size: 16px;
  }

  .ai-search-box {
    align-items: stretch;
    border-radius: 28px;
    display: grid;
    gap: 10px;
    grid-template-columns: auto 1fr;
    padding: 12px;
  }

  .ai-search-box input[type="text"] {
    grid-column: 1 / -1;
    grid-row: 1;
    padding: 12px 10px;
  }

  .upload-trigger {
    grid-column: 1;
    grid-row: 2;
  }

  .primary-search-button {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
  }

  .search-support-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-left: 4px;
    margin-right: 4px;
  }

  .prompt-chips {
    justify-content: flex-start;
  }

  .value-strip {
    margin-top: 44px;
  }

  .mini-proof {
    text-align: left;
  }

  .loader-modal {
    padding: 26px 22px;
  }

  .report-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .excel-button {
    text-align: center;
    width: 100%;
  }

  .report-hero-card {
    padding: 20px;
  }

  .report-hero-card h1 {
    font-size: 34px;
  }

  .secondary-link-button {
    text-align: center;
    width: 100%;
  }

  .results-header {
    padding: 18px;
  }

  .mobile-card-list {
    padding: 12px;
  }

  .mobile-card-top {
    flex-direction: column;
  }

  .detail-modal {
    border-radius: 24px;
    max-height: 90vh;
    padding: 24px 18px;
  }

  #detail-modal-content h2 {
    font-size: 25px;
  }

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

/* --- UI refinement patch: typography, sticky headers, ratings, loader stability --- */

/* Font size reset closer to product guidelines */
body {
  font-size: 15px;
}

.hero-section h1 {
  font-size: clamp(28px, 4vw, 32px);
  letter-spacing: -0.04em;
  line-height: 1.12;
  max-width: 680px;
}

.hero-copy {
  font-size: 16px;
  line-height: 1.6;
  max-width: 700px;
}

.report-hero-card h1 {
  font-size: clamp(28px, 3.5vw, 32px);
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.results-header h2 {
  font-size: 23px;
}

.movie-mobile-card h3,
#detail-modal-content h2 {
  font-size: 20px;
}

.modal-section h3,
.modal-grid h3,
.eyebrow {
  font-size: 12px;
}

/* Stable loader popup */
.loader-modal {
  min-height: 330px;
  width: min(460px, 92vw);
}

.loader-modal h2 {
  font-size: 22px;
  line-height: 1.25;
  min-height: 56px;
}

.loader-modal > p:last-of-type {
  font-size: 15px;
  min-height: 54px;
}

/* Result count */
.result-count-pill {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #344054;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 11px;
  white-space: nowrap;
}

/* Desktop table scroll + sticky headers */
.desktop-table-wrap {
  max-height: calc(100vh - 320px);
  overflow: auto;
}

.movie-results-table th {
  position: sticky;
  top: 0;
  z-index: 3;
}

/* Keep first column more readable */
.movie-results-table th:first-child,
.movie-results-table td:first-child {
  min-width: 190px;
}

/* Rating badge/icons */
.rating-pills span,
.modal-rating-row span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.rating-pills span b,
.modal-rating-row span b {
  align-items: center;
  background: #111827;
  border-radius: 7px;
  color: white;
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  height: 21px;
  justify-content: center;
  letter-spacing: -0.02em;
  min-width: 34px;
  padding: 0 6px;
}

.rating-pills span:nth-child(2) b,
.modal-rating-row span:nth-child(2) b {
  background: #b91c1c;
}

.rating-pills span:nth-child(3) b,
.modal-rating-row span:nth-child(3) b {
  background: #2563eb;
}

/* Slightly cleaner table text */
.movie-results-table td {
  font-size: 14px;
}

.movie-main strong {
  font-size: 14px;
}

.detail-short strong,
.ott-text {
  font-size: 14px;
}

.detail-short span {
  font-size: 12px;
}

/* Mobile type scale */
@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .hero-section h1 {
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: -0.035em;
  }

  .hero-copy {
    font-size: 14px;
  }

  .report-hero-card h1 {
    font-size: 25px;
  }

  .results-header h2 {
    font-size: 19px;
  }

  .movie-mobile-card h3 {
    font-size: 17px;
  }

  .loader-modal {
    min-height: 315px;
  }

  .loader-modal h2 {
    font-size: 20px;
    min-height: 50px;
  }

  .loader-modal > p:last-of-type {
    font-size: 14px;
  }

  .results-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .result-count-pill {
    font-size: 11px;
  }
}

/* --- Modal refinement: sticky header, subtle scroll, smaller close button --- */

.detail-modal {
  display: flex;
  flex-direction: column;
  max-height: 86vh;
  overflow: hidden;
  padding: 0;
}

#detail-modal-content {
  display: flex;
  flex-direction: column;
  max-height: 86vh;
  min-height: 0;
}

.modal-sticky-header {
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.08), transparent 18rem),
    #ffffff;
  border-bottom: 1px solid var(--line-soft);
  flex: 0 0 auto;
  padding: 22px 72px 18px 28px;
  position: sticky;
  top: 0;
  z-index: 4;
}

.modal-sticky-header h2 {
  font-size: 24px !important;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0 0 7px !important;
}

.modal-sticky-header .modal-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 14px !important;
}

.modal-sticky-header .modal-rating-row {
  margin: 0;
}

.modal-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 28px 28px;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
  scrollbar-width: thin;
}

.modal-scroll-body::-webkit-scrollbar {
  width: 6px;
}

.modal-scroll-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-scroll-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.modal-scroll-body::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
}

.modal-close-button {
  font-size: 20px;
  height: 34px;
  right: 18px;
  top: 18px;
  width: 34px;
  z-index: 8;
}

.modal-scroll-body .modal-section:first-child {
  border-top: 0;
}

/* Mobile fallback remains comfortable */
@media (max-width: 640px) {
  .modal-sticky-header {
    padding: 20px 58px 16px 20px;
  }

  .modal-sticky-header h2 {
    font-size: 21px !important;
  }

  .modal-scroll-body {
    padding: 0 20px 24px;
  }

  .modal-close-button {
    height: 32px;
    right: 16px;
    top: 16px;
    width: 32px;
  }
}

.logo-image {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
}

/* --- Upload preview card on homepage --- */

.upload-preview-shell {
  margin: 14px auto 0;
  width: 100%;
}

.upload-preview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(44, 44, 42, 0.10);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(44, 44, 42, 0.05);
  backdrop-filter: blur(8px);
}

.upload-preview-thumb {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(44, 44, 42, 0.10);
  background: #F1EFE8;
}

.upload-preview-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.upload-preview-title {
  color: #2C2C2A;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  margin-bottom: 3px;
}

.upload-preview-meta {
  color: #888780;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-preview-remove {
  appearance: none;
  border: 1px solid rgba(44, 44, 42, 0.10);
  background: #ffffff;
  color: #888780;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  transition: all 0.18s ease;
}

.upload-preview-remove:hover {
  color: #2C2C2A;
  border-color: rgba(44, 44, 42, 0.18);
  background: #F8F7F2;
}

@media (max-width: 640px) {
  .upload-preview-card {
    padding: 11px 12px;
    gap: 12px;
    border-radius: 16px;
  }

  .upload-preview-thumb {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .upload-preview-title {
    font-size: 13px;
  }

  .upload-preview-meta {
    font-size: 12px;
  }

  .upload-preview-remove {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
}

/* --- Inline image chip inside search bar --- */

.upload-preview-shell {
  display: none !important;
}

.has-inline-upload {
  gap: 12px;
}

.inline-upload-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  padding: 6px 10px 6px 6px;
  background: rgba(241, 239, 232, 0.98);
  border: 1px solid rgba(44, 44, 42, 0.10);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.inline-upload-thumb {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(44, 44, 42, 0.10);
  background: #F1EFE8;
}

.inline-upload-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.inline-upload-title {
  color: #2C2C2A;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.15;
  margin-bottom: 2px;
}

.inline-upload-name {
  color: #888780;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-upload-remove {
  appearance: none;
  border: 1px solid rgba(44, 44, 42, 0.10);
  background: #ffffff;
  color: #888780;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  transition: all 0.18s ease;
}

.inline-upload-remove:hover {
  color: #2C2C2A;
  border-color: rgba(44, 44, 42, 0.18);
  background: #F8F7F2;
}

@media (max-width: 640px) {
  .has-inline-upload {
    gap: 8px;
  }

  .inline-upload-chip {
    padding: 5px 8px 5px 5px;
    gap: 8px;
  }

  .inline-upload-thumb {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .inline-upload-title {
    font-size: 12px;
  }

  .inline-upload-name {
    font-size: 11px;
  }

  .inline-upload-remove {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }
}

/* --- Custom upload replace modal --- */

.upload-replace-overlay {
  align-items: center;
  backdrop-filter: blur(10px);
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 60;
}

.upload-replace-modal {
  background: #ffffff;
  border: 1px solid rgba(44, 44, 42, 0.10);
  border-radius: 24px;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.22);
  max-width: 380px;
  padding: 24px;
  text-align: left;
  width: 100%;
}

.upload-replace-modal h2 {
  color: #0f172a;
  font-size: 20px;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 8px;
}

.upload-replace-modal p {
  color: #667085;
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}

.upload-replace-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}

.replace-secondary,
.replace-primary {
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 14px;
}

.replace-secondary {
  background: #ffffff;
  border: 1px solid rgba(44, 44, 42, 0.14);
  color: #667085;
}

.replace-primary {
  background: #E24B4A;
  border: 1px solid #E24B4A;
  color: #ffffff;
}

.replace-secondary:hover {
  background: #F1EFE8;
}

.replace-primary:hover {
  filter: brightness(0.96);
}

@media (max-width: 640px) {
  .upload-replace-modal {
    border-radius: 20px;
    padding: 20px;
  }

  .upload-replace-actions {
    flex-direction: column-reverse;
  }

  .replace-secondary,
  .replace-primary {
    width: 100%;
  }
}

/* Force inline upload chip to stay hidden until an image is actually selected */
.inline-upload-chip[hidden] {
  display: none !important;
}

/* --- Search input text size refinement --- */

.ai-search-box input[type="text"] {
  font-size: 14px !important;
}

.ai-search-box input[type="text"]::placeholder {
  font-size: 14px !important;
}

/* --- Search input text size refinement --- */

.ai-search-box input[type="text"] {
  font-size: 16px !important;
}

.ai-search-box input[type="text"]::placeholder {
  font-size: 16px !important;
}

/* --- Search input text size refinement --- */

.ai-search-box input[type="text"] {
  font-size: 14px !important;
}

.ai-search-box input[type="text"]::placeholder {
  font-size: 14px !important;
}

/* --- Search input text size refinement --- */

.ai-search-box input[type="text"] {
  font-size: 15px !important;
}

.ai-search-box input[type="text"]::placeholder {
  font-size: 15px !important;
}

/* --- Mobile search input spacing refinement --- */

@media (max-width: 640px) {
  .ai-search-box input[type="text"] {
    width: 100%;
    padding-left: 8px !important;
    padding-right: 8px !important;
    text-overflow: ellipsis;
  }
}

/* --- Mobile search input spacing refinement --- */

@media (max-width: 640px) {
  .ai-search-box input[type="text"] {
    width: 100%;
    padding-left: 8px !important;
    padding-right: 8px !important;
    text-overflow: ellipsis;
  }
}

/* --- QA polish patch --- */

/* 1. Keep loader modal stable across changing text */
.loader-modal {
  min-height: 360px !important;
  width: min(440px, 92vw) !important;
}

.loader-modal h2 {
  min-height: 60px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-modal > p:last-of-type {
  min-height: 72px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 2. Reduce homepage search controls */
.upload-trigger {
  height: 42px !important;
  width: 42px !important;
  font-size: 18px !important;
}

.primary-search-button {
  padding: 12px 20px !important;
  font-size: 14px !important;
}

.ai-search-box {
  padding: 8px !important;
}

/* 3. Reduce Download Excel prominence */
.excel-button {
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
}

.excel-button:hover {
  background: #ffffff !important;
  text-decoration: none !important;
}

/* 4. Mobile spacing for Run another search CTA */
@media (max-width: 640px) {
  .secondary-link-button {
    margin-top: 12px !important;
  }

  .report-hero-card {
    gap: 14px !important;
  }

  .loader-modal {
    min-height: 340px !important;
  }

  .loader-modal h2 {
    min-height: 56px !important;
  }

  .loader-modal > p:last-of-type {
    min-height: 76px !important;
  }

  .upload-trigger {
    height: 40px !important;
    width: 40px !important;
    font-size: 17px !important;
  }

  .primary-search-button {
    padding: 11px 16px !important;
    font-size: 13px !important;
  }
}

/* --- QA rollback: restore primary CTA and upload icon prominence --- */

.upload-trigger {
  height: 50px !important;
  width: 50px !important;
  font-size: 22px !important;
}

.primary-search-button {
  padding: 16px 26px !important;
  font-size: 15px !important;
}

.ai-search-box {
  padding: 10px !important;
}

.excel-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)) !important;
  border: 0 !important;
  color: #ffffff !important;
  padding: 13px 18px !important;
  font-size: 14px !important;
  box-shadow: none !important;
}

.excel-button:hover {
  text-decoration: none !important;
}

@media (max-width: 640px) {
  .upload-trigger {
    height: 48px !important;
    width: 48px !important;
    font-size: 21px !important;
  }

  .primary-search-button {
    padding: 15px 20px !important;
    font-size: 14px !important;
  }
}
