:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #637083;
  --line: #dce4ee;
  --color-border: var(--line);
  --line-strong: #cbd7e6;
  --teal: #00796f;
  --teal-dark: #00645d;
  --blue: #2f6df6;
  --gold: #c58a26;
  --soft-teal: #eefbf8;
  --soft-blue: #eef5ff;
  --soft-gold: #fff8e8;
  --shadow: 0 18px 46px rgba(17, 24, 39, 0.07);
  --color-background-info: #e9f7ff;
  --color-text-info: #075985;
  --color-background-secondary: #f4f7fb;
  --color-text-primary: var(--ink);
  --color-text-secondary: var(--muted);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: 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:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(0, 121, 111, 0.22);
  outline-offset: 3px;
}

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

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

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

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 36px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 64px;
  margin-bottom: 18px;
}

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

.brand {
  gap: 12px;
  width: max-content;
  font-size: 26px;
  font-weight: 850;
}

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

.topbar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.signin-cta {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--color-background-info);
  color: var(--color-text-info);
  font-size: 14px;
  font-weight: 820;
}

.signin-cta[hidden] {
  display: none;
}

.account-chip[hidden] {
  display: none;
}

.account-chip {
  justify-self: end;
  gap: 12px;
  min-height: 48px;
  padding: 6px 16px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

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

.account-chip strong {
  max-width: 210px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 740;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 20;
  width: min(360px, calc(100vw - 32px));
}

.profile-popover[hidden] {
  display: none;
}

.profile-popover .login-card {
  box-shadow: 0 22px 58px rgba(17, 24, 39, 0.16);
}

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

.main-column {
  min-width: 0;
}

.search-panel,
.recommendation-panel,
.login-card,
.setup-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-panel {
  padding: 24px;
  margin-bottom: 18px;
}

.search-card {
  margin: 0;
  position: relative;
}

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

.search-glyph {
  position: relative;
  width: 42px;
  height: 52px;
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: #fbfdff;
}

.search-glyph::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 15px;
  width: 13px;
  height: 13px;
  border: 2px solid #64748b;
  border-radius: 50%;
}

.search-glyph::after {
  content: "";
  position: absolute;
  left: 27px;
  top: 29px;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: #64748b;
  transform: rotate(45deg);
}

.search-row input {
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-left: 0;
  border-radius: 0;
  outline: 0;
  padding: 0 12px 0 8px;
  background: #fbfdff;
  color: var(--ink);
  font-size: 20px;
  font-weight: 620;
  appearance: none;
}

.search-row input::-webkit-search-cancel-button,
.search-row input::-webkit-search-decoration,
.search-row input::-webkit-search-results-button,
.search-row input::-webkit-search-results-decoration {
  display: none;
}

.search-row > button,
.primary-action {
  min-height: 52px;
  margin-left: 12px;
  padding: 0 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), #00937e);
  color: #ffffff;
  font-weight: 820;
  box-shadow: 0 12px 26px rgba(0, 121, 111, 0.18);
}

.autocomplete-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 42px;
  width: min(520px, calc(100% - 170px));
  min-width: 240px;
  max-height: 292px;
  overflow: hidden auto;
  z-index: 100;
  border: 0.5px solid var(--color-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.autocomplete-list[hidden] {
  display: none;
}

.autocomplete-item {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}

.autocomplete-item:hover,
.autocomplete-item:focus-visible {
  background: var(--color-background-secondary);
  outline: 0;
}

.autocomplete-item .domain {
  font-weight: 500;
}

.autocomplete-item .name {
  color: var(--color-text-secondary);
  font-size: 12px;
}

.mode-block {
  display: none;
  margin-top: 20px;
}

.mode-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: #334155;
  font-size: 15px;
  font-weight: 720;
}

.mode-heading b {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid #94a3b8;
  border-radius: 50%;
  color: #64748b;
  font-size: 11px;
}

.mode-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfdff;
}

.mode-picker legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.mode-picker label + label {
  border-left: 1px solid var(--line-strong);
}

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

.mode-picker span {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  min-height: 72px;
  padding: 12px 14px;
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.mode-picker i {
  color: var(--ink);
  font-style: normal;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

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

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

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

.mode-picker input:checked + span {
  background: var(--soft-teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.mode-picker input:checked + span i {
  color: var(--teal);
}

.view[hidden] {
  display: none;
}

.recommendation-panel {
  padding: 20px;
}

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

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

.recommendation-title h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.recommendation-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.recommendation-title > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.answer-card {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(180px, 0.85fr) minmax(388px, 0.92fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.stack-label {
  display: block;
  margin: 4px 0;
  color: #888888;
  font-size: 12px;
  font-weight: 760;
  text-align: center;
}

.card-card {
  grid-template-columns: 36px minmax(180px, 0.85fr) minmax(388px, 0.92fr) minmax(0, 1fr);
}

.step-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--teal);
  color: #ffffff;
  font-size: 16px;
  font-weight: 820;
}

.answer-heading {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.answer-icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 8px;
  background: var(--soft-teal);
  color: var(--teal);
  font-size: 20px;
  font-weight: 900;
}

.action-icon {
  position: relative;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.action-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.action-icon.is-muted {
  opacity: 0.52;
  pointer-events: none;
}

.merchant-icon {
  background: #eefbf6;
  color: var(--ink);
}

.portal-card .answer-icon {
  background: linear-gradient(135deg, #7527d8, #9d42f3);
  color: #ffffff;
}

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

.card-icon::before {
  content: "";
  width: 36px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0f4f91, #1d78c8);
  box-shadow: inset 0 -8px rgba(255, 255, 255, 0.18);
}

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

.step-subtitle {
  color: var(--ink);
  font-size: 15px;
  font-weight: 880;
}

h2 {
  margin: 6px 0 0;
  font-size: 16px;
  line-height: 1.2;
}

.rate-block {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 118px;
  min-height: 58px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--soft-teal);
  color: var(--teal);
  text-align: center;
}

.rate-block[hidden] {
  display: none;
}

.portal-card .rate-block {
  background: #f3e8ff;
  color: #7c2fe3;
}

.rate-block strong,
.compact-rate strong {
  display: block;
  margin-top: 3px;
  font-size: 24px;
  line-height: 1;
}

.answer-detail {
  min-width: 0;
}

.answer-copy {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.answer-copy:empty,
.meta-row:empty {
  display: none;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.meta-row span:empty {
  display: none;
}

.portal-card .meta-row {
  display: none;
}

.answer-detail:has(.answer-copy:empty) {
  display: none;
}

.card-options {
  display: grid;
  grid-column: 3;
  justify-self: center;
  width: 100%;
  gap: 8px;
  min-width: 0;
}

.card-recommendation {
  position: relative;
  min-height: 76px;
  padding: 10px 64px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

a.card-recommendation {
  display: block;
  color: inherit;
  text-decoration: none;
}

a.card-recommendation:hover {
  border-color: rgba(0, 118, 109, 0.32);
  background: #f5fbfa;
}

.card-recommendation strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.15;
}

.card-recommendation p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.reward-summary {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  background: transparent;
  text-align: right;
}

.reward-summary span {
  display: inline;
  margin-right: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

.reward-summary strong {
  color: var(--teal);
  font-size: 28px;
  line-height: 1;
}

.quick-link-card b {
  top: 22px;
  font-size: 12px;
  font-weight: 850;
}

.secondary-action,
.link-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

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

.login-card {
  padding: 24px;
}

.login-card h1 {
  margin: 4px 0 8px;
  font-size: 28px;
  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(--teal);
}

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

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

.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: #fbfdff;
  color: var(--ink);
}

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

.inline-row button {
  background: linear-gradient(135deg, var(--teal), #00937e);
  color: #ffffff;
}

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

.wallet-sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  min-width: 0;
}

.setup-card {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto auto;
  height: calc(100vh - 32px);
  min-height: 640px;
  max-height: 860px;
  padding: 20px;
}

.wallet-heading {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.wallet-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--soft-teal);
  border: 1px solid #b6e7df;
}

.wallet-icon::before {
  content: "";
  width: 24px;
  height: 18px;
  border: 2px solid var(--teal);
  border-radius: 5px;
}

.wallet-heading h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.wallet-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.setup-section {
  padding: 18px 0 0;
}

.profile-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.profile-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.profile-tab span {
  min-width: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e8eef4;
  color: #475569;
  font-size: 11px;
  line-height: 1;
}

.profile-tab.is-active {
  background: #ffffff;
  color: var(--teal-dark);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.profile-tab.is-active span {
  background: var(--soft-teal);
  color: var(--teal-dark);
}

.preference-box {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.preference-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.preference-box select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.profile-pane {
  display: none;
  min-height: 0;
  padding-top: 18px;
}

.profile-pane.is-active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

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

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

.add-card-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.add-card-box label {
  display: grid;
  gap: 6px;
}

.add-card-box label span,
.settings-list-heading span,
.pane-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.add-card-box select {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.add-card-button {
  min-height: 38px;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
}

.settings-list-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 10px;
}

.settings-list-heading b {
  color: var(--teal);
  font-size: 12px;
}

.pane-hint {
  margin: -2px 0 12px;
  line-height: 1.4;
}

.profile-list {
  display: grid;
  align-content: start;
  flex: 1 1 0;
  gap: 10px;
  grid-auto-rows: max-content;
  min-height: 0;
  height: auto;
  overflow: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.profile-list::-webkit-scrollbar {
  width: 8px;
}

.profile-list::-webkit-scrollbar-track {
  background: transparent;
}

.profile-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd5e1;
}

.profile-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.profile-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
}

.profile-group summary::-webkit-details-marker {
  display: none;
}

.profile-group summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 900;
}

.profile-group[open] summary::after {
  content: "-";
}

.profile-group-title {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-group-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.profile-group-body {
  border-top: 1px solid var(--line);
}

.profile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 11px 12px;
  background: #ffffff;
}

.profile-row + .profile-row {
  border-top: 1px solid var(--line);
}

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

.profile-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.remove-row-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #f4c7c7;
  border-radius: 7px;
  background: #fff7f7;
  color: #b42318;
  font-size: 12px;
  font-weight: 820;
}

.portal-row {
  cursor: pointer;
}

.portal-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.portal-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.profile-empty {
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.selected-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid #d9ebe8;
  border-radius: 8px;
  background: #f7fcfb;
}

.selected-chip,
.selected-empty {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
}

.selected-chip {
  padding: 5px 9px;
  background: #ffffff;
  color: var(--teal);
  border: 1px solid #bfe7e1;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(10, 122, 113, 0.07);
}

.selected-empty {
  color: var(--muted);
}

.profile-search {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.profile-search span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.profile-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.profile-search input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 122, 113, 0.12);
}

.choice-list {
  display: grid;
  max-height: 260px;
  overflow: auto;
  gap: 8px;
  padding-right: 2px;
}

.choice-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.choice-group[hidden],
.choice-item[hidden] {
  display: none;
}

.choice-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 820;
  list-style: none;
}

.choice-group summary::-webkit-details-marker {
  display: none;
}

.choice-group summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 900;
}

.choice-group[open] summary::after {
  content: "−";
}

.choice-group-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-group-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.choice-group-body {
  border-top: 1px solid var(--line);
}

.choice-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.choice-item:hover {
  background: #f9fbfc;
}

.choice-item:has(input:checked) {
  background: #f1faf8;
}

.choice-group-body .choice-item + .choice-item {
  border-top: 1px solid var(--line);
}

.choice-item input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.choice-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #ffffff;
  color: #ffffff;
  transition: background 160ms ease, border-color 160ms ease;
}

.choice-check::before {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translateY(-1px);
}

.choice-item:has(input:checked) .choice-check {
  border-color: var(--teal);
  background: var(--teal);
}

.choice-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.choice-name {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-save {
  width: 100%;
  margin: 20px 0 0;
}

.setup-progress {
  margin-top: 18px;
}

.setup-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.setup-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--teal), #00937e);
  transition: width 180ms ease;
}

.setup-progress p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.setup-progress p[hidden] {
  display: none;
}

.wallet-saved {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

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

  .main-column {
    order: 1;
  }

  .wallet-sidebar {
    order: 2;
    position: static;
  }

  .setup-card {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .profile-pane.is-active {
    overflow: visible;
  }

  .profile-list {
    flex: 0 0 auto;
    height: clamp(220px, 42vh, 340px);
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 28px, 1440px);
    padding-top: 12px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topbar-actions {
    justify-self: stretch;
  }

  .brand {
    font-size: 22px;
  }

  .brand img {
    width: 46px;
    height: 46px;
  }

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

  .signin-cta {
    min-height: 40px;
  }

  .search-panel {
    padding: 14px;
  }

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

  .search-row > button {
    grid-column: 1 / -1;
    width: 100%;
    margin: 10px 0 0;
  }

  .autocomplete-list {
    left: 42px;
    width: calc(100% - 42px);
  }

  .mode-picker {
    grid-template-columns: 1fr;
  }

  .mode-picker label + label {
    border-left: 0;
    border-top: 1px solid var(--line-strong);
  }

  .recommendation-title {
    display: block;
  }

  .recommendation-title > span {
    display: block;
    margin-top: 8px;
  }

  .answer-card,
  .card-card {
    grid-template-columns: 30px 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 76px;
    padding: 12px;
  }

  .step-badge {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .answer-heading {
    display: contents;
  }

  .answer-icon {
    grid-column: 2;
    width: 52px;
    height: 52px;
    font-size: 16px;
  }

  .answer-heading > div {
    grid-column: 3;
    min-width: 0;
  }

  .step-subtitle {
    font-size: 13px;
  }

  h2 {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rate-block {
    grid-column: 4;
    width: auto;
    min-width: 64px;
    min-height: 42px;
    padding: 6px 8px;
  }

  .rate-block span {
    font-size: 10px;
  }

  .rate-block strong,
  .compact-rate strong {
    font-size: 17px;
  }

  .answer-detail {
    grid-column: 3 / -1;
    width: 100%;
  }

  .answer-copy {
    max-width: none;
    font-size: 12px;
  }

  .card-options {
    grid-column: 2 / -1;
    justify-self: stretch;
  }

  .card-recommendation {
    min-height: 66px;
    padding: 9px 58px 9px 12px;
  }

  .card-recommendation strong {
    font-size: 14px;
  }

  .card-recommendation p {
    font-size: 11px;
  }

  .card-recommendation b {
    top: 17px;
    right: 12px;
    font-size: 16px;
  }

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

  .reward-summary {
    text-align: right;
  }

  .reward-summary strong {
    font-size: 24px;
  }
}
