:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-soft: #f7faff;
  --text: #172033;
  --muted: #718198;
  --line: #dfe8f3;
  --green: #18a957;
  --green-soft: #e8f8ef;
  --blue: #3d83e8;
  --purple: #9b5cf6;
  --shadow: 0 10px 26px rgba(37, 54, 76, 0.1);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.app-booting,
body.access-blocked {
  overflow: hidden;
  background: #000000;
}

button,
input,
select,
textarea {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  outline: none;
}

button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus,
button:focus-visible,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
[tabindex]:focus,
[tabindex]:focus-visible {
  outline: none;
}

button::-moz-focus-inner {
  border: 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
  outline: 0;
}

textarea {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  line-height: 1.35;
  outline: 0;
  resize: none;
}

[data-icon] {
  display: inline-grid;
  place-items: center;
}

[data-icon] svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 12px calc(86px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 173, 95, 0.12), transparent 30%),
    linear-gradient(180deg, #f7fbff 0%, #f4f8fc 42%, #eff6f2 100%);
  overflow-x: hidden;
}

body.app-booting .app-shell,
body.access-blocked .app-shell {
  max-width: none;
  padding: 0;
  background: #000000;
}

body.app-booting .screen,
body.app-booting .tabbar,
body.app-booting .toast,
body.app-booting #checkin-modal,
body.app-booting #address-save-modal,
body.access-blocked .screen,
body.access-blocked .tabbar,
body.access-blocked .toast,
body.access-blocked #checkin-modal,
body.access-blocked #address-save-modal {
  display: none !important;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

#swap-screen {
  padding: 0;
}

.page-header,
.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  margin-bottom: 18px;
}

.user-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 10px 10px 12px;
  border: 1px solid rgba(210, 225, 240, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 24px rgba(29, 44, 67, 0.07);
  backdrop-filter: blur(12px);
}

.profile-hero {
  margin-bottom: 14px;
}

.user-profile {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 12px;
}

.user-profile > div:last-child {
  min-width: 0;
  flex: 1 1 auto;
}

.hero-avatar {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  place-items: center;
  padding: 3px;
  border: 1px solid #9be47c;
  border-radius: 50%;
  background: #f0fdf4;
  box-shadow: 0 6px 14px rgba(23, 32, 51, 0.08);
  overflow: hidden;
}

.hero-avatar img,
.hero-avatar span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: 50%;
}

.hero-avatar img {
  background: #ffffff;
  object-fit: cover;
}

.hero-avatar span {
  background: linear-gradient(145deg, #d9fbe5, #e7f3ff);
  font-size: 26px;
}

.user-profile strong {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  color: #172033;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.user-profile strong > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile small {
  display: block;
  min-width: 0;
  margin-top: 3px;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-actions {
  display: grid;
  justify-items: end;
  gap: 4px;
  flex: 0 0 124px;
  width: 124px;
  min-width: 112px;
}

.checkin-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(120deg, #ffc21d 0%, #ffb84c 32%, #ff726e 68%, #ef4444 100%);
  background-size: 180% 180%;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(255, 132, 90, 0.28);
  animation:
    checkinGradient 3.2s ease-in-out infinite,
    checkinGlow 2.4s ease-in-out infinite;
}

.checkin-button::after {
  position: absolute;
  inset: -35% auto -35% -45%;
  width: 42%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  content: "";
  animation: checkinShine 2.8s ease-in-out infinite;
}

.checkin-button span {
  position: relative;
  z-index: 1;
}

.checkin-button [data-icon] svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  stroke-width: 0;
  animation: boltPulse 1.8s ease-in-out infinite;
}

.checkin-button.is-done {
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: #a2acba;
  box-shadow: 0 10px 22px rgba(37, 54, 76, 0.08);
  animation: none;
  cursor: default;
}

.checkin-button.is-done::after,
.checkin-button.is-done [data-icon] svg {
  animation: none;
}

.hero-actions small {
  padding-right: 2px;
  color: #e48a22;
  font-size: 10px;
  font-weight: 800;
}

.checkin-tip.is-hidden {
  display: none;
}

@keyframes checkinGradient {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes checkinGlow {
  0%,
  100% {
    box-shadow:
      0 10px 20px rgba(255, 132, 90, 0.22),
      0 0 0 rgba(255, 188, 55, 0);
  }

  50% {
    box-shadow:
      0 14px 26px rgba(255, 111, 73, 0.34),
      0 0 18px 5px rgba(255, 184, 76, 0.34);
  }
}

@keyframes checkinShine {
  0% {
    left: -50%;
    opacity: 0;
  }

  22% {
    opacity: 0;
  }

  48% {
    opacity: 0.75;
  }

  78%,
  100% {
    left: 115%;
    opacity: 0;
  }
}

@keyframes boltPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.12) rotate(-4deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .checkin-button,
  .checkin-button::after,
  .checkin-button [data-icon] svg {
    animation: none;
  }
}

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

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid #a8e2bf;
  border-radius: 999px;
  background: #eafff1;
  color: #16a257;
  font-size: 13px;
  font-weight: 800;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 14px;
  background: #f1f5fa;
}

.mode-tabs button {
  min-height: 36px;
  border-radius: 12px;
  background: transparent;
  color: #64748b;
  font-weight: 800;
}

.mode-tabs button.active {
  background: linear-gradient(180deg, #ffffff, #f8fffb);
  color: #111827;
  box-shadow:
    0 7px 16px rgba(31, 41, 55, 0.1),
    inset 0 -2px 0 rgba(35, 172, 88, 0.18);
}

.energy-form {
  display: grid;
  gap: 14px;
}

.rent-panel[hidden] {
  display: none;
}

.field-label {
  position: relative;
  display: grid;
  gap: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.input-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 7px 16px rgba(29, 44, 67, 0.08);
}

.input-card input {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-overflow: clip;
  white-space: nowrap;
}

.input-card input:disabled {
  color: #9aa8ba;
  -webkit-text-fill-color: #9aa8ba;
}

.input-card.is-disabled {
  background: rgba(248, 251, 255, 0.78);
  box-shadow: none;
}

.from-address-field input {
  cursor: text;
}

.from-card {
  border-left: 5px solid var(--green);
}

.accent-input {
  border-left: 5px solid var(--purple);
}

.input-card:focus-within {
  border-color: rgba(35, 172, 88, 0.45);
  box-shadow:
    0 8px 18px rgba(29, 44, 67, 0.08),
    0 0 0 4px rgba(35, 172, 88, 0.09);
}

.address-icon {
  color: var(--green);
}

.chain-select {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  min-height: 30px;
  padding: 0 7px;
  border-radius: 11px;
  background: #eef4fa;
  color: #718198;
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}

.chain-select svg {
  width: 18px;
  height: 18px;
  transform-origin: center;
  transition: transform 160ms ease;
}

.chain-select[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.address-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 12;
  display: grid;
  gap: 0;
  max-height: 320px;
  padding: 8px 0 0;
  border: 1px solid #dce8f2;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 38px rgba(23, 32, 51, 0.16);
  overflow-y: auto;
}

.address-dropdown[hidden] {
  display: none;
}

.address-option {
  display: grid;
  grid-template-columns: 32px 1fr 20px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 0;
  background: transparent;
  color: #172033;
  text-align: left;
}

.address-option.active {
  background: #f7fbff;
  box-shadow: none;
}

.address-option-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #dcf8e8;
  color: #16a34a;
}

.address-option-icon svg {
  width: 16px;
  height: 16px;
}

.address-option-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.address-option strong {
  color: #172033;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.address-option small {
  color: #64748b;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
}

.address-option-check {
  color: #16a34a;
}

.address-option-check svg {
  width: 17px;
  height: 17px;
}

.address-dropdown-manage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
  border-top: 1px solid #edf2f8;
  border-radius: 0 0 15px 15px;
  background: #ffffff;
  color: #16a34a;
  font-size: 12px;
  font-weight: 800;
}

.address-dropdown-manage:active {
  background: #f3fbf6;
}

.address-dropdown-manage svg {
  width: 15px;
  height: 15px;
}

.address-empty-option {
  padding: 12px;
  color: #8a9ab0;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.target-energy-status {
  display: grid;
  grid-template-columns: 13px 1fr;
  align-items: start;
  gap: 5px;
  margin: -5px 0 -2px 8px;
  color: #16a34a;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
}

.target-energy-status[hidden] {
  display: none;
}

.target-energy-status svg {
  width: 13px;
  height: 13px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.target-energy-status.is-loading {
  color: #64748b;
}

.target-energy-status.is-loading svg {
  animation: spin 0.9s linear infinite;
}

.target-energy-status.is-error {
  color: #ef4444;
}

.target-energy-status strong {
  display: grid;
  gap: 4px;
  min-width: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.package-section {
  display: grid;
  gap: 8px;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #172033;
  font-size: 14px;
  font-weight: 900;
}

.section-title [data-icon] {
  color: var(--green);
}

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

.package-card {
  display: grid;
  gap: 6px;
  min-height: 88px;
  padding: 12px 12px 10px;
  border: 1px solid #dfe7f0;
  border-radius: 16px;
  background: #ffffff;
  color: var(--text);
  text-align: center;
  box-shadow: 0 6px 16px rgba(36, 50, 72, 0.08);
  cursor: default;
  pointer-events: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.package-card.active {
  border-color: #8ad9a7;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(35, 172, 88, 0.45), rgba(61, 131, 232, 0.25)) border-box;
  box-shadow:
    0 9px 18px rgba(36, 50, 72, 0.08),
    0 0 0 3px rgba(35, 172, 88, 0.08);
}

.package-card strong {
  font-size: 20px;
  line-height: 1;
}

.package-card span {
  padding-bottom: 6px;
  border-bottom: 1px solid #e6edf4;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.package-card em,
.package-price {
  color: #65758e;
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
}

.package-price {
  display: grid;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 23px;
  line-height: 1.1;
}

.package-price.is-free s {
  position: relative;
  display: inline-block;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.package-price.is-free s::after {
  position: absolute;
  right: -3px;
  left: -3px;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  transform: rotate(-8deg);
  background: #ef4444;
  content: "";
}

.package-price.is-free b {
  color: #16a34a;
  font-size: 14px;
  font-weight: 900;
}

.free-energy-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 16px;
  border: 1px solid #e1eaf4;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 7px 16px rgba(29, 44, 67, 0.07);
  cursor: default;
  user-select: none;
}

.free-energy-card span {
  display: grid;
  gap: 2px;
}

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

.free-energy-card small {
  color: var(--muted);
  font-size: 12px;
}

.free-energy-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.free-energy-card i {
  position: relative;
  width: 40px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #cbd5e1;
}

.free-energy-card i::before {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  content: "";
  transition: transform 160ms ease;
}

.free-energy-card input:checked + i {
  background: #23ac58;
}

.free-energy-card input:checked + i::before {
  transform: translateX(16px);
}

.rent-button,
.primary-action {
  min-height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #55c980, #20a957);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  box-shadow:
    0 10px 20px rgba(35, 172, 88, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.rent-button:disabled {
  background: #96d6ad;
  box-shadow: none;
  opacity: 1;
}

.usage-guide {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 18px 20px 14px;
  border: 1px solid #add0ff;
  border-radius: 12px;
  background: linear-gradient(180deg, #eef6ff, #f8fbff);
  color: #5474d7;
  box-shadow: 0 8px 18px rgba(61, 131, 232, 0.08);
}

.usage-guide header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #3575f6;
  font-size: 16px;
  font-weight: 900;
}

.usage-guide header svg {
  width: 18px;
  height: 18px;
}

.usage-guide p {
  margin: 0;
  color: #2458df;
  font-size: 13px;
  font-weight: 900;
}

.usage-guide ol {
  display: grid;
  gap: 10px;
  margin: 2px 0 0;
  padding: 16px 0 16px 18px;
  border-top: 1px solid #cfe0fb;
  border-bottom: 1px solid #cfe0fb;
  color: #6684df;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.7;
}

.usage-guide li small {
  display: block;
  margin-left: 10px;
  color: #7c93e6;
  font-size: 12px;
  font-weight: 800;
}

.usage-guide li small::before {
  content: "· ";
}

.usage-guide button {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  padding: 0;
  background: transparent;
  color: #13964d;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.usage-guide button strong {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.usage-guide button b,
.usage-guide button span {
  display: block;
}

.usage-guide button b {
  font-weight: 900;
}

.usage-guide button span {
  color: #15803d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.usage-guide button svg {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.transfer-rent-panel {
  display: grid;
  gap: 16px;
}

.transfer-pay-card {
  display: grid;
  gap: 16px;
  padding: 28px 14px 16px;
  border: 1px solid #dfe7f0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 6px 16px rgba(36, 50, 72, 0.08);
}

.transfer-qr-card {
  box-shadow:
    0 16px 30px rgba(37, 54, 76, 0.12),
    -18px 0 30px rgba(35, 172, 88, 0.28),
    18px 0 30px rgba(155, 92, 246, 0.25);
}

#swap-qr-canvas,
#transfer-qr-canvas {
  width: 164px;
  height: 164px;
  display: block;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.transfer-address > span {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.2em;
}

.transfer-address div {
  align-items: center;
  min-height: 62px;
  background: #f3f7fc;
}

.transfer-address strong {
  padding-top: 0;
}

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

.transfer-package-card {
  display: grid;
  gap: 10px;
  min-height: 128px;
  padding: 20px 14px 18px;
  border: 1px solid #e0e8f2;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  color: #172033;
  text-align: center;
  box-shadow: 0 7px 18px rgba(36, 50, 72, 0.08);
}

.transfer-package-card strong {
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.transfer-package-card span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.transfer-package-card em {
  color: #16a34a;
  font-size: 18px;
  font-style: normal;
  font-weight: 900;
}

.transfer-guide-card {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.72;
}

.transfer-guide-card header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 900;
}

.transfer-guide-card header svg {
  width: 18px;
  height: 18px;
}

.transfer-guide-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.transfer-guide-card li {
  position: relative;
  padding-left: 18px;
}

.transfer-guide-card li::before {
  position: absolute;
  left: 0;
  content: "✓";
  font-weight: 900;
}

.transfer-guide-card .sub-item {
  margin-left: 18px;
  padding-left: 14px;
  color: #6d8ce0;
  font-size: 12px;
}

.transfer-guide-card .sub-item::before {
  content: "•";
}

.transfer-guide-card.guide-info {
  border: 1px solid #add0ff;
  background: linear-gradient(180deg, #eef6ff, #f8fbff);
  color: #5f7ddd;
}

.transfer-guide-card.guide-info header {
  color: #3575f6;
}

.transfer-guide-card.guide-info li::before {
  color: #22c55e;
}

.transfer-guide-card.guide-warning {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #f97316;
}

.transfer-guide-card.guide-warning li::before {
  content: "•";
  color: #f59e0b;
}

.order-card,
.profile-grid article,
.profile-menu-group {
  border: 1px solid #dfe7f0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 16px rgba(36, 50, 72, 0.08);
}

.swap-layout {
  display: grid;
  gap: 14px;
  width: calc(100% - 28px);
  min-width: 0;
  margin: 0 auto;
  padding: 0;
}

.swap-layout > * {
  min-width: 0;
}

.swap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  margin: 4px 0 0;
  padding: 0;
}

.swap-header h1 {
  font-size: 22px;
}

.rate-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #a9dfbc;
  border-radius: 999px;
  background: #eafff1;
  color: #12964d;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.rate-pill svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}

.swap-recharge-card {
  display: grid;
  gap: 18px;
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - 152px - env(safe-area-inset-bottom));
  align-content: start;
  justify-self: stretch;
  padding: 18px 14px 16px;
  border: 1px solid #dfe7f0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 16px rgba(36, 50, 72, 0.08);
}

.qr-card {
  display: grid;
  width: 176px;
  height: 176px;
  place-items: center;
  justify-self: center;
  border-radius: 16px;
  background: #ffffff;
  box-shadow:
    0 16px 30px rgba(37, 54, 76, 0.12),
    -18px 0 30px rgba(35, 172, 88, 0.18),
    18px 0 30px rgba(155, 92, 246, 0.16);
}

#swap-qr-canvas {
  width: 164px;
  height: 164px;
  display: block;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.recharge-address {
  display: grid;
  min-width: 0;
  gap: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.recharge-address > span {
  padding-left: 4px;
}

.recharge-address div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 62px;
  padding: 10px 12px 10px 14px;
  border: 1px solid #e5edf6;
  border-radius: 14px;
  background: #f3f7fc;
  box-shadow: 0 7px 16px rgba(37, 54, 76, 0.06);
}

.recharge-address strong {
  min-width: 0;
  flex: 1 1 auto;
  color: #172033;
  font-family: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.42;
  letter-spacing: 0;
  padding-top: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
}

.recharge-address button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: #dff8e9;
  color: #18a957;
}

.recharge-address button svg {
  width: 18px;
  height: 18px;
}

.notice-card {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  min-width: 0;
  min-height: 82px;
  padding: 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.notice-card p {
  min-width: 0;
  margin: 0;
  align-self: center;
  overflow-wrap: anywhere;
}

.notice-card svg {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  stroke-width: 2.4;
}

.notice-card.warning {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #ea580c;
}

.notice-card.danger {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #e11d48;
}

.order-list {
  display: grid;
  gap: 14px;
  padding: 0 6px;
}

.order-card {
  display: grid;
  gap: 18px;
  padding: 18px 16px;
  border-radius: 18px;
}

.order-main {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
}

.order-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: #fff7ed;
  color: #f59e0b;
}

.order-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke-width: 2.3;
}

.order-meta {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.order-meta strong {
  color: #172033;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
}

.order-meta time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #9aa8ba;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.order-meta time svg {
  width: 13px;
  height: 13px;
}

.order-amount {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.order-amount strong {
  color: #172033;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.order-amount .order-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #d97706;
  font-size: 14px;
}

.order-amount .order-source svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.order-amount span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #effdf4;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.order-amount span svg {
  width: 13px;
  height: 13px;
  color: #22c55e;
}

.order-detail {
  display: grid;
  gap: 10px;
  margin: 0;
}

.order-detail div {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  min-width: 0;
}

.order-detail dt {
  color: #a3afbf;
  font-size: 12px;
  font-weight: 800;
}

.order-detail dd {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.order-detail dd span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-detail dd button {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #edf8f1;
  color: #20a957;
}

.order-detail dd button svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.1;
}

.order-end {
  margin: 4px 0 0;
  color: #c2cad6;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.profile-header p,
.profile-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.profile-header {
  justify-content: flex-start;
  gap: 14px;
}

.profile-header p {
  margin: 4px 0 0;
}

.avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #17aa58, #3d83e8);
  color: #ffffff;
  font-weight: 900;
}

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

.profile-grid article {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.profile-grid strong {
  font-size: 22px;
}

.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 18px;
  margin-left: 4px;
  padding: 0 6px;
  vertical-align: 2px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7d6, #ffd47a);
  color: #92400e;
  font-size: 10px;
  font-weight: 900;
}

.vip-badge svg {
  width: 12px;
  height: 12px;
}

.vip-overview {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid #dfe7f0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 12%, rgba(245, 158, 11, 0.15), transparent 38%),
    radial-gradient(circle at 8% 80%, rgba(35, 172, 88, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.93);
  box-shadow: 0 10px 24px rgba(36, 50, 72, 0.1);
}

.vip-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vip-title > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #172033;
  font-size: 14px;
  font-weight: 900;
}

.vip-title svg {
  width: 17px;
  height: 17px;
  color: #f59e0b;
}

.vip-title em {
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #d97706;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

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

.vip-benefit-grid article {
  display: grid;
  gap: 8px;
  min-height: 94px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #ccebdd;
  background: #f0fdf7;
}

.vip-benefit-grid article > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.vip-benefit-grid article svg {
  width: 16px;
  height: 16px;
}

.vip-benefit-grid small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.vip-benefit-grid strong {
  color: #172033;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
}

.free-remaining-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin: -2px 0 14px;
  padding: 0 14px;
  border: 1px solid #bbf7d0;
  border-radius: 18px;
  background: rgba(240, 253, 247, 0.95);
  color: #15803d;
  box-shadow: 0 8px 18px rgba(36, 50, 72, 0.06);
}

.free-remaining-card > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #15803d;
  font-size: 12px;
  font-weight: 800;
}

.free-remaining-card svg {
  width: 16px;
  height: 16px;
}

.free-remaining-card em {
  flex: 0 0 auto;
  color: #172033;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
}

.profile-menu {
  display: grid;
  gap: 12px;
  overflow: visible;
}

.profile-menu-group {
  display: grid;
  overflow: hidden;
  border-radius: 22px;
}

.profile-menu button {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 18px 0 14px;
  border-bottom: 1px solid #e5edf6;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  font-weight: 800;
}

.profile-menu button:last-child {
  border-bottom: 0;
}

.profile-menu button strong {
  color: #172033;
  font-size: 15px;
  font-weight: 900;
}

.profile-menu button em {
  grid-column: 3;
  color: #94a3b8;
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
}

.profile-menu-icon {
  color: #42bd72;
}

.profile-menu-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.profile-chevron {
  grid-column: 4;
  justify-self: end;
  color: #a8b3c3;
}

.profile-chevron svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.app-version {
  margin: 26px 0 0;
  color: #9aa8ba;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.sub-screen {
  min-height: calc(100vh - 28px);
  padding: 2px 6px 18px;
}

.subpage-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
}

.subpage-back {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: transparent;
  color: #172033;
}

.subpage-back svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

.subpage-header h1 {
  margin: 0;
  color: #172033;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
}

.subpage-header p {
  margin: 4px 0 0;
  color: #7c8da5;
  font-size: 13px;
  font-weight: 700;
}

.address-add-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
  padding: 20px 18px 18px;
  border: 2px dashed #dfe7f0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.45);
}

.address-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  color: #6b7f97;
}

.address-input-row span {
  flex: 0 0 auto;
  color: #58c77f;
}

.address-input-row:nth-child(2) span {
  color: #687a94;
}

.address-input-row svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.1;
}

.address-input-row input {
  min-width: 0;
  color: #172033;
  font-size: 16px;
  font-weight: 800;
}

.address-input-row input::placeholder {
  color: #7f91aa;
  font-size: 14px;
  font-weight: 700;
}

.address-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 13px;
  background: linear-gradient(135deg, #18a957, #22c55e);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(24, 169, 87, 0.24);
}

.address-add-button:disabled {
  background: #9dd8b0;
  box-shadow: none;
}

.address-add-button svg {
  width: 19px;
  height: 19px;
}

.address-count {
  margin: 0 4px 14px;
  color: #6f8098;
  font-size: 13px;
  font-weight: 800;
}

.address-list {
  display: grid;
  gap: 14px;
}

.address-card {
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 10px;
  align-items: center;
  min-height: 84px;
  padding: 18px 16px 16px 18px;
  border: 1px solid #e5edf6;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(36, 50, 72, 0.07);
}

.address-card strong,
.address-card small {
  display: block;
  min-width: 0;
}

.address-card strong {
  margin-bottom: 10px;
  color: #172033;
  font-size: 15px;
  font-weight: 900;
}

.address-card small {
  color: #7b8da5;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.address-delete-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: #f8fbff;
  color: #687a94;
}

.address-delete-button:disabled {
  background: #f1f5f9;
  color: #9aa8ba;
}

.address-delete-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.1;
}

.address-empty {
  margin: 24px 0 0;
  color: #9aa8ba;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.invite-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 22px;
  padding: 18px 8px;
  border: 1px solid #bfe8ce;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(34, 197, 94, 0.12), transparent 54%),
    rgba(255, 255, 255, 0.92);
  box-shadow:
    0 10px 24px rgba(36, 50, 72, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.invite-summary-grid article {
  display: grid;
  gap: 8px;
  min-height: 70px;
  place-items: center;
  padding: 6px 8px;
  border-right: 1px solid #dcefe4;
  color: #172033;
}

.invite-summary-grid article:last-child {
  border-right: 0;
}

.invite-summary-grid small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.invite-summary-grid strong {
  color: #16a34a;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
}

.invite-link-card {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
  padding: 18px 18px 20px;
  border: 1px solid #c9edd7;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(36, 50, 72, 0.08);
}

.invite-link-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.invite-link-card header strong {
  position: relative;
  padding-left: 16px;
  color: #172033;
  font-size: 14px;
  font-weight: 900;
}

.invite-link-card header strong::before {
  position: absolute;
  left: 0;
  color: #16a34a;
  content: "";
  top: 3px;
  width: 4px;
  height: 16px;
  border-radius: 999px;
  background: #16a34a;
}

.invite-link-card header em {
  padding: 4px 10px;
  border-radius: 999px;
  background: #e7f8ee;
  color: #16a34a;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.invite-message-box {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid #e5edf6;
  border-radius: 16px;
  background: #f8fbff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.invite-message-box span {
  min-width: 0;
  flex: 1 1 auto;
  color: #314057;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.invite-message-box button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  align-self: center;
  border: 1px solid #bfe8ce;
  border-radius: 13px;
  background: #eaf8ef;
  color: #18a957;
}

.invite-message-box svg {
  width: 19px;
  height: 19px;
}

.invite-share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, #18a957, #20c46b);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  box-shadow:
    0 12px 22px rgba(24, 169, 87, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.invite-share-button:disabled {
  background: #cbd5e1;
  box-shadow: none;
}

.invite-share-button svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.3;
}

.invite-rules-section {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.invite-rules-section h2 {
  position: relative;
  margin: 0 0 2px;
  padding-left: 14px;
  color: #172033;
  font-size: 18px;
  font-weight: 900;
}

.invite-rules-section h2::before {
  position: absolute;
  top: 3px;
  left: 0;
  width: 4px;
  height: 17px;
  border-radius: 999px;
  background: #16a34a;
  content: "";
}

.invite-rule-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 14px;
  border: 1px solid #dfe7f0;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 7px 18px rgba(36, 50, 72, 0.07);
}

.invite-rule-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #bfe8ce;
  border-radius: 14px;
  background: #eaf8ef;
  color: #16a34a;
}

.invite-rule-icon svg {
  width: 22px;
  height: 22px;
}

.invite-rule-card strong {
  color: #172033;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.4;
}

.invite-rule-card em {
  padding: 6px 10px;
  border: 1px solid #bfe8ce;
  border-radius: 999px;
  background: #eaf8ef;
  color: #16a34a;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.invite-list-section h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: #172033;
  font-size: 18px;
  font-weight: 900;
}

.invite-list-section h2 span:first-child {
  color: #64748b;
}

.invite-list-section h2 svg {
  width: 20px;
  height: 20px;
}

.invite-list {
  display: grid;
  gap: 12px;
  min-height: 112px;
  padding: 18px;
  border: 1px dashed #dfe7f0;
  border-radius: 22px;
}

.invite-empty {
  align-self: center;
  color: #7c8da5;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.invite-user-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #e5edf6;
  border-radius: 14px;
  background: #ffffff;
}

.invite-user-card strong {
  color: #172033;
  font-size: 14px;
  font-weight: 900;
}

.invite-user-card small {
  color: #8a9ab0;
  font-size: 12px;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.24);
}

.modal-backdrop.open {
  display: flex;
}

.success-modal {
  display: grid;
  width: min(330px, calc(100vw - 32px));
  justify-items: center;
  padding: 34px 16px 16px;
  border: 1px solid rgba(209, 250, 229, 0.9);
  border-radius: 22px;
  background:
    linear-gradient(180deg, #f0fff6 0%, #ffffff 48%, #f9fffb 100%);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
  text-align: center;
}

.success-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 0 0 10px rgba(34, 197, 94, 0.04);
  color: #22c55e;
}

.success-icon svg {
  width: 34px;
  height: 34px;
  stroke-width: 2.4;
}

.success-modal h2 {
  margin: 0 0 12px;
  color: #172033;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.2;
}

.success-modal p {
  max-width: 260px;
  margin: 0 0 24px;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}

.modal-confirm {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  background: #22c55e;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.24);
}

.access-modal-backdrop {
  z-index: 50;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(3px);
}

.access-modal {
  width: min(280px, calc(100vw - 56px));
  padding: 24px 24px;
  border-radius: 14px;
  background: #2c2d3d;
  color: #ffffff;
  text-align: center;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.46);
}

.access-modal h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.access-modal p {
  margin: 0 0 24px;
  color: #a9aaba;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}

.access-modal-confirm {
  width: 100%;
  min-height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5e9, #09a8f5);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 30;
  max-width: min(280px, calc(100vw - 48px));
  padding: 10px 14px;
  transform: translate(-50%, 12px);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.tabbar {
  position: fixed;
  right: 0;
  left: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  max-width: 430px;
  min-height: calc(66px + env(safe-area-inset-bottom));
  margin: 0 auto;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid #dce6f2;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 20px rgba(28, 42, 61, 0.08);
  transition: opacity 160ms ease, transform 160ms ease;
}

.tabbar[hidden] {
  display: none;
}

.tabbar button {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 54px;
  border-radius: 14px;
  background: transparent;
  color: #52627a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.tabbar button.active {
  color: var(--green);
}

.tabbar strong {
  overflow: hidden;
  max-width: 100%;
  letter-spacing: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tabbar svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.15;
}

@media (min-width: 700px) {
  body {
    display: grid;
    place-items: start center;
    background: #e9f0f7;
  }

  .app-shell {
    min-height: 780px;
    margin: 20px auto;
    border: 1px solid #dce6f2;
    border-radius: 28px;
    box-shadow: 0 22px 60px rgba(23, 32, 51, 0.16);
  }

  .tabbar {
    bottom: 20px;
    border-radius: 0 0 28px 28px;
  }
}

@media (hover: none) and (pointer: coarse) {
  body.keyboard-active .tabbar {
    transform: translateY(calc(100% + env(safe-area-inset-bottom)));
    opacity: 0;
    pointer-events: none;
  }
}
