* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:root {
  --bg: #f0f7ff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface2: #f8fafc;
  --ink: #0f172a;
  --ink2: #475569;
  --ink3: #94a3b8;
  --line: #e2e8f0;
  --blue: #0284c7;
  --blue2: #0369a1;
  --blue-soft: #e0f2fe;
  --cyan: #06b6d4;
  --indigo: #4f46e5;
  --green: #059669;
  --green-soft: #d1fae5;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -8px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 20px 48px -12px rgba(37, 99, 235, 0.18);
}

html {
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: "IBM Plex Sans Thai", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 100% 80% at 50% -30%, rgba(34, 211, 238, 0.18), transparent 58%),
    radial-gradient(ellipse 60% 50% at 100% 10%, rgba(79, 70, 229, 0.1), transparent),
    radial-gradient(ellipse 50% 40% at 0% 90%, rgba(37, 99, 235, 0.08), transparent),
    var(--bg);
}

.mesh::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 70%);
  pointer-events: none;
}

.page {
  max-width: 400px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px max(36px, env(safe-area-inset-bottom));
}

.page.is-pay .head {
  padding-bottom: 14px;
}

.page.is-pay .brand {
  justify-content: center;
}

.page.is-pay .panel {
  padding: 20px 18px 22px;
}

.head {
  padding: 6px 2px 22px;
  animation: fadeDown 0.55s var(--ease) both;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  filter: drop-shadow(0 8px 20px rgba(37, 99, 235, 0.28));
  transition: transform 0.35s var(--ease);
}

.brand-mark svg {
  width: 48px;
  height: 48px;
  display: block;
}

.brand:hover .brand-mark {
  transform: scale(1.04) rotate(-2deg);
}

.brand-text b {
  display: block;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--ink) 0%, var(--blue2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text span {
  font-size: 0.78rem;
  color: var(--ink3);
  font-weight: 500;
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius);
  padding: 24px 20px 26px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.form-panel {
  animation: panelIn 0.5s var(--ease) 0.05s both;
}

.form-panel.is-leaving {
  animation: panelOut 0.28s var(--ease) forwards;
  pointer-events: none;
}

.pay-panel {
  animation: panelIn 0.45s var(--ease) both;
}

.pay-panel.is-leaving {
  animation: panelOut 0.28s var(--ease) forwards;
  pointer-events: none;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes panelOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.98); }
}

.friend-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.95) 0%, rgba(219, 234, 254, 0.9) 100%);
  border: 1px solid rgba(147, 197, 253, 0.6);
  animation: fadeDown 0.4s var(--ease) both;
}

.friend-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.friend-icon svg {
  width: 20px;
  height: 20px;
}

.friend-banner p {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue2);
  line-height: 1.45;
}

.hero-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.9), rgba(240, 249, 255, 0.7));
  border-radius: 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(186, 230, 253, 0.8);
}

.chip-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--cyan), #2563eb);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}

.chip-icon svg {
  width: 18px;
  height: 18px;
}

.hero-chip p {
  font-size: 0.84rem;
  color: var(--blue2);
  font-weight: 500;
  line-height: 1.4;
}

.panel h1 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 22px;
  line-height: 1.2;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink2);
  margin-bottom: 8px;
}

.field-label em {
  font-style: normal;
  font-weight: 400;
  color: var(--ink3);
}

.field {
  width: 100%;
  padding: 14px 15px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface2);
  margin-bottom: 18px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}

.field:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
  background: #fff;
}

.money-input {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--surface2);
  padding: 4px 18px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s, transform 0.2s;
}

.money-input:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
  background: #fff;
  transform: translateY(-1px);
}

.money-input span {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--blue);
  margin-right: 4px;
}

.money-input input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 2.15rem;
  font-weight: 700;
  color: var(--ink);
  padding: 14px 0;
  letter-spacing: -0.04em;
  -moz-appearance: textfield;
  appearance: textfield;
}

.money-input input::-webkit-outer-spin-button,
.money-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.money-input input:focus {
  outline: none;
}

.money-input input::placeholder {
  color: #cbd5e1;
  font-weight: 500;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.pills button {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
  transition: all 0.22s var(--ease);
}

.pills button:hover {
  border-color: #93c5fd;
  color: var(--blue);
  background: var(--blue-soft);
  transform: translateY(-1px);
}

.pills button:active {
  transform: scale(0.96);
}

.pills button.on {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--cyan), #2563eb);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.cta {
  width: 100%;
  padding: 17px 20px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #22d3ee 0%, #2563eb 55%, #4f46e5 100%);
  background-size: 200% 100%;
  color: #fff;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background-position 0.4s;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.18) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.cta:hover:not(:disabled) {
  background-position: 100% 0;
  box-shadow: 0 16px 40px -10px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.cta:hover:not(:disabled)::before {
  transform: translateX(100%);
}

.cta:active:not(:disabled) {
  transform: scale(0.98) translateY(0);
}

.cta:disabled {
  opacity: 0.75;
  cursor: wait;
}

.cta-spin {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

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

.field-err {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--red);
  font-size: 0.86rem;
  font-weight: 500;
  animation: shake 0.4s var(--ease);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.ticket {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(165deg, #fff 0%, #f8fafc 55%, #f1f5f9 100%);
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.ticket-head {
  text-align: center;
  padding: 20px 18px 14px;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px 6px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--amber-soft);
  color: var(--amber);
  margin-bottom: 12px;
  transition: background 0.3s, color 0.3s;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.4s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.85); }
}

.live.paid {
  background: var(--green-soft);
  color: var(--green);
}

.live.paid .live-dot {
  animation: pop 0.4s var(--ease);
}

@keyframes pop {
  0% { transform: scale(0.5); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.live.fail {
  background: #fef2f2;
  color: var(--red);
}

.live.fail .live-dot {
  animation: none;
}

.ticket-note {
  font-size: 0.9rem;
  color: var(--ink2);
  margin-bottom: 6px;
}

.ticket-note:empty {
  display: none;
}

.ticket-amount {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--ink);
  line-height: 1.05;
  transition: transform 0.35s var(--ease);
  background: linear-gradient(135deg, #0f172a 30%, #0369a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ticket-line {
  height: 1px;
  background: var(--line);
  margin: 0 16px;
}

.ticket-line.dashed {
  background: none;
  border-top: 2px dashed #cbd5e1;
  margin: 0 20px;
}

.scan-zone {
  padding: 18px 16px 22px;
  text-align: center;
  background: linear-gradient(180deg, rgba(240, 249, 255, 0.5) 0%, transparent 100%);
}

.scan-corners {
  position: relative;
  display: inline-block;
  padding: 14px;
  animation: qrIn 0.5s var(--ease) 0.15s both;
}

@keyframes qrIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.scan-corners::before,
.scan-corners::after,
.qr-box::before,
.qr-box::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--cyan);
  border-style: solid;
  pointer-events: none;
  transition: border-color 0.3s;
}

.scan-corners::before {
  top: 0;
  left: 0;
  border-width: 3px 0 0 3px;
  border-radius: 6px 0 0 0;
}

.scan-corners::after {
  top: 0;
  right: 0;
  border-width: 3px 3px 0 0;
  border-radius: 0 6px 0 0;
}

.qr-box {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06), inset 0 0 0 1px #f1f5f9;
}

.qr-box::before {
  bottom: 0;
  left: 0;
  border-width: 0 0 3px 3px;
  border-radius: 0 0 0 6px;
}

.qr-box::after {
  bottom: 0;
  right: 0;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 6px 0;
}

.qr-box img {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}

.qr-box p {
  padding: 30px 10px;
  color: var(--ink3);
  font-size: 0.88rem;
}

.scan-label {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--ink2);
  line-height: 1.55;
}

.scan-label strong {
  color: var(--blue);
  font-weight: 700;
}

.kplus-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
  padding: 15px 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(21, 128, 61, 0.28);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.kplus-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(21, 128, 61, 0.34);
}

.kplus-btn:active {
  transform: scale(0.98);
}

.kplus-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kplus-hint {
  margin-top: 8px;
  font-size: 0.74rem;
  color: var(--ink3);
  line-height: 1.45;
}

.kplus-sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.kplus-sheet[hidden] {
  display: none;
}

.kplus-sheet-bg {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.kplus-sheet-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  overflow: auto;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -16px 48px rgba(15, 23, 42, 0.18);
  animation: sheetUp 0.32s var(--ease);
}

@keyframes sheetUp {
  from { transform: translateY(100%); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

.kplus-sheet-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--ink2);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.kplus-sheet-tag {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #16a34a;
}

.kplus-sheet-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.kplus-sheet-amt {
  margin: 0 0 14px;
  font-size: 1.65rem;
  font-weight: 800;
  color: #15803d;
  letter-spacing: -0.02em;
}

.kplus-sheet-qr {
  display: flex;
  justify-content: center;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f0fdf4, #fff);
  border: 1px solid #bbf7d0;
}

.kplus-sheet-qr img {
  width: min(240px, 72vw);
  height: auto;
  display: block;
  border-radius: 10px;
}

.kplus-steps {
  margin: 0 0 16px;
  padding-left: 1.15rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--ink2);
}

.kplus-steps strong {
  color: var(--ink);
}

.kplus-sheet-open {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(21, 128, 61, 0.28);
}

.kplus-sheet-save {
  width: 100%;
  margin-top: 10px;
  padding: 13px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  color: var(--ink2);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.kplus-sheet-install {
  display: block;
  margin-top: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #15803d;
  text-align: center;
  text-decoration: none;
}

.kplus-sheet-install:hover {
  text-decoration: underline;
}

.kplus-sheet-note {
  margin: 12px 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--ink3);
  text-align: center;
}

.expire-hint {
  display: inline-block;
  margin-top: 12px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--amber-soft);
  border: 1px solid #fcd34d;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  transition: background 0.25s, color 0.25s, transform 0.25s;
}

.expire-hint.urgent {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--red);
  animation: pulseUrgent 1.2s ease infinite;
}

@keyframes pulseUrgent {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.flow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 12px 20px;
  gap: 0;
}

.flow-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  transition: opacity 0.3s;
}

.flow-item i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--line);
  color: var(--ink3);
  transition: all 0.35s var(--ease);
}

.flow-item span {
  font-size: 0.64rem;
  color: var(--ink3);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.3s;
}

.flow-item.done i,
.flow-item.active i {
  background: linear-gradient(135deg, var(--cyan), var(--indigo));
  color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.flow-item.done span,
.flow-item.active span {
  color: var(--ink);
  font-weight: 600;
}

.flow-item.paid i {
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3);
}

.flow-line {
  width: 32px;
  height: 2px;
  background: var(--line);
  margin: 0 4px;
  margin-bottom: 20px;
  border-radius: 1px;
  transition: background 0.4s;
}

.flow-item.done + .flow-line,
.flow-item.active + .flow-line {
  background: linear-gradient(90deg, var(--cyan), var(--indigo));
}

.share-block {
  margin-bottom: 16px;
}

.block-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  padding-left: 2px;
}

.share-preview {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.preview-text {
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 12px;
}

.preview-link {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--blue2);
  background: var(--blue-soft);
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 10px 12px;
  word-break: break-all;
}

.preview-expire {
  margin-top: 10px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--amber);
}

.pay-footer {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pay-footer .wait {
  margin-bottom: 10px;
}

.pay-footer .ref {
  margin-bottom: 8px;
}

.pay-footer .link-btn {
  margin-top: 4px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.pay-panel .actions {
  margin-bottom: 0;
}

.act {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 10px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
  transition: all 0.22s var(--ease);
}

.act svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.act:hover {
  background: var(--surface2);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.act:active {
  transform: scale(0.97);
}

.act.primary {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #22d3ee, #2563eb);
  border-color: transparent;
  color: #fff;
  font-size: 0.94rem;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.24);
}

.act.primary:hover {
  background: linear-gradient(135deg, #06b6d4, #1d4ed8);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.3);
}

.ref {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  background: var(--surface2);
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
  font-size: 0.76rem;
}

.ref span {
  color: var(--ink3);
  flex-shrink: 0;
}

.ref code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  color: var(--ink2);
}

.ref button {
  flex-shrink: 0;
  border: none;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.ref button:active {
  transform: scale(0.95);
}

.wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--ink3);
}

.wait-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  animation: blink 1.2s ease infinite;
}

.success-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  background: var(--green-soft);
  border: 1px solid #6ee7b7;
  margin-bottom: 16px;
  animation: successIn 0.45s var(--ease);
}

@keyframes successIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.success-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  animation: pop 0.5s var(--ease);
}

.success-card strong {
  display: block;
  color: var(--green);
  font-size: 1.02rem;
  margin-bottom: 2px;
}

.success-card p {
  font-size: 0.82rem;
  color: #047857;
}

.link-btn {
  width: 100%;
  padding: 14px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink3);
  cursor: pointer;
  border-radius: 12px;
  transition: color 0.2s, background 0.2s;
}

.link-btn:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.snack {
  position: fixed;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 22px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.28);
  z-index: 99;
  animation: snackIn 0.35s var(--ease);
  white-space: nowrap;
}

@keyframes snackIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

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

@media (max-width: 360px) {
  .ticket-amount { font-size: 2.35rem; }
  .qr-box img { width: 190px; }
  .actions { grid-template-columns: 1fr; }
  .act.primary { grid-column: auto; }
}
