:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #161616;
  background: #efefef;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #efefef; }
button { font: inherit; color: inherit; }

.prototype-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: #f7f7f7;
  border-inline: 1px solid #bcbcbc;
}

.prototype-main { padding: 18px 16px 108px; }

.overview {
  padding: 18px;
  background: #dedede;
  border: 2px solid #292929;
  border-radius: 18px;
}

.brand-row {
  display: grid;
  grid-template-columns: 54px 1fr 42px;
  gap: 12px;
  align-items: center;
}

.logo-placeholder {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid #292929;
  border-radius: 12px;
  background: #f7f7f7;
  font-size: 11px;
  font-weight: 700;
}

.eyebrow, .overview h1, .total-block p, .total-block strong,
.section-head h2, .merchant-card p, .merchant-card h3 { margin: 0; }
.eyebrow { color: #5c5c5c; font-size: 12px; }
.overview h1 { font-size: 22px; }

.icon-button, .sort-button, .sort-menu button, .load-more,
.bottom-nav button, .merchant-card { border: 1.5px solid #333; background: #fff; }

.icon-button { width: 42px; height: 42px; border-radius: 10px; cursor: pointer; }

.total-block { padding: 30px 0 24px; border-bottom: 1px solid #777; }
.total-block p { color: #555; font-size: 14px; }
.total-block strong { display: block; margin-top: 6px; font-size: clamp(30px, 9vw, 42px); letter-spacing: -1px; }
.total-block small { font-size: 13px; font-weight: 500; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); padding-top: 18px; }
.metrics div { min-width: 0; padding-inline: 10px; border-left: 1px solid #999; }
.metrics div:first-child { padding-left: 0; border-left: 0; }
.metrics div:last-child { padding-right: 0; }
.metrics span, .metrics small { display: block; color: #666; font-size: 10px; }
.metrics strong { display: block; margin: 5px 0 2px; font-size: 15px; overflow-wrap: anywhere; }

.merchant-section { margin-top: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h2 { font-size: 24px; }
.sort-button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }

.sort-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: -4px 0 14px;
  padding: 10px;
  background: #e5e5e5;
  border: 1.5px dashed #555;
  border-radius: 12px;
}
.sort-menu[hidden] { display: none; }
.sort-menu button { padding: 10px; border-radius: 8px; cursor: pointer; }
.sort-menu button[aria-pressed="true"] { background: #333; color: #fff; }

.merchant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.merchant-card { display: grid; min-width: 0; padding: 14px; border-radius: 14px; text-align: left; cursor: pointer; }
.merchant-card:active { transform: translateY(1px); }

.merchant-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border: 1.5px solid #333;
  border-radius: 50%;
  background: #e4e4e4;
  font-weight: 700;
}

.merchant-card h3 { display: flex; justify-content: space-between; gap: 8px; font-size: 16px; }
.merchant-card h3 span { color: #555; font-size: 12px; font-weight: 500; white-space: nowrap; }
.merchant-card .description { min-height: 36px; margin-top: 7px; color: #555; font-size: 12px; line-height: 1.5; }

.credit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #aaa; }
.credit-row span { min-width: 0; color: #666; font-size: 10px; }
.credit-row strong { display: block; margin-top: 3px; color: #161616; font-size: 13px; overflow-wrap: anywhere; }
.credit-row small { font-size: 9px; font-weight: 500; }

.load-more { width: 100%; margin-top: 14px; padding: 12px; border-radius: 10px; cursor: pointer; }
.load-more:disabled { color: #777; border-style: dashed; cursor: default; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(calc(100% - 24px), 406px);
  padding: 8px;
  transform: translateX(-50%);
  background: #fff;
  border: 2px solid #292929;
  border-radius: 18px;
}

.bottom-nav button { display: grid; gap: 4px; place-items: center; padding: 7px 2px; border-color: transparent; border-radius: 10px; background: transparent; font-size: 12px; cursor: pointer; }
.bottom-nav button span { font-size: 19px; }
.bottom-nav button.is-active { border-color: #333; background: #dedede; font-weight: 700; }

.prototype-toast {
  position: fixed;
  left: 50%;
  bottom: 98px;
  z-index: 20;
  width: min(calc(100% - 48px), 360px);
  padding: 12px 14px;
  transform: translateX(-50%);
  background: #202020;
  color: #fff;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 360px) {
  .prototype-main { padding-inline: 12px; }
  .overview { padding: 14px; }
  .metrics div { padding-inline: 6px; }
  .merchant-grid { gap: 8px; }
  .merchant-card { padding: 11px; }
}
