:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #241c0e;
  background: #fff7df;
  letter-spacing: 0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(#ffd75e 0 226px, #fff7df 226px 100%);
}

button, a { font: inherit; }

.shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: max(34px, env(safe-area-inset-top)) 18px calc(96px + env(safe-area-inset-bottom));
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 78px;
  margin-bottom: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #fffaf0;
  color: #9b5a00;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 8px 24px rgb(142 87 0 / 12%);
}

h1, h2, p { margin: 0; }
h1 { font-size: 20px; line-height: 1.3; letter-spacing: 0; }
.brand p { margin-top: 19px; color: #75531d; font-size: 14px; }

.panel {
  padding: 20px 18px;
  border: 1px solid #efc862;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 18px 50px rgb(129 82 0 / 10%);
}

.eyebrow {
  color: #a76800;
  font-size: 13px;
  font-weight: 800;
}

h2 { margin-top: 5px; font-size: 22px; }
.intro { margin-top: 12px; color: #6f6250; font-size: 15px; line-height: 1.7; }

.primary, .secondary {
  width: 100%;
  min-height: 48px;
  border-radius: 7px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.primary {
  margin-top: 20px;
  background: #ffbf1f;
  color: #211600;
  box-shadow: 0 8px 18px rgb(255 173 0 / 22%);
}

.primary:disabled { cursor: wait; opacity: .62; }
.secondary { border: 1px solid #e2c272; background: #fffaf0; color: #6f4c00; }
.hidden { display: none !important; }

.progress {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #eee2c6;
}

.progress-head { display: flex; align-items: center; gap: 10px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #ffb000; box-shadow: 0 0 0 5px #fff0bd; }
.status-dot.busy { animation: pulse 1.1s ease-in-out infinite; }
.status-dot.ok { background: #12a66a; box-shadow: 0 0 0 5px #d8f6e9; }
.status-dot.error { background: #d83b2d; box-shadow: 0 0 0 5px #ffe0dd; }

.auth-actions { display: grid; grid-template-columns: 1.35fr 1fr; gap: 9px; margin-top: 15px; }
.link-button { display: grid; place-items: center; margin-top: 0; text-decoration: none; text-align: center; }
.return-tip { margin-top: 11px; color: #766a58; font-size: 13px; line-height: 1.5; }

.result { margin-top: 18px; padding-top: 18px; border-top: 1px solid #eee2c6; }
.result-title { font-size: 18px; font-weight: 900; }
.result-summary { margin-top: 7px; color: #a95e00; font-weight: 700; }
.coupon-list { display: grid; gap: 9px; margin-top: 14px; }
.coupon {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 13px;
  border: 1px solid #efd593;
  border-radius: 7px;
  background: #fffaf0;
}
.coupon-name { font-weight: 800; }
.coupon-period { margin-top: 5px; color: #7e725f; font-size: 12px; }
.coupon-value { align-self: center; color: #dc3827; font-size: 16px; font-weight: 900; }

.activity-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.activity-button {
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid #e2b83e;
  border-radius: 7px;
  background: #fffaf0;
  color: #3d2b00;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 7px 16px rgb(129 82 0 / 8%);
}

.activity-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
  text-align: left;
}

.activity-copy strong {
  font-size: 14px;
  line-height: 1.2;
}

.activity-copy small {
  color: #8a6a21;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.activity-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #ffca2d;
  color: #2f2304;
  font-size: 12px;
  font-weight: 900;
}

.copy-toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(82px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  min-width: 118px;
  padding: 10px 16px;
  border-radius: 7px;
  background: rgb(36 28 14 / 92%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 8px 24px rgb(36 28 14 / 22%);
}

.privacy { padding: 15px 8px 0; color: #806e4f; font-size: 12px; line-height: 1.6; text-align: center; }

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  height: calc(68px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 7px max(16px, calc((100vw - 520px) / 2)) env(safe-area-inset-bottom);
  border-top: 1px solid #e7d59c;
  background: rgb(255 253 247 / 97%);
  box-shadow: 0 -8px 24px rgb(92 62 0 / 10%);
}

.bottom-nav-item {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #876611;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.bottom-nav-item.is-active { color: #2f2304; }

.bottom-nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #dfc369;
  border-radius: 7px;
  background: #fff6cf;
  font-size: 11px;
  font-weight: 900;
}

.bottom-nav-item.is-active .bottom-nav-icon {
  border-color: #f4b20e;
  background: #ffca2d;
}

@keyframes pulse { 50% { transform: scale(.72); opacity: .55; } }

@media (max-width: 370px) {
  .auth-actions { grid-template-columns: 1fr; }
  .activity-actions { grid-template-columns: 1fr; }
  h1 { font-size: 21px; }
}
