.bpai-app {
  --bg: #F5F1EA;
  --ink: #1C1A17;
  --ink-soft: #6B655C;
  --coral: #F2846B;
  --coral-soft: #F6BFAE;
  --teal: #49C6C0;
  --blue: #A9E1E8;
  --yellow: #E9C468;
  --olive: #ABBE6E;
  --pink: #F3B7C6;
  --white: #FFFFFF;
  --line: #E7E1D6;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(28,26,23,0.04), 0 8px 24px rgba(28,26,23,0.06);
  --font-display: 'Fredoka', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
}

.bpai-app, .bpai-app * { box-sizing: border-box; }

.bpai-app {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.bpai-app img { max-width: 100%; display: block; }

.bpai-app a { color: inherit; text-decoration: none; }

.bpai-app button { font-family: inherit; cursor: pointer; }

/* ---------- Topbar ---------- */
.bpai-app .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  max-width: 1180px;
  margin: 0 auto;
}

.bpai-app .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.bpai-app .bpai-app .logo-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.bpai-app .bpai-app .topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.bpai-app .get-app-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--white);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: none;
}

/* ---------- Landing hero ---------- */
.bpai-hero-wrap {
  max-width: 900px;
  margin: 60px auto 0;
  padding: 0 24px;
  text-align: center;
}

.bpai-hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 44px;
  margin-bottom: 36px;
}

.bpai-hero-logo .bpai-app .bpai-app .logo-mark { width: 44px; height: 44px; }

.bpai-hero-box {
  background: var(--coral-soft);
  border-radius: var(--radius-lg);
  padding: 48px 40px 40px;
}

.bpai-hero-box h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.25;
  margin: 0 0 26px;
  color: var(--ink);
}

.bpai-search-form {
  display: flex;
  gap: 10px;
  background: var(--white);
  border-radius: var(--radius-pill);
  padding: 6px 6px 6px 22px;
  box-shadow: var(--shadow);
}

.bpai-search-form input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 17px;
  font-family: var(--font-body);
  color: var(--ink);
  padding: 14px 0;
}

.bpai-search-form input::placeholder { color: #A69E90; }

.bpai-search-submit {
  border: none;
  background: var(--ink);
  color: var(--white);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bpai-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
}

.bpai-pill-row-label {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: -16px;
}

.bpai-pill {
  border: none;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
}

.bpai-pill:nth-child(8n+1) { background: var(--blue); }
.bpai-pill:nth-child(8n+2) { background: var(--coral); color: var(--white); }
.bpai-pill:nth-child(8n+3) { background: var(--pink); }
.bpai-pill:nth-child(8n+4) { background: var(--yellow); }
.bpai-pill:nth-child(8n+5) { background: var(--olive); }
.bpai-pill:nth-child(8n+6) { background: var(--teal); color: var(--white); }
.bpai-pill:nth-child(8n+7) { background: var(--coral-soft); }
.bpai-pill:nth-child(8n+0) { background: var(--blue); }

.bpai-app .footer-links {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  margin: 70px 0 30px;
}

.bpai-app .footer-links span { margin: 0 10px; }

/* ---------- Results view ---------- */
.bpai-results-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 140px;
  display: none;
}

.bpai-app.mode-results .bpai-hero-wrap { display: none; }
.bpai-app.mode-results .bpai-results-wrap { display: block; }

.bpai-results-query-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 30px;
}

.bpai-results-query-bar .bpai-search-form { flex: 1; }

.bpai-new-search-btn {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bpai-summary-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 28px 30px;
  box-shadow: var(--shadow);
  font-size: 17px;
  line-height: 1.7;
  color: #33302B;
}

.bpai-summary-card q, .bpai-summary-card .quote { font-style: italic; }

.bpai-summary-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bpai-skel-line { height: 14px; border-radius: 7px; background: linear-gradient(90deg, #EFEAE0 25%, #F7F3EC 37%, #EFEAE0 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.bpai-skel-line.w-full { width: 100%; }
.bpai-skel-line.w-90 { width: 90%; }
.bpai-skel-line.w-70 { width: 70%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.bpai-sources-row {
  display: flex;
  gap: 14px;
  margin: 26px 4px;
  flex-wrap: wrap;
}

.source-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 14px 8px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.source-chip .dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--teal);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 11px; font-weight: 700;
}

.bpai-cards-row {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 6px 4px 20px;
  scroll-snap-type: x proximity;
}

.pick-card {
  scroll-snap-align: start;
  flex: 0 0 260px;
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.pick-card-label {
  position: absolute;
  margin: 14px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
}

.pick-card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #F0ECE3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pick-card-media img { width: 100%; height: 100%; object-fit: cover; }

.pick-card-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.pick-card-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  min-height: 40px;
}

.pick-card-reason {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.pick-card-price {
  font-weight: 700;
  font-size: 16px;
  margin-top: 4px;
}

.pick-card-cta {
  margin-top: 10px;
  border: none;
  background: var(--ink);
  color: var(--white);
  padding: 11px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 13px;
  text-align: center;
}

.bpai-app .bpai-offers-panel {
  width: 100%;
  box-sizing: border-box;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.bpai-app .bpai-offer-row {
  width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "merchant price"
    "merchant action";
  align-items: center;
  column-gap: 10px;
  row-gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.bpai-app .bpai-offer-row .merchant {
  grid-area: merchant;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bpai-app .bpai-offer-row .merchant img {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 3px;
  box-sizing: border-box;
}

.bpai-app .bpai-offer-row .price {
  grid-area: price;
  justify-self: end;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.bpai-app .bpai-offer-row .go {
  grid-area: action;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  box-sizing: border-box;
  background: var(--ink);
  color: #fff !important;
  text-decoration: none !important;
  border: none;
  padding: 7px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}

.bpai-app .bpai-offer-row .go:hover {
  opacity: .86;
  color: #fff !important;
}

.bpai-app .bpai-offers-loading {
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

@media (max-width: 640px) {
  .bpai-app .bpai-offer-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 9px;
  }
  .bpai-app .bpai-offer-row .merchant {
    font-size: 11px;
  }
  .bpai-app .bpai-offer-row .price {
    font-size: 12px;
  }
  .bpai-app .bpai-offer-row .go {
    min-width: 76px;
    padding: 7px 9px;
  }
}

.bpai-app .error-box {
  background: #FBE4DF;
  color: #A6412C;
  border-radius: var(--radius-md);
  padding: 20px;
  font-size: 14px;
  font-weight: 500;
}

.bpai-followup-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, rgba(245,241,234,0) 0%, var(--bg) 40%);
  padding: 30px 24px 26px;
}

.bpai-followup-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  background: var(--white);
  border-radius: var(--radius-pill);
  padding: 6px 6px 6px 20px;
  box-shadow: var(--shadow);
}

.bpai-followup-inner input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 15px; font-family: var(--font-body); padding: 12px 0;
}

.bpai-followup-inner button {
  border: none; background: var(--ink); color: white;
  width: 40px; height: 40px; border-radius: 50%;
}

@media (max-width: 640px) {
  .bpai-app .topbar { padding: 16px; }
  .bpai-hero-wrap { margin-top: 30px; }
  .bpai-hero-box { padding: 32px 20px 28px; }
  .bpai-hero-box h1 { font-size: 26px; }
  .pick-card { flex-basis: 220px; }
}

/* US landing-page additions */
.bpai-hero-subtitle{max-width:650px;margin:-4px auto 20px;color:var(--muted);font-size:15px;line-height:1.55;text-align:center}.bpai-app .get-app-btn{text-decoration:none;display:inline-flex;align-items:center;justify-content:center}.bpai-app .footer-links{flex-wrap:wrap;justify-content:center}@media(max-width:640px){.bpai-hero-subtitle{font-size:14px;margin-bottom:16px;padding:0 6px}}

/* WordPress theme integration */
.bpai-app{background:#f5f1ea;padding:42px 0 80px;min-height:620px;color:var(--ink);font-family:var(--font-body);}
.bpai-hero-wrap{margin-top:10px;}
.bpai-eyebrow{display:block;font-size:12px;font-weight:800;letter-spacing:.14em;margin-bottom:12px;color:#6b655c;}
.bpai-hero-subtitle{margin:-12px auto 24px;max-width:650px;color:#5f574f;font-size:16px;line-height:1.6;}
.bpai-hero-logo .logo-mark{width:44px;height:44px;}
@media(max-width:700px){.bpai-app{padding-top:24px}.bpai-hero-box{padding:34px 20px 26px}.bpai-hero-box h1{font-size:28px}.bpai-results-query-bar{align-items:stretch;flex-direction:column}.bpai-new-search-btn{justify-content:center}}
