:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --ink: #17202a;
  --muted: #6d7784;
  --line: #dfe5df;
  --blue: #356dff;
  --green: #128461;
  --gold: #c58a26;
  --soft-gold: #fff6df;
  --soft-blue: #eef4ff;
  --soft-green: #edf8f3;
  --shadow: 0 24px 70px rgba(23, 32, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(53, 109, 255, 0.1), transparent 28%),
    linear-gradient(315deg, rgba(18, 132, 97, 0.11), transparent 30%),
    var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

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

.app-shell {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 48px;
}

.brand,
.account-chip,
.meta-row span {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 780;
}

.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.account-chip {
  gap: 10px;
  min-height: 42px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.account-chip span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.account-chip strong {
  font-size: 14px;
}

.profile-panel {
  margin: -28px 0 26px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
}

.login-card,
.setup-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.login-card h1,
.setup-card h1 {
  margin: 4px 0 8px;
  font-size: 24px;
  line-height: 1.1;
}

.profile-copy,
.profile-status {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.profile-status {
  min-height: 20px;
  margin: 12px 0 0;
}

.profile-status.success {
  color: var(--green);
}

.profile-status.error {
  color: #a93838;
}

.login-fields {
  margin-top: 14px;
}

.login-fields label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.inline-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inline-row input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 0 12px;
  background: #fbfcfb;
  color: var(--ink);
}

.inline-row button,
.small-action {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 820;
}

.inline-row button,
.small-action.primary-action {
  background: linear-gradient(135deg, var(--blue), #18a77e);
  color: #ffffff;
}

.profile-actions {
  margin-top: 14px;
}

.setup-heading,
.setup-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setup-heading {
  margin-bottom: 14px;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.75fr);
  gap: 14px;
}

.setup-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.setup-section-heading {
  margin-bottom: 10px;
}

.setup-section-heading strong {
  font-size: 15px;
}

.setup-section-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.choice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 256px;
  overflow: auto;
  padding-right: 4px;
}

.choice-list.compact {
  grid-template-columns: 1fr;
}

.choice-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.choice-item input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.choice-item span {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.eyebrow,
.label,
.rate-block span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

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

.search-card,
.recommendation-panel {
  width: min(720px, 100%);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.search-card label {
  display: block;
  margin: 0 0 8px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.recommendation-panel {
  width: 100%;
  margin-bottom: 16px;
  padding: 16px;
}

.recommendation-panel.is-loading {
  opacity: 0.78;
}

.recommendation-header {
  margin-bottom: 16px;
}

.mode-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-picker legend {
  margin: 0 0 8px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.mode-picker label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.mode-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-picker span {
  display: block;
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.mode-picker strong,
.mode-picker small {
  display: block;
}

.mode-picker strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.1;
}

.mode-picker small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.mode-picker input:checked + span {
  border-color: rgba(53, 109, 255, 0.42);
  background: linear-gradient(180deg, #ffffff, var(--soft-blue));
  box-shadow: inset 0 0 0 1px rgba(53, 109, 255, 0.12);
}

.mode-picker input:focus-visible + span {
  outline: 3px solid rgba(53, 109, 255, 0.24);
  outline-offset: 2px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-row input {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 0 16px;
  background: #fbfcfb;
  color: var(--ink);
  font-size: 20px;
  font-weight: 760;
}

.search-row button,
.primary-action,
.secondary-action {
  min-height: 52px;
  border-radius: 8px;
  font-weight: 820;
}

.search-row button,
.primary-action {
  border: 0;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--blue), #18a77e);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(53, 109, 255, 0.22);
}

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

.answer-card {
  display: flex;
  flex-direction: column;
  min-height: 456px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.merchant-card {
  background: linear-gradient(180deg, var(--soft-gold), #ffffff 45%);
}

.portal-card {
  background: linear-gradient(180deg, var(--soft-green), #ffffff 45%);
}

.card-card {
  background: linear-gradient(180deg, var(--soft-blue), #ffffff 45%);
}

.answer-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.answer-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.nike-icon {
  background: var(--gold);
}

.card-icon {
  background: var(--blue);
}

.card-icon::before {
  content: "";
  width: 26px;
  height: 17px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 -5px rgba(255, 255, 255, 0.48);
}

h2 {
  margin: 4px 0 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1;
}

.rate-block {
  display: grid;
  align-content: center;
  min-height: 132px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(223, 229, 223, 0.78);
  text-align: center;
}

.compact-rate strong {
  font-size: clamp(42px, 6vw, 66px);
}

.rate-block strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(56px, 8vw, 86px);
  line-height: 0.92;
}

.answer-copy {
  max-width: 520px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: auto 0 18px;
}

.meta-row span {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.card-recommendation {
  position: relative;
  min-height: 244px;
  margin-bottom: 18px;
  padding: 18px 92px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.card-recommendation strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  line-height: 1.08;
}

.card-recommendation p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.card-recommendation b {
  position: absolute;
  top: 20px;
  right: 18px;
  color: var(--blue);
  font-size: 34px;
  line-height: 1;
}

.secondary-action {
  border: 1px solid var(--line);
  padding: 0 20px;
  background: #ffffff;
  color: var(--ink);
}

.link-action {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
}

.link-action.is-muted {
  color: var(--muted);
  pointer-events: none;
}

@media (max-width: 820px) {
  .topbar {
    margin-bottom: 36px;
  }

  .profile-layout,
  .setup-grid {
    grid-template-columns: 1fr;
  }

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

  .answer-card {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 28px, 1120px);
    padding-top: 18px;
  }

  .topbar,
  .search-row,
  .mode-picker {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .account-chip {
    justify-self: start;
  }

  .inline-row,
  .choice-list {
    grid-template-columns: 1fr;
  }

  .search-row {
    display: grid;
  }

  .answer-card {
    padding: 18px;
  }

  .card-recommendation {
    min-height: 190px;
  }
}
