:root {
  --topbar-height: 84px;
  --bg: #f5f5f5;
  --paper: #ffffff;
  --ink: #171717;
  --muted: #666666;
  --line: #dedede;
  --green: #078a4f;
  --green-dark: #05653a;
  --red: #bf0000;
  --red-dark: #8f0000;
  --gold: #b17900;
  --blue: #0068b7;
  --shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(16px, 5vw, 64px);
  background: #fff;
  border-bottom: 4px solid var(--red);
  backdrop-filter: blur(12px);
}

.brandline {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brandmark {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  font-style: italic;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 160ms ease, transform 160ms ease;
}

.brandmark:hover,
.brandmark:focus-visible {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.brandmark:focus-visible {
  outline: 3px solid rgba(191, 0, 0, 0.24);
  outline-offset: 3px;
}

.kicker,
.eyebrow {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

strong {
  font-variant-numeric: tabular-nums;
}

.number-animating {
  color: var(--red) !important;
  text-shadow: 0 0 12px rgba(191, 0, 0, 0.18);
}

.negative-money {
  color: var(--red) !important;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: 0;
}

.search {
  display: grid;
  grid-template-columns: auto minmax(180px, 360px);
  align-items: center;
  gap: 8px;
  min-width: 220px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search input {
  height: 38px;
  min-width: 0;
  padding: 0 12px;
  border: 2px solid var(--red);
  border-radius: 4px;
}

.header-character {
  display: grid;
  grid-template-columns: 42px minmax(90px, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 180px;
  max-width: 260px;
  padding: 7px 10px;
  background: #fff7f7;
  border: 1px solid #f1c6c6;
  border-radius: 8px;
  text-align: left;
}

.header-character:hover,
.header-character:focus-visible {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(191, 0, 0, 0.12);
  outline: none;
}

.header-character img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
}

.mobile-cart-button,
.mobile-cart-close {
  display: none;
}

.header-character span,
.header-character small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.header-character strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-character small {
  margin-top: 2px;
  color: var(--red);
}

.wallet {
  display: grid;
  gap: 3px;
  min-width: min(340px, 43vw);
  text-align: right;
}

.wallet span,
.stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.wallet strong {
  color: var(--red);
  font-size: clamp(24px, 3.8vw, 48px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.wallet strong small,
.cart-summary strong small,
.complete-grid strong small {
  display: inline-block;
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.wallet strong > span {
  display: block;
}

.wallet strong small {
  display: block;
  margin: 5px 0 0;
}

.cart-summary strong,
.complete-grid strong {
  display: grid;
  justify-items: end;
  text-align: right;
}

.cart-summary strong small,
.complete-grid strong small {
  margin: 3px 0 0;
}

main {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: calc(var(--topbar-height) + 16px) 0 56px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 18px;
  margin-top: 28px;
  padding: 18px 0 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}

.site-footer a {
  color: var(--red);
  font-weight: 900;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  min-width: 108px;
  min-height: 42px;
  color: var(--red);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
  font-weight: 900;
}

.tab.active {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px;
  background: linear-gradient(120deg, #fff 0 50%, #fff2f2 50%);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.hero h2 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(28px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(118px, 1fr));
  gap: 10px;
  min-width: 300px;
}

.stats div {
  padding: 14px;
  background: #fefefe;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.progress {
  margin: 14px 0 0;
  height: 14px;
  overflow: hidden;
  background: #e4ddd1;
  border: 1px solid var(--line);
  border-radius: 999px;
}

#progressBar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--red), #ef7d00, var(--gold));
  transition: width 180ms ease;
}

.campaigns,
.new-arrivals {
  margin-top: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.campaign-head,
.new-arrival-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.campaign-head h2,
.new-arrival-head h2 {
  margin-bottom: 0;
}

.campaign-head > span,
.new-arrival-head > span {
  color: var(--red);
  font-weight: 900;
}

.new-arrival-tools,
.new-arrival-arrows {
  display: flex;
  align-items: center;
  gap: 8px;
}

.new-arrival-arrows button {
  width: 32px;
  height: 32px;
  color: var(--red);
  background: #fff;
  border: 1px solid #efcaca;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
}

.new-arrival-arrows button:hover,
.new-arrival-arrows button:focus-visible {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
  outline: none;
}

.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.campaign-entry-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  color: var(--muted);
  background: #fff8e6;
  border: 1px solid #f2d493;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.campaign-entry-guide strong {
  color: var(--green-dark);
}

.campaign-card {
  display: grid;
  gap: 9px;
  min-height: 190px;
  padding: 15px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 0, rgba(255, 215, 0, 0.42), transparent 34%),
    linear-gradient(135deg, #970000, #d40b0b 58%, #6f0000);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(143, 0, 0, 0.18);
}

.campaign-card.entered {
  background:
    radial-gradient(circle at 90% 0, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(135deg, #05603a, #078a4f 58%, #034c2d);
  box-shadow: 0 0 0 3px rgba(7, 138, 79, 0.18), 0 8px 22px rgba(5, 101, 58, 0.2);
}

.campaign-titleline,
.campaign-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.campaign-titleline span {
  padding: 4px 7px;
  color: var(--red-dark);
  background: #fff;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 900;
}

.campaign-titleline strong {
  color: #ffe27a;
  font-size: 18px;
}

.campaign-card h3 {
  margin-bottom: 0;
  font-size: 21px;
  line-height: 1.2;
}

.campaign-card p {
  margin-bottom: 0;
  color: #fff5f5;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.campaign-action {
  align-self: end;
  margin-top: auto;
}

.campaign-action small {
  color: #ffe4e4;
  font-size: 11px;
  font-weight: 800;
}

.campaign-action button {
  min-height: 34px;
  padding: 0 11px;
  color: var(--red-dark);
  background: #fff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 900;
}

.campaign-action button:disabled {
  color: var(--green-dark);
  background: #ecfff4;
  cursor: default;
  opacity: 1;
}

.new-arrival-grid {
  display: flex;
  gap: 12px;
  padding: 2px 2px 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-color: #efb7b7 transparent;
}

.new-arrival-card {
  position: relative;
  flex: 0 0 clamp(220px, 23vw, 280px);
  min-height: 170px;
  padding: 9px;
  color: var(--ink);
  background: #fffafa;
  border: 1px solid #efcaca;
  border-radius: 8px;
  text-align: left;
  box-shadow: 0 3px 10px rgba(191, 0, 0, 0.06);
  scroll-snap-align: start;
}

.new-arrival-card:focus-within {
  border-color: var(--red);
  transform: translateY(-1px);
}

.new-arrival-detail {
  display: grid;
  grid-template-columns: minmax(88px, 42%) 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.new-arrival-detail:hover,
.new-arrival-detail:focus-visible {
  color: var(--red);
  outline: none;
}

.new-arrival-card img {
  width: 100%;
  aspect-ratio: 1;
  padding: 5px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 5px;
}

.new-arrival-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 3px 6px;
  color: #fff;
  background: var(--red);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 900;
}

.new-arrival-copy,
.new-arrival-copy b,
.new-arrival-copy strong,
.new-arrival-copy small {
  display: block;
}

.new-arrival-copy small {
  margin-bottom: 5px;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
}

.new-arrival-copy b {
  font-size: 14px;
  line-height: 1.3;
}

.new-arrival-copy strong {
  margin-top: 7px;
  color: var(--red);
  font-size: 14px;
}

.new-arrival-copy strong small {
  display: inline;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.new-arrival-add {
  width: 100%;
  min-height: 32px;
  margin-top: 8px;
  padding: 6px 8px;
  color: #fff;
  background: var(--red);
  border: 1px solid var(--red);
  border-radius: 5px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.new-arrival-add:hover,
.new-arrival-add:focus-visible {
  background: #990000;
  border-color: #990000;
  outline: none;
}

.insight-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}

.plan-panel,
.conversion-panel,
.suggestion-panel {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.plan-button {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  border-radius: 8px;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.plan-button b {
  font-size: 16px;
}

.plan-button span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.plan-button strong {
  color: var(--red);
  font-size: 15px;
}

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

.conversion-grid div {
  padding: 14px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.conversion-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.conversion-grid strong {
  color: var(--red);
  font-size: 24px;
}

.suggestion-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: #fffafa;
  border: 1px solid #f0caca;
  border-radius: 8px;
}

.suggestion-card b,
.suggestion-card span {
  display: block;
}

.suggestion-card b {
  margin-bottom: 4px;
  font-size: 20px;
}

.suggestion-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.suggestion-card button {
  min-width: 112px;
  min-height: 40px;
  color: #fff;
  background: var(--red);
  border-radius: 4px;
  font-weight: 900;
}

.characters {
  margin-top: 16px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.section-head.flat {
  padding: 0 0 8px;
  border-bottom: 0;
}

.section-head.flat h2 {
  font-size: 20px;
}

.section-head.flat span {
  font-size: 12px;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
}

.character {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 54px;
  padding: 6px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: left;
}

.character.active {
  border-color: var(--red);
  background: #fff6f6;
}

.avatar {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: cover;
  background: linear-gradient(135deg, #fff7f7, #f2f2f2);
  border: 2px solid #fff;
  border-radius: 7px;
  box-shadow: 0 0 0 1px var(--line);
}

.character b,
.character span,
.character small {
  display: block;
}

.character b {
  margin-bottom: 1px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-tag {
  display: inline-block;
  margin: 0 0 2px;
  padding: 1px 4px;
  color: #fff;
  background: var(--red);
  border-radius: 3px;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}

.character span span {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.character small {
  display: none;
}

.controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 0;
}

.controls button {
  min-height: 42px;
  padding: 0 16px;
  color: #fff;
  background: var(--red);
  border-radius: 4px;
  font-weight: 800;
}

.controls button:last-child {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.category-tabs {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.filter-group {
  display: grid;
  gap: 6px;
}

.filter-group > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.filter-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-tabs button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--red);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.category-tabs button.active {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.sort-group select {
  width: min(220px, 100%);
  min-height: 38px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-weight: 900;
}

.filter-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
  overflow: visible;
}

.view {
  display: none;
}

.view.active {
  display: grid;
}

.grid {
  display: grid;
  gap: 18px;
}

.product-shelf {
  display: grid;
  gap: 12px;
}

.shelf-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border-left: 6px solid var(--red);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.shelf-head h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.shelf-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.shelf-more {
  justify-self: center;
  min-width: min(100%, 320px);
  min-height: 44px;
  padding: 0 20px;
  color: var(--red);
  background: #fff;
  border: 1px solid #efb7b7;
  border-radius: 6px;
  font-weight: 900;
}

.shelf-more:hover,
.shelf-more:focus-visible {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
  outline: none;
}

.card {
  position: relative;
  display: grid;
  grid-template-rows: 118px 48px 30px 62px 42px;
  gap: 8px;
  height: 380px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card.daily-pick {
  border-color: #f2b705;
  box-shadow: 0 0 0 2px rgba(242, 183, 5, 0.16), var(--shadow);
}

.card.daily-pick .badge {
  background: #b17900;
}

.card.new-product {
  border-color: #ef9d9d;
}

.card.new-product .badge {
  background: var(--red);
}

.meta .trend-label {
  color: #8f0000;
  background: #fff1f1;
  border-color: #efb7b7;
}

.card.in-cart {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(7, 138, 79, 0.14), var(--shadow);
}

.card.in-cart::after {
  position: absolute;
  top: 12px;
  right: 50px;
  padding: 4px 7px;
  color: #fff;
  background: var(--green);
  border-radius: 3px;
  content: "購入中";
  font-size: 12px;
  font-weight: 900;
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 4px 7px;
  color: #fff;
  background: var(--red);
  border-radius: 3px;
  font-size: 12px;
  font-weight: 900;
}

.product-url {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  min-height: 27px;
  padding: 0 7px;
  color: var(--red);
  background: #fff;
  border: 1px solid #efb7b7;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
}

.product-url:hover,
.product-url:focus-visible {
  color: #fff;
  background: var(--red);
  outline: none;
}

.card.product-url-target {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(191, 0, 0, 0.18), var(--shadow);
}

.item-photo {
  display: block;
  width: 100%;
  height: 118px;
  padding: 18px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #eeeeee;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px #fafafa;
  filter: saturate(0.96) contrast(1.03);
}

.card h3 {
  margin-bottom: 0;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.2;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.meta {
  overflow: hidden;
  min-height: 22px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.meta span {
  display: inline-block;
  margin-right: 6px;
  padding: 3px 7px;
  background: #f7f7f7;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.price {
  margin-bottom: 4px;
  color: var(--red);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.price-compact {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.actions {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 8px;
  margin-top: auto;
}

.actions button,
.actions input {
  height: 42px;
  border-radius: 7px;
  font-weight: 900;
}

.actions .buy {
  padding: 0 5px;
  font-size: 12px;
  line-height: 1.1;
}

.buy {
  color: #fff;
  background: #009944;
}

.buy:disabled {
  cursor: not-allowed;
  background: #c9d8cf;
}

.actions input {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  text-align: center;
}

.receipt {
  position: sticky;
  top: calc(var(--topbar-height) + 16px);
  z-index: 8;
  align-self: start;
  justify-self: stretch;
  height: max-content;
  max-height: calc(100vh - var(--topbar-height) - 32px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

@media (min-width: 861px) {
  .receipt {
    position: fixed;
    top: calc(var(--topbar-height) + 74px);
    right: 16px;
    width: 300px;
  }

  #productGrid {
    grid-column: 1;
  }
}

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

.receipt h2 {
  margin: 0;
  font-size: 24px;
}

.cart-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.cart-tools button {
  min-height: 34px;
  color: var(--red);
  background: #fff;
  border: 1px solid var(--red);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 900;
}

.cart-tools button:first-child {
  color: #fff;
  background: var(--red);
}

.receipt ul {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - var(--topbar-height) - 310px);
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.receipt li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.receipt b {
  font-size: 15px;
}

.receipt small {
  color: var(--muted);
}

.cart-remove {
  grid-column: 1 / -1;
  justify-self: end;
  min-height: 28px;
  padding: 0 10px;
  color: var(--red);
  background: #fff;
  border: 1px solid var(--red);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 900;
}

#emptyReceipt {
  margin: 0;
  color: var(--muted);
}

.cart-summary {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px solid var(--line);
}

.cart-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.cart-summary strong {
  color: var(--red);
  font-size: 17px;
}

.installment-interest-row strong {
  color: #a34b00;
}

.overdraft-row {
  margin-top: 2px;
  padding-top: 10px;
  color: var(--red);
  background: #fff5f5;
  border-top: 1px dashed #f0b4b4;
}

.payment-plan {
  display: grid;
  gap: 6px;
}

.payment-plan select,
.loan-panel select,
.loan-panel input {
  min-height: 40px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-weight: 800;
}

.payment-plan small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.checkout {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  color: #fff;
  background: var(--red);
  border-radius: 4px;
  font-weight: 900;
}

.checkout:disabled {
  cursor: not-allowed;
  background: #d8d8d8;
}

.account {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.debt {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.debt-card,
.loan-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.debt-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 20px;
  padding: 22px;
  border-top: 5px solid var(--red);
}

.debt-card h2 {
  margin-bottom: 8px;
  font-size: clamp(30px, 5vw, 58px);
}

.debt-stats {
  display: grid;
  gap: 10px;
}

.debt-stats div {
  padding: 14px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.debt-stats span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.debt-stats strong {
  color: var(--red);
  font-size: 22px;
}

.loan-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.loan-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.loan-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  grid-column: 1 / -1;
}

.loan-presets button,
#clearDebtBtn {
  min-height: 40px;
  color: var(--red);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-weight: 900;
}

#borrowBtn,
#clearDebtBtn {
  margin-top: 0;
}

.account-main,
.account-side {
  display: grid;
  gap: 16px;
}

.bank-hero,
.bank-actions,
.statement,
.account-side section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.bank-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border-top: 5px solid var(--red);
}

.bank-hero h2 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 46px);
}

.masked {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.bank-balance {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 280px;
  text-align: right;
}

.bank-balance span {
  color: var(--muted);
  font-weight: 700;
}

.bank-balance strong {
  color: var(--red);
  font-size: clamp(28px, 4vw, 44px);
}

.bank-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.bank-actions button {
  min-height: 58px;
  color: var(--red);
  background: #fff;
  font-weight: 900;
}

.statement {
  overflow: hidden;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.section-head span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid #eeeeee;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

th {
  color: var(--muted);
  background: #fafafa;
  font-size: 13px;
}

td.withdrawal {
  color: var(--red);
  font-weight: 900;
}

.account-side section {
  padding: 16px;
}

.account-side h2 {
  margin-bottom: 10px;
  font-size: 20px;
}

.account-side strong {
  display: block;
  color: var(--red);
  font-size: 30px;
}

.account-side p {
  margin-bottom: 0;
  color: var(--muted);
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.achievement-badge {
  padding: 7px 9px;
  color: #7a1c1c;
  background: #fff4f4;
  border: 1px solid #f0caca;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.achievement-badge.locked {
  color: #777;
  background: #f5f5f5;
  border-color: var(--line);
}

.order-history-list {
  display: grid;
  gap: 10px;
}

.order-history-list p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.history-card {
  display: grid;
  gap: 5px;
  padding: 10px;
  background: #fffafa;
  border: 1px solid #f0caca;
  border-radius: 8px;
}

.history-card b {
  color: var(--ink);
  font-size: 13px;
}

.history-card span,
.history-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-card strong {
  color: var(--red);
  font-size: 18px;
}

.history-card button {
  min-height: 32px;
  color: #fff;
  background: var(--red);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 900;
}

.category-row {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.category-row div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.category-track {
  height: 10px;
  overflow: hidden;
  background: #eeeeee;
  border-radius: 999px;
}

.category-fill {
  display: block;
  height: 100%;
  background: var(--red);
}

.complete {
  grid-template-columns: minmax(0, 1fr);
}

.complete-card {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 36px);
  background: #fff;
  border: 1px solid var(--line);
  border-top: 6px solid var(--red);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.checkmark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  color: #fff;
  background: #009944;
  border-radius: 50%;
  font-size: 40px;
  font-weight: 900;
}

.complete-card > h2 {
  margin-bottom: 0;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1;
}

.complete-lead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.order-confirmation {
  display: grid;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d8c8ad;
  border-top: 4px solid var(--red);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.order-confirmation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 8px 16px;
  color: var(--red);
  border-bottom: 1px solid #eadfcf;
}

.confirmation-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 3px;
  font-size: 21px;
  font-weight: 900;
}

.order-confirmation-head b {
  font-size: 18px;
}

.order-confirmation-head > span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-confirmation-main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.8fr);
  align-items: center;
  min-height: 250px;
  padding: clamp(18px, 4vw, 34px);
  background: linear-gradient(135deg, #fff 0%, #fff 58%, #fff8ec 100%);
}

.order-confirmation-copy h3 {
  margin: 0 0 8px;
  color: #a88b61;
  font-size: clamp(44px, 8vw, 86px);
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.order-confirmation-copy p {
  margin: 0 0 24px;
  color: #a88b61;
  font-size: clamp(18px, 3vw, 30px);
  font-weight: 800;
}

.order-confirmation-copy small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.order-confirmation-main img {
  justify-self: center;
  width: min(100%, 245px);
  max-height: 210px;
  object-fit: contain;
}

.order-confirmation-total {
  display: grid;
  gap: 4px;
  padding: 18px clamp(18px, 4vw, 34px);
  background: #fffaf3;
  border-top: 1px solid #eadfcf;
}

.order-confirmation-total span,
.order-confirmation-total small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.order-confirmation-total strong {
  color: var(--red);
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.order-confirmation-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: #eadfcf;
}

.order-confirmation-meta div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  background: #fff;
}

.order-confirmation-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.order-confirmation-meta b {
  overflow: hidden;
  color: var(--red);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-confirmation-hint {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.complete-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.complete-grid div {
  padding: 14px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.result-report {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  background: #fff7f7;
  border: 1px solid #f0caca;
  border-radius: 8px;
}

.result-report div {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: #fff;
  border: 1px solid #f4d0d0;
  border-radius: 6px;
}

.result-report span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.result-report strong {
  color: var(--red);
  font-size: 20px;
}

.result-report p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.55;
}

.complete-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.complete-grid strong {
  color: var(--red);
  font-size: 19px;
}

.order-items {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.order-items ul {
  display: grid;
  gap: 0;
  max-height: 340px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.order-items li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #eeeeee;
  font-weight: 800;
}

.order-items small {
  color: var(--muted);
  font-weight: 700;
}

.complete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.complete-actions button {
  min-height: 44px;
  padding: 0 18px;
  color: #fff;
  background: var(--red);
  border-radius: 4px;
  font-weight: 900;
}

.complete-actions button:first-child {
  color: var(--red);
  background: #fff;
  border: 1px solid var(--red);
}

.complete-actions button:nth-child(n + 3) {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.share-status {
  min-height: 20px;
  margin-bottom: 0;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 860px) {
  .topbar,
  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
  }

  .search {
    display: none;
  }

  .wallet {
    grid-column: 2;
    grid-row: 2;
    width: auto;
    min-width: 0;
    text-align: right;
  }

  .header-character {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    max-width: none;
  }

  .brandline {
    grid-column: 1;
    grid-row: 1;
  }

  .kicker {
    display: none;
  }

  .brandmark {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  h1 {
    font-size: 20px;
  }

  .mobile-cart-button {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 38px;
    padding: 0 10px;
    color: #fff;
    background: var(--red);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 900;
  }

  .mobile-cart-button b {
    display: grid;
    min-width: 18px;
    height: 18px;
    place-items: center;
    padding: 0 4px;
    color: var(--red);
    background: #fff;
    border-radius: 999px;
    font-size: 11px;
  }

  .stats,
  .layout,
  .insight-panel,
  .account {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .new-arrival-grid {
    gap: 10px;
  }

  .shelf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .receipt {
    display: none;
    position: fixed;
    inset: calc(var(--topbar-height) + 8px) 10px 10px;
    z-index: 40;
    height: calc(100dvh - var(--topbar-height) - 18px);
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .receipt.mobile-cart-open {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .receipt ul {
    flex: 1 1 auto;
    min-height: 76px;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .cart-summary,
  .checkout {
    flex: 0 0 auto;
  }

  .mobile-cart-close {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 0 10px;
    color: var(--red);
    background: #fff;
    border: 1px solid var(--red);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
  }

  .bank-hero {
    flex-direction: column;
  }

  .bank-balance {
    min-width: 0;
    text-align: left;
  }

  .bank-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .complete-grid,
  .debt-card,
  .loan-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .order-confirmation-main {
    grid-template-columns: minmax(0, 1fr) 116px;
    min-height: 0;
    gap: 8px;
    padding: 16px;
    text-align: left;
  }

  .order-confirmation-main img {
    order: initial;
    max-height: 118px;
  }

  .order-confirmation-copy h3 {
    font-size: 42px;
  }

  .order-confirmation-copy p {
    margin-bottom: 8px;
    font-size: 16px;
  }

  .order-confirmation-copy small {
    display: none;
  }
}

@media (max-width: 520px) {
  main {
    width: min(100% - 18px, 1180px);
    padding-top: calc(var(--topbar-height) + 12px);
    padding-bottom: 56px;
  }

  .topbar {
    padding: 14px 12px;
  }

  .brandmark {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    font-size: 26px;
  }

  .hero h2 {
    font-size: 34px;
  }

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

  .campaign-head,
  .new-arrival-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .new-arrival-tools {
    width: 100%;
    justify-content: space-between;
  }

  .new-arrival-grid {
    gap: 10px;
  }

  .new-arrival-card {
    flex-basis: min(82vw, 300px);
  }

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

  .card {
    grid-template-rows: none;
    height: auto;
    min-height: 316px;
  }

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

  .statement {
    overflow-x: auto;
  }

  .complete-grid,
  .result-report,
  .conversion-grid,
  .suggestion-card,
  .order-items li,
  .debt-card,
  .loan-panel,
  .loan-presets {
    grid-template-columns: 1fr;
  }
}
