:root {
  color-scheme: light dark;
  --page: #f5f5f3;
  --page-top: #fffbeb;
  --surface: #fffefb;
  --surface-muted: #f7f6f2;
  --surface-accent: #fff9dc;
  --ink: #28251f;
  --muted: #676259;
  --subtle: #918b81;
  --line: rgba(54, 48, 35, 0.11);
  --line-strong: rgba(54, 48, 35, 0.18);
  --brand: #ffd100;
  --brand-strong: #6b4b00;
  --brand-soft: #fff4b8;
  --brand-faint: #fffbed;
  --button-text: #2b2515;
  --coupon: #f04444;
  --coupon-strong: #bd2d34;
  --coupon-soft: #fff0f0;
  --ip-blue: #4f7fdd;
  --ip-blue-soft: #edf3ff;
  --success: #18764d;
  --success-soft: #ecf7f1;
  --danger: #b82032;
  --danger-soft: #fff0f2;
  --map-blue: #3379ec;
  --shadow-card: 0 12px 30px rgba(73, 60, 25, 0.07);
  --shadow-float: 0 18px 54px rgba(58, 48, 20, 0.18);
  --radius-card: 8px;
  --radius-control: 8px;
  --pill: 999px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, var(--page-top) 0, var(--page) 360px),
    var(--page);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

button[data-loading="true"] {
  cursor: wait;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(255, 209, 0, 0.32);
}

.app-shell {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 14px 18px calc(38px + env(safe-area-inset-bottom));
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 20px;
  padding: 3px 2px 10px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--brand);
  color: var(--button-text);
  font-size: 19px;
  font-weight: 950;
  box-shadow: 0 8px 20px rgba(121, 94, 0, 0.18);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-mark.uses-mascot img {
  position: absolute;
  left: -228%;
  top: -66%;
  width: 400%;
  max-width: none;
  height: auto;
  mix-blend-mode: multiply;
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.brand-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 21px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-highlight {
  min-height: 17px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  transition: opacity 240ms ease, transform 240ms ease;
}

.brand-highlight.is-leaving {
  opacity: 0;
  transform: translateY(3px);
}

.header-trust {
  flex: 0 0 auto;
  border: 1px solid rgba(116, 83, 0, 0.12);
  border-radius: var(--pill);
  padding: 8px 11px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 750;
}

.app-view {
  animation: viewEnter 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.surface-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 20px;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  box-shadow: var(--shadow-card);
}

.merchant-module {
  padding: 0 0 20px;
  overflow: hidden;
}

.merchant-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 228px;
  min-height: 230px;
  background: var(--brand);
}

.merchant-intro-copy {
  align-self: center;
  padding: 25px 8px 25px 24px;
}

.merchant-intro-copy h1 {
  max-width: 12em;
  color: #28251f;
  font-size: 30px;
  font-weight: 920;
  line-height: 1.18;
}

.merchant-intro .merchant-intro-copy p {
  max-width: 32em;
  margin-top: 9px;
  color: rgba(40, 37, 31, 0.7);
  font-weight: 620;
}

.merchant-topline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 13px;
}

.merchant-intro .feature-label {
  margin: 0;
  border: 1px solid rgba(40, 37, 31, 0.1);
  background: rgba(255, 255, 255, 0.5);
  color: #28251f;
}

.merchant-intro .help-link {
  min-height: 32px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.88);
  color: #28251f;
  font-size: 11px;
}

.mascot-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
}

.mascot-stage::before {
  content: "";
  position: absolute;
  right: 15px;
  bottom: 15px;
  width: 174px;
  height: 174px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.mascot-speech {
  position: absolute;
  z-index: 2;
  top: 20px;
  right: 14px;
  border: 1px solid rgba(40, 37, 31, 0.1);
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.92);
  color: #315ba8;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(85, 67, 9, 0.1);
}

.mascot-speech::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -6px;
  width: 11px;
  height: 11px;
  border-right: 1px solid rgba(40, 37, 31, 0.1);
  border-bottom: 1px solid rgba(40, 37, 31, 0.1);
  background: rgba(255, 255, 255, 0.92);
  transform: rotate(45deg);
}

.mascot-crop {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.mascot-crop img {
  position: absolute;
  left: -164%;
  top: -34%;
  width: 282%;
  max-width: none;
  height: auto;
  mix-blend-mode: multiply;
  transform-origin: 58% 55%;
  animation: mascotHello 3.4s ease-in-out infinite;
}

.mascot-stage.has-no-image::after {
  content: "饭卷卷";
  position: absolute;
  right: 34px;
  bottom: 54px;
  color: var(--brand-strong);
  font-size: 24px;
  font-weight: 950;
}

.merchant-module > .claim-route,
.merchant-module > .field-block,
.merchant-module > .primary-button,
.merchant-module > .result-area {
  margin-right: 20px;
  margin-left: 20px;
}

.merchant-module > .claim-route {
  margin-top: 18px;
}

.module-head,
.nearby-head,
.flow-header,
.flow-action-copy,
.location-summary,
.field-heading,
.field-tools,
.token-primary-actions,
.filter-row,
.shop-meta,
.claim-footer,
.modal-head,
.map-caption {
  display: flex;
}

.module-head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 17px;
}

.module-head.stacked {
  display: block;
}

.module-title-copy {
  min-width: 0;
}

.module-title-copy h1,
.module-title-copy h2,
.flow-header h1,
.flow-action-copy h2,
.result-head h3,
.shop-card h3,
.modal-panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.module-title-copy h1,
.flow-header h1 {
  font-size: 27px;
  font-weight: 900;
  line-height: 1.2;
}

.module-title-copy h2,
.flow-action-copy h2 {
  font-size: 21px;
  font-weight: 860;
  line-height: 1.3;
}

.module-title-copy p,
.flow-action-copy p {
  max-width: 45em;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.feature-label {
  display: inline-flex;
  margin-bottom: 9px;
  border-radius: var(--pill);
  padding: 5px 9px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 900;
}

.help-link,
.text-button,
.paste-button,
.tutorial-button,
.back-button,
.retry-location,
.icon-button {
  border: 0;
  background: transparent;
  color: var(--ink);
}

.help-link,
.tutorial-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 40px;
  gap: 7px;
  border-radius: var(--radius-control);
  padding: 0 12px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.help-link > span,
.tutorial-button > span {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
}

.claim-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.2fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  border: 1px solid rgba(138, 103, 0, 0.12);
  border-radius: var(--radius-control);
  padding: 11px 13px;
  background: var(--brand-faint);
}

.claim-route > span {
  display: grid;
  gap: 2px;
  text-align: center;
}

.claim-route b {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.claim-route small {
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 750;
}

.claim-route i,
.handoff-route i {
  color: var(--subtle);
  font-size: 19px;
  font-style: normal;
}

.field-block {
  display: grid;
  gap: 8px;
}

.field-heading {
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  gap: 12px;
}

.field-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.field-tools {
  align-items: center;
  gap: 5px;
}

.text-button,
.paste-button {
  min-height: 30px;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.text-button {
  color: var(--muted);
}

.paste-button {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  outline: none;
  background: var(--surface-muted);
  color: var(--ink);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

textarea {
  min-height: 104px;
  resize: vertical;
  padding: 13px 14px;
  line-height: 1.6;
}

input {
  min-height: 48px;
  padding: 0 14px;
}

textarea::placeholder,
input::placeholder {
  color: var(--subtle);
  opacity: 1;
}

textarea:hover,
input:hover {
  border-color: var(--line-strong);
}

textarea:focus,
input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(255, 209, 0, 0.24);
}

.field-block.has-value textarea,
.field-block.has-value input {
  border-color: rgba(24, 118, 77, 0.3);
  background: color-mix(in srgb, var(--success-soft) 45%, var(--surface));
}

.field-hint {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.field-hint.is-success {
  color: var(--success);
}

.field-hint.is-error {
  color: var(--danger);
}

.primary-button,
.login-button,
.claim-link,
.disabled-link,
.promo-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.primary-button {
  min-height: 50px;
  border: 0;
  padding: 0 20px;
  background: var(--brand);
  color: var(--button-text);
  box-shadow: 0 9px 20px rgba(121, 94, 0, 0.18);
}

.primary-button-wide {
  width: 100%;
}

.merchant-module > .primary-button {
  margin-top: 14px;
}

.primary-button:disabled {
  background: color-mix(in srgb, var(--ink) 14%, var(--surface));
  color: var(--subtle);
  box-shadow: none;
}

.primary-button[data-loading="true"] {
  background: var(--brand);
  color: var(--button-text);
  opacity: 0.76;
}

.primary-button:not(:disabled):hover,
.login-button:hover,
.claim-link:hover {
  filter: brightness(0.97);
  box-shadow: 0 11px 24px rgba(121, 94, 0, 0.22);
}

.primary-button:not(:disabled):active,
.login-button:active,
.claim-link:active,
.promo-entry:active,
.map-card:active,
.back-button:active,
.help-link:active,
.tutorial-button:active,
.paste-button:active,
.bottom-nav button:active {
  transform: scale(0.985);
}

.subsidy-promo {
  padding: 0;
  overflow: hidden;
  border-color: rgba(93, 73, 8, 0.13);
  background: var(--surface);
}

.promo-entry {
  display: grid;
  width: 100%;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  border: 0;
  padding: 19px 20px;
  background: var(--brand-faint);
  color: var(--ink);
  text-align: left;
}

.promo-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(91, 70, 0, 0.09);
  border-radius: 50%;
  background: var(--brand);
  font-size: 30px;
  box-shadow: 0 8px 18px rgba(121, 94, 0, 0.15);
}

.promo-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.promo-copy > small {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 750;
}

.promo-copy > strong {
  font-size: 21px;
  font-weight: 850;
  line-height: 1.25;
}

.promo-copy > strong b {
  color: var(--coupon);
  font-size: 27px;
  font-weight: 950;
}

.promo-copy > span {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 11px;
  color: var(--muted);
  font-size: 12px;
}

.promo-copy em,
.promo-copy i {
  font-style: normal;
}

.promo-action {
  min-height: 42px;
  gap: 6px;
  padding: 0 14px;
  background: var(--ink);
  color: var(--brand);
  font-size: 13px;
}

.promo-action i {
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
}

.nearby-head {
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.nearby-head h2 span {
  color: var(--coupon);
}

.brand-orbit {
  display: flex;
  flex: 0 0 auto;
  padding-left: 14px;
}

.brand-orbit img {
  width: 34px;
  height: 34px;
  margin-left: -9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  padding: 7px;
  object-fit: contain;
  box-shadow: 0 6px 15px rgba(61, 43, 47, 0.13);
}

.brand-orbit img:nth-child(1) {
  background: #c8102e;
}

.brand-orbit img:nth-child(2) {
  background: #ffbc0d;
}

.brand-orbit img:nth-child(3) {
  background: #00754a;
}

.map-card {
  display: grid;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  overflow: hidden;
  padding: 0;
  background: #e9f0f2;
  color: #272324;
  text-align: left;
}

.map-card:focus-visible,
.promo-entry:focus-visible,
.bottom-nav button:focus-visible {
  outline: 3px solid rgba(255, 209, 0, 0.3);
  outline-offset: 3px;
}

.map-schematic {
  position: relative;
  display: block;
  min-height: 248px;
  overflow: hidden;
  background:
    linear-gradient(113deg, transparent 0 42%, rgba(119, 187, 141, 0.42) 42% 53%, transparent 53%),
    linear-gradient(15deg, transparent 0 58%, rgba(89, 179, 218, 0.31) 58% 63%, transparent 63%),
    #e8eff2;
}

.map-schematic::before,
.map-schematic::after,
.map-road {
  content: "";
  position: absolute;
  border-radius: var(--pill);
  background: #fffefd;
  box-shadow: 0 0 0 1px rgba(146, 163, 171, 0.19);
}

.map-schematic::before {
  left: -8%;
  top: 18%;
  width: 118%;
  height: 20px;
  transform: rotate(-14deg);
}

.map-schematic::after {
  left: 50%;
  top: -12%;
  width: 18px;
  height: 116%;
  transform: rotate(30deg);
}

.road-main {
  left: -8%;
  bottom: 27%;
  width: 120%;
  height: 18px;
  transform: rotate(13deg);
}

.road-cross {
  right: 18%;
  top: -10%;
  width: 15px;
  height: 112%;
  transform: rotate(-8deg);
}

.road-soft {
  height: 9px;
  background: rgba(255, 255, 255, 0.8);
}

.road-a {
  left: 10%;
  top: 48%;
  width: 45%;
  transform: rotate(-34deg);
}

.road-b {
  right: 2%;
  top: 45%;
  width: 42%;
  transform: rotate(24deg);
}

.road-c {
  left: 3%;
  bottom: 15%;
  width: 52%;
  transform: rotate(-6deg);
}

.map-block {
  position: absolute;
  border: 1px solid rgba(132, 151, 160, 0.13);
  border-radius: 5px;
  background: rgba(208, 220, 224, 0.68);
}

.block-a {
  left: 4%;
  top: 5%;
  width: 22%;
  height: 20%;
  transform: rotate(-8deg);
}

.block-b {
  right: 4%;
  top: 11%;
  width: 21%;
  height: 24%;
  transform: rotate(5deg);
}

.block-c {
  right: 25%;
  bottom: 8%;
  width: 19%;
  height: 18%;
  transform: rotate(-6deg);
}

.map-label {
  position: absolute;
  z-index: 1;
  border-radius: 5px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.88);
  color: #647278;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(71, 91, 99, 0.07);
}

.map-label-primary {
  left: 43%;
  top: 47%;
}

.map-label-secondary {
  right: 9%;
  top: 17%;
}

.user-pin {
  position: absolute;
  z-index: 3;
  left: 52%;
  top: 44%;
  width: 22px;
  height: 22px;
  border: 4px solid #fffafa;
  border-radius: 50%;
  background: var(--map-blue);
  box-shadow: 0 4px 14px rgba(51, 121, 236, 0.42);
}

.user-pin::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(51, 121, 236, 0.23);
  border-radius: 50%;
  animation: locationPulse 1.8s ease-out infinite;
}

.packet-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.packet-marker {
  position: absolute;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid #fffafa;
  border-radius: 50%;
  background: var(--coupon);
  font-size: 18px;
  box-shadow: 0 6px 14px rgba(190, 45, 52, 0.24);
  animation: packetFloat 2.8s ease-in-out infinite;
}

.map-caption {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px 16px;
  background: #fffefd;
}

.map-caption > span {
  display: grid;
  gap: 4px;
}

.map-caption strong {
  font-size: 16px;
  font-weight: 850;
}

.map-caption small {
  color: #687479;
  font-size: 12px;
}

.map-caption > i {
  color: var(--brand-strong);
  font-size: 27px;
  font-style: normal;
}

.flow-header {
  align-items: center;
  gap: 13px;
  min-height: 73px;
  padding: 3px 0 7px;
}

.flow-header > div {
  display: grid;
  gap: 3px;
}

.flow-header span {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 850;
}

.back-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 21px;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(70, 47, 51, 0.07);
}

.token-guide {
  margin-top: 7px;
}

.token-head {
  align-items: center;
}

.privacy-badge {
  flex: 0 0 auto;
  border-radius: var(--pill);
  padding: 7px 10px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.token-primary-actions {
  align-items: stretch;
  gap: 9px;
}

.login-button {
  flex: 1;
  min-height: 50px;
  background: var(--ink);
  color: var(--surface);
}

.tutorial-button {
  min-width: 142px;
}

.handoff-route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 13px;
  border-radius: var(--radius-control);
  padding: 10px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.token-field {
  margin-top: 16px;
}

.flow-action-card {
  display: grid;
  gap: 17px;
}

.flow-action-copy {
  align-items: center;
  gap: 13px;
}

.flow-action-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--brand-soft);
  font-size: 28px;
}

.location-summary {
  align-items: center;
  gap: 12px;
  margin-top: 7px;
  border: 1px solid rgba(24, 118, 77, 0.21);
  border-radius: var(--radius-card);
  padding: 13px 14px;
  background: color-mix(in srgb, var(--success-soft) 86%, var(--surface));
}

.location-summary > div {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 3px;
}

.location-summary strong {
  font-size: 14px;
}

.location-summary small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.location-summary.has-error {
  border-color: rgba(184, 32, 50, 0.22);
  background: var(--danger-soft);
}

.location-pulse {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(24, 118, 77, 0.1);
}

.location-summary.has-error .location-pulse {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(184, 32, 50, 0.1);
}

.retry-location {
  flex: 0 0 auto;
  min-height: 36px;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 850;
}

.finder-module {
  display: grid;
  gap: 16px;
}

.finder-module .module-head {
  margin-bottom: 0;
}

.filter-row {
  align-items: end;
  gap: 14px;
}

.compact-field {
  flex: 1;
}

.switch-field {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 48px;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.switch-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-control {
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: var(--pill);
  background: #d3ced0;
  transition: background 150ms ease;
}

.switch-control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 5px rgba(52, 38, 41, 0.2);
  transition: transform 150ms ease;
}

.switch-field input:checked + .switch-control {
  background: var(--brand);
}

.switch-field input:checked + .switch-control::after {
  transform: translateX(16px);
}

.switch-field input:focus-visible + .switch-control {
  outline: 3px solid rgba(255, 209, 0, 0.28);
  outline-offset: 2px;
}

.result-area:empty {
  display: none;
}

.result-area:not(:empty) {
  margin-top: 18px;
}

.result-card {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.result-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px 12px;
  margin-bottom: 13px;
}

.result-kicker {
  grid-column: 1 / -1;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 850;
}

.result-head h3 {
  font-size: 21px;
  font-weight: 880;
  line-height: 1.3;
}

.coupon-chip {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  border-radius: var(--pill);
  padding: 0 10px;
  background: var(--coupon-soft);
  color: var(--coupon-strong);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.coupon-mantra {
  margin-bottom: 10px;
  border-radius: var(--radius-control);
  padding: 11px 12px;
  background: var(--brand);
  color: var(--button-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.claim-stack {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.claim-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 80px;
  padding: 12px 13px;
}

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

.claim-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-control);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 20px;
  font-weight: 950;
}

.claim-order {
  position: absolute;
  left: -5px;
  top: -5px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  font-size: 9px;
  font-weight: 900;
}

.claim-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.claim-copy strong {
  font-size: 16px;
  font-weight: 880;
  line-height: 1.3;
}

.claim-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.claim-card.is-coupon .claim-copy small {
  color: var(--coupon-strong);
  font-size: 14px;
  font-weight: 900;
}

.claim-card.is-coupon .claim-icon {
  background: var(--coupon-soft);
  color: var(--coupon-strong);
}

.claim-link,
.disabled-link {
  min-height: 39px;
  padding: 0 13px;
  font-size: 12px;
}

.claim-link {
  background: var(--brand);
  color: var(--button-text);
}

.disabled-link {
  background: var(--surface-muted);
  color: var(--subtle);
}

.status-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.status-box.success {
  border-color: rgba(24, 118, 77, 0.22);
  background: var(--success-soft);
  color: #176641;
}

.status-box.error {
  border-color: rgba(184, 32, 50, 0.2);
  background: var(--danger-soft);
  color: var(--danger);
}

.loading-state {
  display: grid;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px;
  background: var(--surface);
}

.loading-assistant {
  display: flex;
  align-items: center;
  gap: 10px;
}

.loading-assistant > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.loading-assistant strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 880;
}

.loading-assistant small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.mascot-avatar {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid rgba(91, 70, 0, 0.1);
  border-radius: 50%;
  background: var(--brand);
}

.mascot-avatar img {
  position: absolute;
  left: -235%;
  top: -68%;
  width: 420%;
  max-width: none;
  height: auto;
  mix-blend-mode: multiply;
}

.skeleton-row {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-muted);
}

.skeleton-row:nth-child(3) {
  width: 78%;
}

.skeleton-row:nth-child(4) {
  width: 58%;
}

.skeleton-row::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 209, 0, 0.22), transparent);
  animation: shimmer 1.15s linear infinite;
}

.shop-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.shop-card {
  display: grid;
  align-content: start;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 15px;
  background: var(--surface);
}

.shop-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.shop-card h3 {
  font-size: 16px;
  font-weight: 850;
  line-height: 1.42;
}

.shop-coupon {
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--coupon-soft);
  color: var(--coupon-strong);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.shop-meta {
  flex-wrap: wrap;
  gap: 6px;
}

.shop-meta span {
  border-radius: 5px;
  padding: 4px 6px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
}

.claim-footer {
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.claim-footer .claim-link,
.claim-footer .disabled-link {
  flex: 1;
}

.empty-shop-state {
  display: grid;
  gap: 5px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
  padding: 22px 16px;
  background: var(--surface-muted);
  text-align: center;
}

.empty-shop-state strong {
  font-size: 15px;
  font-weight: 850;
}

.empty-shop-state small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.load-more-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 13px 14px;
  background: var(--surface-muted);
}

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

.load-more-copy strong {
  font-size: 13px;
  font-weight: 850;
}

.load-more-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.load-more-button {
  flex: 0 0 auto;
  min-height: 39px;
  border: 0;
  border-radius: var(--radius-control);
  padding: 0 14px;
  background: var(--brand);
  color: var(--button-text);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.load-more-button:disabled {
  background: color-mix(in srgb, var(--ink) 14%, var(--surface));
  color: var(--subtle);
}

.load-more-button:not(:disabled):active {
  transform: scale(0.985);
}

.load-more-panel.has-error {
  border-color: rgba(184, 32, 50, 0.2);
  background: var(--danger-soft);
}

.load-more-panel.has-error .load-more-copy strong,
.load-more-panel.has-error .load-more-copy small {
  color: var(--danger);
}

.load-more-panel.is-stale {
  border-color: rgba(138, 103, 0, 0.16);
  background: var(--brand-soft);
}

.load-more-panel.is-complete {
  justify-content: center;
  text-align: center;
}

.bottom-note {
  padding: 22px 8px 3px;
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.bottom-nav {
  display: none;
}

.modal-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31, 23, 25, 0.54);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.location-backdrop {
  z-index: 40;
}

.modal-panel {
  width: min(100%, 560px);
  max-height: min(88dvh, 780px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.modal-head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 850;
}

.modal-panel h2 {
  font-size: 23px;
  font-weight: 900;
  line-height: 1.34;
}

.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 24px;
}

.tutorial-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}

.tutorial-empty {
  border: 1px dashed rgba(138, 103, 0, 0.28);
  border-radius: var(--radius-card);
  padding: 42px 18px;
  background: var(--brand-soft);
  color: var(--muted);
  text-align: center;
}

.location-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 480px;
  padding: 28px 24px 24px;
  text-align: center;
}

.location-panel .modal-kicker {
  margin: 0;
}

.location-panel h2 {
  max-width: 17em;
}

.location-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.location-hero-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid var(--brand-soft);
  background: var(--brand);
}

.location-hero-icon i {
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(138, 103, 0, 0.2);
  border-radius: 50%;
  animation: consentPulse 2s ease-out infinite;
}

.location-privacy {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.location-privacy span {
  border-radius: var(--radius-control);
  padding: 10px 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.system-permission-tip {
  color: var(--muted);
  font-size: 12px;
}

.permission-result {
  min-height: 20px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}

@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes packetFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes locationPulse {
  from {
    opacity: 0.75;
    transform: scale(0.5);
  }
  to {
    opacity: 0;
    transform: scale(1.45);
  }
}

@keyframes consentPulse {
  from {
    opacity: 0.6;
    transform: scale(0.84);
  }
  to {
    opacity: 0;
    transform: scale(1.12);
  }
}

@keyframes mascotHello {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  48% {
    transform: translateY(-4px) rotate(-0.8deg);
  }
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 11px 12px calc(102px + env(safe-area-inset-bottom));
  }

  .app-header {
    min-height: 62px;
    padding-bottom: 7px;
  }

  .header-trust {
    display: none;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .brand-highlight {
    font-size: 12px;
  }

  .surface-card {
    margin-top: 12px;
    padding: 16px;
  }

  .merchant-module {
    padding: 0 0 16px;
  }

  .merchant-intro {
    grid-template-columns: minmax(0, 1fr) 150px;
    min-height: 220px;
  }

  .merchant-intro-copy {
    padding: 20px 0 20px 18px;
  }

  .merchant-intro-copy h1 {
    font-size: 26px;
  }

  .mascot-stage::before {
    right: 7px;
    bottom: 16px;
    width: 136px;
    height: 136px;
  }

  .mascot-speech {
    top: 17px;
    right: 8px;
  }

  .mascot-crop img {
    left: -244%;
    top: -34%;
    width: 390%;
  }

  .merchant-module > .claim-route,
  .merchant-module > .field-block,
  .merchant-module > .primary-button,
  .merchant-module > .result-area {
    margin-right: 16px;
    margin-left: 16px;
  }

  .module-title-copy h1,
  .flow-header h1 {
    font-size: 23px;
  }

  .module-title-copy h2,
  .flow-action-copy h2 {
    font-size: 19px;
  }

  .module-title-copy p,
  .flow-action-copy p {
    font-size: 13px;
  }

  .promo-entry {
    padding: 17px 16px;
  }

  .promo-copy > strong {
    font-size: 19px;
  }

  .promo-copy > strong b {
    font-size: 24px;
  }

  .map-schematic {
    min-height: 220px;
  }

  .flow-header {
    min-height: 67px;
  }

  .filter-row {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .switch-field {
    min-height: 42px;
  }

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

  .bottom-nav {
    position: fixed;
    z-index: 20;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(calc(100% - 24px), 520px);
    min-height: 66px;
    margin: auto;
    border: 1px solid rgba(55, 39, 43, 0.12);
    border-radius: 14px;
    padding: 5px;
    background: color-mix(in srgb, var(--surface) 93%, transparent);
    box-shadow: 0 14px 38px rgba(59, 38, 43, 0.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .bottom-nav button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 0;
    border-radius: 10px;
    padding: 6px 4px;
    background: transparent;
    color: var(--muted);
  }

  .bottom-nav button > span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 23px;
    color: currentColor;
    font-size: 17px;
    font-weight: 950;
    line-height: 1;
  }

  .bottom-nav button > strong {
    font-size: 11px;
    font-weight: 800;
  }

  .bottom-nav button.is-active {
    background: var(--brand-soft);
    color: var(--brand-strong);
  }
}

@media (max-width: 520px) {
  .token-head {
    display: grid;
    gap: 11px;
  }

  .merchant-intro {
    grid-template-columns: minmax(0, 1fr) 122px;
    min-height: 226px;
  }

  .merchant-intro-copy {
    padding: 17px 0 17px 16px;
  }

  .merchant-intro-copy h1 {
    font-size: 24px;
  }

  .merchant-intro .merchant-intro-copy p {
    margin-top: 7px;
    font-size: 12px;
    line-height: 1.5;
  }

  .merchant-topline {
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 10px;
  }

  .merchant-intro .feature-label,
  .merchant-intro .help-link {
    min-height: 29px;
    font-size: 10px;
  }

  .mascot-stage::before {
    right: -6px;
    bottom: 25px;
    width: 118px;
    height: 118px;
  }

  .mascot-speech {
    top: 18px;
    right: 6px;
    padding: 6px 7px;
    font-size: 9px;
  }

  .mascot-crop img {
    left: -280%;
    top: -34%;
    width: 430%;
  }

  .feature-label {
    margin-bottom: 7px;
  }

  .claim-route {
    gap: 3px;
    padding: 9px 7px;
  }

  .claim-route b {
    font-size: 12px;
  }

  .claim-route small {
    font-size: 9px;
  }

  .promo-entry {
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 11px;
  }

  .promo-icon {
    width: 50px;
    height: 50px;
    font-size: 26px;
  }

  .promo-action {
    min-height: 38px;
    padding: 0 10px;
  }

  .nearby-head {
    align-items: flex-start;
  }

  .brand-orbit {
    padding-top: 3px;
  }

  .brand-orbit img {
    width: 29px;
    height: 29px;
    padding: 6px;
  }

  .privacy-badge {
    justify-self: start;
  }

  .token-primary-actions {
    display: grid;
  }

  .tutorial-button {
    width: 100%;
  }

  .claim-card {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 11px;
  }

  .claim-icon {
    width: 44px;
    height: 44px;
  }

  .claim-link,
  .disabled-link {
    min-height: 37px;
    padding: 0 10px;
  }

  .load-more-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .load-more-button {
    width: 100%;
  }

  .modal-panel {
    padding: 17px;
  }

  .location-panel {
    padding: 24px 18px 20px;
  }
}

@media (max-width: 390px) {
  .app-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .surface-card {
    padding: 14px;
  }

  .merchant-module {
    padding: 0 0 14px;
  }

  .merchant-intro {
    grid-template-columns: minmax(0, 1fr) 108px;
  }

  .merchant-intro-copy {
    padding-left: 14px;
  }

  .merchant-module > .claim-route,
  .merchant-module > .field-block,
  .merchant-module > .primary-button,
  .merchant-module > .result-area {
    margin-right: 14px;
    margin-left: 14px;
  }

  .mascot-crop img {
    left: -305%;
    width: 470%;
  }

  .field-tools {
    gap: 2px;
  }

  .text-button,
  .paste-button {
    padding: 0 7px;
  }

  .promo-entry {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .promo-icon {
    width: 46px;
    height: 46px;
  }

  .promo-action {
    grid-column: 1 / -1;
    width: 100%;
  }

  .brand-orbit img {
    width: 27px;
    height: 27px;
  }

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

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

  .claim-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .claim-card .claim-link,
  .claim-card .disabled-link {
    grid-column: 1 / -1;
    width: 100%;
  }

  .location-summary {
    align-items: flex-start;
  }

  .retry-location {
    padding: 0 6px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #171612;
    --page-top: #211f15;
    --surface: #22211d;
    --surface-muted: #2b2923;
    --surface-accent: #302c18;
    --ink: #f4f1e8;
    --muted: #c2bcae;
    --subtle: #958f82;
    --line: rgba(255, 248, 225, 0.1);
    --line-strong: rgba(255, 248, 225, 0.17);
    --brand: #ffd100;
    --brand-strong: #ffe275;
    --brand-soft: #3a3417;
    --brand-faint: #2c291c;
    --button-text: #2b2515;
    --coupon: #ff6264;
    --coupon-strong: #ff999b;
    --coupon-soft: #392124;
    --success: #63ba8f;
    --success-soft: #1a2c23;
    --danger: #ff9da6;
    --danger-soft: #351e22;
    --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.22);
    --shadow-float: 0 18px 54px rgba(0, 0, 0, 0.42);
  }

  .login-button {
    background: #f4eeee;
    color: #211d1f;
  }

  .promo-action {
    background: #242119;
    color: #ffd100;
  }

  .map-card,
  .map-schematic,
  .map-caption {
    color-scheme: light;
  }

  .brand-orbit img {
    border-color: #fffafa;
  }

  .status-box.success {
    color: #9fd5b9;
  }

  .status-box.error {
    color: #ff9da6;
  }

  .claim-order {
    background: #f4eeee;
    color: #211d1f;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .bottom-nav,
  .modal-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .bottom-nav {
    background: var(--surface);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
