:root {
  --bg: #1d2733;
  --bg-2: #18222d;
  --panel: #243142;
  --panel-soft: #304155;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f7fb;
  --muted: #a8b6c8;
  --muted-2: #7d8ca0;
  --blue: #4baeff;
  --green: #59d65c;
  --green-soft: #163728;
  --amber: #ffb336;
  --violet: #a86cff;
  --cyan: #59d8ff;
  --red: #ff5f67;
  --shadow: 0 24px 48px rgba(8, 14, 24, 0.26);
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% -10%, rgba(126, 173, 239, 0.34), transparent 38%),
    linear-gradient(180deg, #2c3b4b 0%, #212d3c 100%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-x: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a,
button,
input,
select,
textarea,
[role="button"],
[data-picker-close],
[data-history-card],
[data-wallet-action] {
  touch-action: manipulation;
}

.phone-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top center, rgba(134, 178, 241, 0.34), transparent 34%),
    linear-gradient(180deg, #2d3c4c 0%, #223041 100%);
}

.phone-shell-p2p {
  background:
    radial-gradient(circle at top center, rgba(134, 178, 241, 0.32), transparent 34%),
    linear-gradient(180deg, #2b3a49 0%, #213041 100%);
}

.screen {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 18px 120px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.topbar-centered .topbar-title {
  margin-left: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.icon-btn-soft {
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn-dark {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.08);
}

.icon-btn-plain {
  width: 26px;
  height: 26px;
  background: transparent;
  border: 0;
  font-size: 22px;
}

.p2p-picker-shell {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  align-items: end;
}

.p2p-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
}

.p2p-picker-sheet {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 10px 16px 18px;
  border-radius: 24px 24px 0 0;
  background: #2a3646;
  box-shadow: 0 -20px 48px rgba(4, 8, 16, 0.34);
}

.p2p-picker-handle {
  width: 40px;
  height: 4px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.p2p-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.p2p-picker-title {
  font-size: 17px;
  font-weight: 700;
}

.p2p-picker-close {
  color: var(--violet);
  font-size: 14px;
  font-weight: 700;
}

.p2p-picker-list {
  display: grid;
  gap: 10px;
  max-height: min(56vh, 420px);
  overflow-y: auto;
  padding-bottom: 2px;
}

.p2p-picker-option {
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #f3f3f3;
  font-size: 15px;
  text-align: left;
}

.p2p-picker-option.active {
  box-shadow: inset 0 0 0 1px rgba(141, 66, 255, 0.6);
}

.p2p-picker-option-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.p2p-picker-option-leading {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
}

.p2p-picker-option-leading-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: block;
}

.p2p-picker-option-leading-text {
  color: #f5a340;
  font-weight: 700;
}

.p2p-picker-option-check {
  color: var(--violet);
  font-weight: 700;
}

.p2p-picker-amount {
  display: grid;
  gap: 12px;
}

.app-lock-shell {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 14, 24, 0.74);
  backdrop-filter: blur(10px);
}

.app-lock-panel {
  width: min(100%, 420px);
  padding: 24px 18px 18px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top center, rgba(120, 165, 240, 0.18), transparent 42%),
    linear-gradient(180deg, #2c3b4a 0%, #223041 100%);
  box-shadow: 0 28px 64px rgba(4, 9, 18, 0.38);
  display: grid;
  gap: 14px;
  text-align: center;
}

.app-lock-badge {
  width: 68px;
  height: 68px;
  margin: 0 auto 2px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #7acfff 0%, #4baeff 100%);
  box-shadow: 0 18px 40px rgba(32, 106, 194, 0.34);
}

.app-lock-badge-icon {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.98);
  mask: url("/static/icons/heroicons/lock-closed.svg") center / contain no-repeat;
  -webkit-mask: url("/static/icons/heroicons/lock-closed.svg") center / contain no-repeat;
}

.app-lock-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-lock-text {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.app-lock-banner {
  display: block;
  margin: 2px 0;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
}

.app-lock-banner.is-info {
  background: rgba(122, 207, 255, 0.14);
  color: #dff3ff;
}

.app-lock-banner.is-success {
  background: rgba(83, 204, 139, 0.16);
  color: #dff9e9;
}

.app-lock-banner.is-error {
  background: rgba(255, 104, 104, 0.16);
  color: #ffe2e2;
}

.app-lock-form {
  display: grid;
  gap: 12px;
}

.app-lock-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 18px;
  letter-spacing: 0.1em;
}

.app-lock-input::placeholder {
  color: var(--muted-2);
  letter-spacing: normal;
}

.app-lock-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.app-lock-btn {
  min-height: 48px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
}

.app-lock-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
}

.app-lock-btn-primary {
  background: linear-gradient(90deg, #7c4dff 0%, #d254ff 100%);
}

.app-confirm-shell {
  position: fixed;
  inset: 0;
  z-index: 1280;
  display: grid;
  place-items: end center;
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
}

.app-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 18, 0.66);
  backdrop-filter: blur(10px);
}

.app-confirm-panel {
  position: relative;
  width: min(100%, 420px);
  padding: 18px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 18% 0%, rgba(122, 207, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(38, 52, 68, 0.98) 0%, rgba(30, 42, 56, 0.98) 100%);
  box-shadow: 0 28px 70px rgba(3, 8, 16, 0.45);
  display: grid;
  gap: 12px;
  text-align: left;
}

.app-confirm-mark {
  width: 46px;
  height: 46px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #7acfff 0%, #4baeff 100%);
  box-shadow: 0 14px 32px rgba(33, 118, 196, 0.28);
}

.app-confirm-mark-icon {
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.98);
  mask: url("/static/icons/heroicons/shield-check.svg") center / contain no-repeat;
  -webkit-mask: url("/static/icons/heroicons/shield-check.svg") center / contain no-repeat;
}

.app-confirm-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-confirm-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.app-confirm-btn {
  min-height: 50px;
  border-radius: 17px;
  font-size: 15px;
  font-weight: 800;
}

.app-confirm-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.app-confirm-btn-primary {
  background: linear-gradient(90deg, #7c4dff 0%, #58b7ff 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(79, 124, 235, 0.22);
}

.app-toast-shell {
  position: fixed;
  top: 18px;
  left: 16px;
  right: 16px;
  z-index: 1250;
  display: grid;
  justify-items: center;
  pointer-events: none;
}

.app-toast {
  width: min(100%, 420px);
  min-height: 64px;
  padding: 12px 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(33, 45, 60, 0.94);
  box-shadow:
    0 22px 48px rgba(6, 12, 22, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--text);
  pointer-events: auto;
  text-align: left;
}

.app-toast-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #8b72ff 0%, #6b93ff 100%);
  color: #fff;
  box-shadow: 0 12px 26px rgba(52, 74, 161, 0.24);
}

.app-toast-mark-icon {
  width: 18px;
  height: 18px;
  display: block;
  background: rgba(255, 255, 255, 0.96);
  mask: url("/static/icons/heroicons/chat-bubble-left-right.svg") center / contain no-repeat;
  -webkit-mask: url("/static/icons/heroicons/chat-bubble-left-right.svg") center / contain no-repeat;
}

.app-toast-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.app-toast-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.app-toast-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.app-toast-arrow {
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  visibility: hidden;
}

.app-toast.has-action .app-toast-arrow {
  visibility: visible;
}

.p2p-picker-label {
  color: #adadad;
  font-size: 13px;
}

.p2p-picker-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: #f3f3f3;
  font: inherit;
}

.p2p-picker-input::placeholder {
  color: #7d7d7d;
}

.p2p-picker-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.p2p-picker-action {
  min-height: 52px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
}

.p2p-picker-action-primary {
  background: linear-gradient(90deg, #8d42ff 0%, #b34bff 100%);
  color: #fff;
}

.p2p-picker-action-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #f3f3f3;
}

.is-hidden {
  display: none !important;
}
