*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: rgb(24, 4, 55);
  --surface: rgba(255,255,255,0.04);
  --line: rgba(255,255,255,0.08);
  --line2: rgba(255,255,255,0.12);
  --t1: rgba(255,255,255,0.96);
  --t2: rgba(255,255,255,0.52);
  --t3: rgba(255,255,255,0.28);
  --accent: #a78bfa;
  --green: #86efac;
  --amber: #fcd34d;
  --red: #fca5a5;
  --r: 14px;
  --rl: 20px;
}

html, body {
  background: var(--bg);
  color: var(--t1);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.root {
  position: relative;
  z-index: 1;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

.hd {
  padding: 40px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: rise 0.5s ease both;
}

.brand {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1px solid var(--line2);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  animation: pop 0.4s cubic-bezier(0.34,1.4,0.64,1) 0.05s both;
}

.brand::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.05);
}

.hd-info { text-align: center; }

.hd-title {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.4px;
  line-height: 1.2;
  margin-bottom: 6px;
  animation: rise 0.4s ease 0.1s both;
}

.hd-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: rise 0.4s ease 0.16s both;
}

.hd-row {
  font-size: 13px;
  color: var(--t2);
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.hd-row svg { color: var(--t3); }

.hd-price {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  animation: rise 0.4s ease 0.22s both;
}

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

@keyframes pop {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

.tabs {
  display: flex;
  align-items: center;
  margin: 0 24px 24px;
  border-bottom: 1px solid var(--line);
  animation: rise 0.4s ease 0.25s both;
}

.tab {
  flex: 1;
  padding: 10px 8px 11px;
  border: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--t3);
  cursor: pointer;
  border-bottom: 1.5px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
  letter-spacing: -0.1px;
}

.tab.on {
  color: var(--t1);
  border-bottom-color: var(--accent);
}

.scr {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 0 24px;
}

.scr.on {
  display: flex;
  animation: rise 0.3s ease both;
}

.block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.trow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.trow:last-child { border-bottom: none; }
.tk { font-size: 14px; color: var(--t2); font-weight: 400; flex-shrink: 0; }
.tv { font-size: 14px; font-weight: 500; text-align: right; }
.tv.ac { color: var(--accent); }
.tv.gn { color: var(--green); }
.tv.am { color: var(--amber); }
.tv.sm { font-family: 'Courier New', monospace; font-size: 12px; letter-spacing: 0.5px; }

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.step {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--t3);
  transition: all 0.3s ease;
}

.step.on   { background: var(--accent); width: 16px; border-radius: 3px; }
.step.done { background: var(--green); }

.sb { display: none; }

.sb.on {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: rise 0.25s ease both;
}

.mono-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.mono-logo {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  flex-shrink: 0;
  overflow: hidden;
}

.mono-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mono-name { font-size: 15px; font-weight: 500; }
.mono-sub  { font-size: 12px; color: var(--t2); margin-top: 1px; }

.amount-center {
  padding: 20px 16px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.amount-fig {
  font-size: 48px;
  font-weight: 300;
  letter-spacing: -3px;
  line-height: 1;
}

.amount-ccy {
  font-size: 20px;
  color: var(--t2);
  font-weight: 300;
}

.id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.id-label {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 3px;
  font-weight: 500;
}

.id-num { font-size: 18px; font-weight: 500; }

.cp-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--t2);
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}

.cp-btn:hover { color: var(--t1); }
.cp-btn.ok    { color: var(--green); border-color: rgba(134,239,172,0.3); }

.note {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--t2);
  line-height: 1.6;
  border-bottom: 1px solid var(--line);
}

.note strong { color: var(--t1); font-weight: 500; }

.btn {
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: var(--r);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: -0.1px;
  transition: opacity 0.18s, transform 0.15s;
}

.btn:active:not(:disabled) { transform: scale(0.985); }

.btn svg { flex-shrink: 0; }

.btn-white {
  background: rgba(255,255,255,0.94);
  color: rgb(24,4,55);
  font-weight: 600;
}

.btn-white:hover:not(:disabled) { opacity: 0.88; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--t2);
  font-size: 14px;
  padding: 13px 20px;
}

.btn-ghost:hover { color: var(--t1); border-color: var(--line2); }

.btn-lock {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--t3);
  cursor: not-allowed;
  font-size: 14px;
}

.btn-confirm {
  background: rgba(134,239,172,0.12);
  border: 1px solid rgba(134,239,172,0.22);
  color: var(--green);
}

.btn-confirm:hover:not(:disabled) { background: rgba(134,239,172,0.18); }

@keyframes unlockPop {
  0%   { transform: scale(0.98); opacity: 0.5; }
  60%  { transform: scale(1.01); opacity: 1; }
  100% { transform: scale(1); }
}

.btn-anim { animation: unlockPop 0.35s ease both; }

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.state-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.state-icon.ok     { background: rgba(134,239,172,0.1); color: var(--green); }
.state-icon.wait   { background: rgba(252,211,77,0.1);  color: var(--amber); }
.state-icon.empty  { background: var(--surface); color: var(--t3); }

.state-title { font-size: 17px; font-weight: 500; margin-bottom: 6px; letter-spacing: -0.2px; }
.state-body  { font-size: 13px; color: var(--t2); line-height: 1.6; }

.ticket {
  border: 1px solid rgba(167,139,250,0.18);
  border-radius: var(--rl);
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}

.ticket-top { padding: 18px 18px 16px; }

.ticket-badge {
  display: block;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.tb-valid   { color: var(--green); }
.tb-used    { color: var(--red); }
.tb-expired { color: var(--t3); }
.tb-pending { color: var(--amber); }

.ticket-name {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.3px;
  line-height: 1.3;
  margin-bottom: 10px;
}

.ticket-meta { display: flex; flex-direction: column; gap: 4px; }

.ticket-meta span {
  font-size: 12px;
  color: var(--t2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ticket-meta svg { color: var(--t3); flex-shrink: 0; }

.ticket-dash {
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--line2) 0, var(--line2) 5px, transparent 5px, transparent 10px);
  margin: 0 -1px;
  position: relative;
}

.ticket-dash::before,
.ticket-dash::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
}

.ticket-dash::before { left: -8px; }
.ticket-dash::after  { right: -8px; }

.ticket-bot { padding: 18px 18px 20px; }

.qr-center { display: flex; justify-content: center; margin-bottom: 14px; }

#qrbox {
  background: #fff;
  padding: 8px;
  border-radius: 9px;
  display: inline-block;
}

#qrbox canvas,
#qrbox img { display: block; border-radius: 4px; }

.tkt-code {
  text-align: center;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--t3);
  margin-bottom: 4px;
  font-family: 'Courier New', monospace;
}

.tkt-hint { text-align: center; font-size: 11px; color: var(--t3); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 52px 20px;
  gap: 8px;
}

.empty-ico {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t3);
  margin-bottom: 6px;
}

.empty-title { font-size: 18px; font-weight: 500; letter-spacing: -0.3px; }
.empty-sub   { font-size: 13px; color: var(--t2); line-height: 1.6; margin-bottom: 16px; }

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  gap: 12px;
}

.spin {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(167,139,250,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinning 0.8s linear infinite;
}

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

.loader-lbl { font-size: 13px; color: var(--t3); }

.toast {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(48px);
  opacity: 0;
  pointer-events: none;
  background: rgba(18,6,42,0.96);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line2);
  border-radius: 100px;
  padding: 10px 20px;
  font-size: 13px;
  white-space: nowrap;
  z-index: 999;
  transition: all 0.28s cubic-bezier(0.16,1,0.3,1);
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.ok   { border-color: rgba(134,239,172,0.25); color: var(--green); }
.toast.er   { border-color: rgba(252,165,165,0.22); color: var(--red); }