* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
  color: #1d1d1f;
  background: #fff;
  margin: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #e8e8ed;
  background: #fff;
}

.site-header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1d1d1f;
  text-decoration: none;
  min-width: 0;
}

.site-header__brand:hover {
  color: #000;
}

.site-header__logo {
  display: block;
  flex-shrink: 0;
  height: 2rem;
  width: 2rem;
  object-fit: contain;
}

.site-header__name {
  line-height: 1.2;
}

.site-header__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.site-header__nav a {
  font-size: 0.875rem;
  color: #6e6e73;
  text-decoration: none;
  white-space: nowrap;
}

.site-header__nav a:hover {
  color: #1d1d1f;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* ——— Typography ——— */

.headline {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0 0 1rem;
  color: #1d1d1f;
}

.subheadline {
  font-size: 1.125rem;
  line-height: 1.5;
  color: #6e6e73;
  margin: 0 0 3rem;
  max-width: 32rem;
}

.section-title {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 1rem;
  color: #1d1d1f;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #86868b;
  margin: 0 0 0.75rem;
}

.section-value {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  color: #1d1d1f;
}

.section-value--gain {
  color: #1d7d44;
}

.section-value--loss {
  color: #bf4800;
}

/* ——— Report sections ——— */

.report-section {
  margin-bottom: 3.5rem;
  padding-bottom: 3.5rem;
  border-bottom: 1px solid #f5f5f7;
}

.report-section:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.report-section--status {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 3rem;
}

.report-section--hero {
  padding-bottom: 3rem;
}

.value-hero {
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0;
  color: #1d1d1f;
}

/* ——— Status / opening ——— */

.status-copy p {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: #424245;
  margin: 0 0 0.875rem;
}

.status-copy p:last-child {
  margin-bottom: 0;
}

/* ——— Confidence ——— */

.confidence-label {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  color: #1d1d1f;
}

.confidence-summary {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: #424245;
  margin: 0;
}

.offer-status {
  font-size: 1rem;
  font-weight: 500;
  color: #424245;
  margin: 0 0 0.75rem;
}

.confidence-detail {
  font-size: 0.9375rem;
  color: #6e6e73;
  margin: 0 0 0.75rem;
}

.confidence-factors,
.confidence-warnings {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.confidence-factors li,
.confidence-warnings li {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #424245;
  padding: 0.375rem 0;
}

.confidence-factor-label {
  font-weight: 600;
  color: #1d1d1f;
}

.manual-review-support {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: #6e6e73;
  margin: -0.25rem 0 1.25rem;
}

.manual-review-intro {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: #424245;
  margin: 0 0 1rem;
}

.manual-review-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.manual-review-item {
  padding: 1.25rem 0;
  border-top: 1px solid #d2d2d7;
}

.manual-review-item:first-child {
  border-top: none;
  padding-top: 0;
}

.manual-review-name {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0 0 0.25rem;
}

.manual-review-meta {
  font-size: 0.9375rem;
  color: #6e6e73;
  margin: 0 0 0.375rem;
}

.manual-review-reason {
  font-size: 1rem;
  line-height: 1.5;
  color: #424245;
  margin: 0;
}

.manual-review-item--hidden {
  display: none;
}

.manual-review-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.review-page-btn {
  background: #f5f5f7;
  color: #1d1d1f;
  border: 1px solid #d2d2d7;
  border-radius: 980px;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

.review-page-btn:hover:not(:disabled) {
  background: #ebebef;
}

.review-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.review-page-label {
  font-size: 0.9375rem;
  color: #424245;
  min-width: 6.5rem;
  text-align: center;
}

.manual-review-empty {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: #424245;
  margin: 0;
}

/* ——— Narrative blocks ——— */

.narrative p {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: #424245;
  margin: 0 0 1.125rem;
}

.narrative p:last-child {
  margin-bottom: 0;
}

/* ——— Recommendations ——— */

.recommendations {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recommendation {
  padding: 1.5rem 0;
  border-top: 1px solid #d2d2d7;
}

.recommendation:first-child {
  border-top: none;
  padding-top: 0;
}

.recommendation-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0 0 0.375rem;
}

.recommendation-body {
  font-size: 1rem;
  line-height: 1.5;
  color: #424245;
  margin: 0;
}

.recommendation-empty {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: #424245;
  margin: 0;
}

.cta-note {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #6e6e73;
  margin: 0 0 1.25rem;
  max-width: 28rem;
  margin-inline: auto;
}

.next-steps {
  margin: 0;
  padding-left: 1.25rem;
}

.next-steps li {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: #424245;
  padding: 0.375rem 0;
}

/* ——— CTA ——— */

.report-section--cta {
  text-align: center;
  padding-top: 1rem;
  border-bottom: none;
}

.cta-button {
  display: inline-block;
  background: #1d1d1f;
  color: #fff;
  border: none;
  padding: 0.9375rem 2rem;
  border-radius: 980px;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cta-button:hover {
  background: #424245;
}

/* ——— Upload page ——— */

.upload-card {
  border: 1px solid #e8e8ed;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  background: #fff;
}

.upload-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 0.5rem;
  color: #1d1d1f;
}

.upload-card__helper {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #6e6e73;
  margin: 0 0 1.5rem;
}

.upload-card__timing {
  font-size: 0.875rem;
  line-height: 1.45;
  color: #86868b;
  margin: 1rem 0 0;
  text-align: center;
}

.trust-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.trust-bullets li {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #424245;
}

.upload-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6e6e73;
  margin-bottom: 0.5rem;
}

.upload-form input[type="file"] {
  display: block;
  width: 100%;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
  color: #424245;
}

.upload-form button {
  display: block;
  width: 100%;
  background: #1d1d1f;
  color: #fff;
  border: none;
  padding: 0.875rem 1.75rem;
  border-radius: 980px;
  font-size: 1.0625rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.upload-form button:hover {
  background: #424245;
}

.error {
  background: #fff5f5;
  color: #1d1d1f;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  font-size: 0.9375rem;
  border: 1px solid #ffc9c9;
}

/* ——— Loading page ——— */

.loading-state {
  text-align: center;
  padding: 4rem 0 2rem;
}

.loading-indicator {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.loading-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #86868b;
  animation: loading-pulse 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loading-pulse {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: scale(0.85);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.loading-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
  color: #1d1d1f;
}

.loading-subtitle {
  font-size: 1.0625rem;
  line-height: 1.5;
  color: #6e6e73;
  margin: 0;
  max-width: 24rem;
  margin-inline: auto;
}

.setup-panel {
  background: #f5f5f7;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.setup-command {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  background: #1d1d1f;
  color: #f5f5f7;
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
  overflow-x: auto;
  margin: 0 0 1rem;
}

.setup-detail {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #6e6e73;
  margin: 0 0 0.75rem;
}

.setup-detail code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
}

.demo-notice {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #6e6e73;
  background: #f5f5f7;
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  margin: 0 0 2rem;
}

/* ——— Responsive ——— */

@media (max-width: 480px) {
  .site-header__inner {
    padding: 0.75rem 1.25rem;
    gap: 0.625rem 0.75rem;
  }

  .site-header__name {
    font-size: 0.9375rem;
  }

  .site-header__nav {
    width: 100%;
    gap: 0.375rem 0.875rem;
  }

  .site-header__nav a {
    font-size: 0.8125rem;
  }

  .page {
    padding: 2.5rem 1.25rem 4rem;
  }

  .report-section {
    margin-bottom: 2.75rem;
    padding-bottom: 2.75rem;
  }

  .section-value {
    font-size: 1.5rem;
  }
}
