/* Mea light theme: warm white #FCFCFA, white cards, navy #001130, blue #0047FD, orange #F26B0F. Mobile first (375x560). */
:root {
  --bg: #FCFCFA;
  --card: #FFFFFF;
  --ink: #001130;
  --muted: #4A5670;
  --line: #E3E7EF;
  --blue: #0047FD;
  --blue-dark: #0036C4;
  --orange: #F26B0F;
  --green: #06C755;
  --soft: #F2F5FA;
  --radius: 18px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 "Noto Sans Thai", "Sukhumvit Set", "Leelawadee UI", system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
[hidden] { display: none !important; }
a { color: var(--blue-dark); }
h1 { font-size: 26px; line-height: 1.3; margin: 6px 0 8px; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 19px; line-height: 1.35; margin: 0 0 6px; font-weight: 700; }
h3 { font-size: 16px; margin: 16px 0 6px; font-weight: 700; }
p { margin: 0 0 10px; }
.wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
}
.center { text-align: center; }
.left { text-align: left; }
.brand { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--blue); letter-spacing: 0.02em; }
.lead { font-size: 17px; color: var(--muted); margin-bottom: 14px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 12px;
  box-shadow: 0 1px 2px rgba(0, 17, 48, 0.04), 0 6px 18px rgba(0, 17, 48, 0.05);
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  margin: 10px 0 0;
  padding: 10px 16px;
  border: 2px solid transparent;
  border-radius: 14px;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.orange { background: var(--orange); color: #fff; }
.btn.line { background: var(--green); color: #fff; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.link {
  display: inline-block;
  margin: 12px 0 0;
  padding: 8px 0;
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--blue-dark);
  font: inherit;
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
}
.center .link { display: block; }
.spin {
  width: 34px;
  height: 34px;
  margin: 18px auto;
  border: 4px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }

/* start / login view */
.hero { padding: 6px 2px 4px; }
.steps3 { list-style: none; margin: 0 0 4px; padding: 0; counter-reset: s; }
.steps3 li { position: relative; padding: 6px 0 6px 40px; counter-increment: s; }
.steps3 li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--blue);
  font-weight: 800;
  text-align: center;
  line-height: 28px;
}
.hint { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--soft); font-size: 14px; color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); text-align: center; margin-top: 12px; }

/* account */
.hello { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hello h1 { margin-right: auto; font-size: 22px; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; background: var(--soft); color: var(--ink); }
.badge.trial { background: #E8EEFF; color: var(--blue-dark); }
.badge.full { background: #E6F8EE; color: #057A3A; }
.badge.expired { background: #FFF0E6; color: #B44A00; }
.badge.wait { background: var(--soft); color: var(--muted); }
.label { margin: 0; font-size: 14px; color: var(--muted); }
.big { margin: 0; font-size: 38px; font-weight: 800; line-height: 1.2; color: var(--ink); }
.copybox { display: flex; flex-direction: column; gap: 0; }
.copybox input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--ink);
  font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.steps { margin: 0; padding-left: 22px; }
.steps li { margin: 0 0 8px; }
.err { margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: #FFF0E6; color: #8A3A00; }
.price .big { color: var(--orange); }
.ticks { list-style: none; margin: 8px 0 0; padding: 0; }
.ticks li { position: relative; padding: 3px 0 3px 26px; }
.ticks li::before { content: "✓"; position: absolute; left: 2px; color: var(--green); font-weight: 800; }

/* buy */
.qr { display: block; width: 260px; max-width: 100%; height: auto; margin: 10px auto; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.countdown { font-weight: 700; color: var(--orange); }

/* receipt */
.receipt-page .receipt header { text-align: center; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.receipt-page .receipt h1 { font-size: 24px; }
.receipt-page .seller { margin-bottom: 12px; font-size: 15px; }
.receipt-page dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 12px; font-size: 15px; }
.receipt-page dl.meta dt { color: var(--muted); }
.receipt-page dl.meta dd { margin: 0; word-break: break-all; }
.receipt-page table.items { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: 15px; }
.receipt-page table.items th, .receipt-page table.items td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.receipt-page table.items th:last-child, .receipt-page table.items td:last-child { text-align: right; white-space: nowrap; }
.receipt-page tfoot th { border-bottom: 0; font-size: 17px; }
.receipt-page .void { padding: 10px 12px; border-radius: 12px; background: #FFF0E6; color: #8A3A00; font-weight: 700; }
.receipt-page .test { color: var(--orange); font-weight: 700; }
.receipt-page .note { font-size: 13px; color: var(--muted); }
.receipt-page .actions { display: flex; flex-direction: column; gap: 0; }

/* any modal from our pages follows the skill's popup scroll rules */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: start;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 12px calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 10, 31, 0.72);
}

@media (min-width: 720px) {
  .wrap { padding-top: 40px; }
  h1 { font-size: 30px; }
}
@media print {
  body { background: #fff; }
  .actions, .btn, .link { display: none !important; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .wrap { max-width: none; padding: 0; }
}
