:root {
  --paper: #f3f6f4;
  --card: #ffffff;
  --ink: #10211c;
  --muted: #5d6b66;
  --line: #dce6e1;
  --green: #0b8f5b;
  --green-2: #e5f6ee;
  --ink-btn: #08261c;
  --gold: #b8862f;
  --danger: #b42318;
  --danger-bg: #fdeceb;
  --shadow: 0 14px 34px rgba(8, 38, 28, 0.1);
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --display: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(520px 220px at 100% -40px, rgba(11, 143, 91, 0.16), transparent 55%),
    #e7eeea;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: #cfeedd; }

#device {
  width: min(440px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background:
    radial-gradient(420px 180px at 100% -20px, rgba(11, 143, 91, 0.1), transparent 60%),
    var(--paper);
}

@media (min-width: 860px) {
  body { display: flex; justify-content: center; align-items: center; padding: 24px; }
  #device {
    height: min(900px, calc(100% - 48px));
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid #d5e2db;
    box-shadow: 0 24px 70px rgba(40, 30, 12, 0.16);
  }
}

#view {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top)) 16px 18px;
}
#device:has(#nav:not([hidden])) #view { padding-bottom: 12px; }
#device:has(#spin-fab:not([hidden])) #view { padding-bottom: 88px; }
#view:has(.help-screen) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 10px;
}

h1, h2, h3, p { margin: 0; }
h1 { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.045em; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }

.top, .sec-head, .plan-top, .person, .txn, .plan-row-top, .plan-row-pay {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.top { margin-bottom: 14px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
  display: grid;
  place-items: center;
  position: relative;
  padding: 0;
}
.icon-btn .ico { width: 20px; height: 20px; stroke: var(--green); }
.dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px white;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  background: var(--green-2);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}
.pill .ico { width: 14px; height: 14px; stroke: var(--green); }
.pill.wait { background: #f3efe6; color: var(--muted); }
.notice-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.notice-banner .ico { width: 18px; height: 18px; stroke: var(--green); flex: none; margin-top: 1px; }
.notice-banner p { font-size: 13px; line-height: 1.45; }
.trust-hero {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 20px;
  color: white;
  background: linear-gradient(145deg, #063d2c, #0b8f5b);
}
.trust-seal {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  flex: none;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
}
.trust-seal .ico { width: 28px; height: 28px; stroke: white; }
.trust-hero b { display: block; font-size: 18px; }
.trust-hero p { margin-top: 4px; color: rgba(255, 255, 255, 0.82); font-size: 13px; line-height: 1.4; }
.member-id { display: block; font-family: var(--display); font-size: 22px; letter-spacing: -0.03em; }
.check-list { margin-top: 6px; }
.check-list article {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.check-list b { display: block; font-size: 14px; }
.check-list p { color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.4; }
.check-list .menu-ico.ok { background: var(--green); }
.check-list .menu-ico.ok .ico { stroke: white; }
.sec { margin-top: 18px; }
.sec-head { margin-bottom: 8px; }
.eyebrow {
  margin: 0 0 2px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.lead, .fine, .muted { color: var(--muted); }
.lead { margin: 6px 0 14px; line-height: 1.45; font-size: 14px; }
.fine { font-size: 12px; line-height: 1.45; }
.stack { display: grid; gap: 10px; }
.mt { margin-top: 12px; }

.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.brand strong { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.04em; }
.brand em { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
.mark, .avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.mark {
  background: linear-gradient(160deg, #12a56a, #063d2c);
  color: white;
  font-size: 24px;
  letter-spacing: -0.06em;
}
.mark-img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: block;
  object-fit: cover;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}
.avatar { background: var(--green-2); color: var(--green); }
button.avatar { border: 0; padding: 0; }

.balance {
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(140px 90px at 100% 0%, rgba(255, 255, 255, 0.2), transparent 62%),
    linear-gradient(145deg, #063d2c 0%, #0b8f5b 72%);
  color: white;
  box-shadow: 0 16px 32px rgba(6, 61, 44, 0.22);
}
.balance .label, .balance .sub { color: rgba(255, 255, 255, 0.78); }
.balance .btn { background: white; color: #063d2c; }
.balance .btn.ghost { color: white; border-color: rgba(255, 255, 255, 0.45); background: transparent; }
.balance .label { font-size: 13px; font-weight: 600; }
.gold-num, .balance strong {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.04em;
}
.gold-num { display: block; margin: 4px 0 6px; font-size: 42px; line-height: 1; }
.sub { font-size: 13px; }

.plan, .note, .stats div, .qr-card, .plan-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.plan, .plan-row, .qr-card { padding: 14px; }
.plan.live { border-color: #b7e0c8; }
.stock-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.stock-head > div { min-width: 0; }
.stock-logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--green-2);
  color: var(--green);
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  font-weight: 800;
  font-size: 16px;
}
.stock-logo.text { letter-spacing: -0.04em; }
.stock-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.logo-picker {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #e4ece7;
  border-radius: 16px;
  background: #f7fbf8;
}
.logo-picker-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.logo-upload { cursor: pointer; margin: 0; }
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding-bottom: 4px;
}
.logo-pick {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 0;
  background: white;
  overflow: hidden;
  cursor: pointer;
}
.logo-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.logo-pick.on {
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green-2);
}
.logo-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.logo-preview input {
  flex: 1;
  min-width: 0;
}
.payout-seg { margin: 8px 0 14px; }
.plan.done { opacity: 0.85; }
.plan p, .plan-row p { color: var(--muted); font-size: 13px; margin-top: 3px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef3f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.tag.gold { background: #f8edd8; color: var(--gold); }
.tag.mint { background: var(--green-2); color: var(--green); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

.plan-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 14px;
}
.plan-split > div {
  background: #f3f7f5;
  border-radius: 14px;
  padding: 10px 12px;
  min-width: 0;
}
.plan-split span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.plan-split b {
  display: block;
  margin-top: 2px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.plan-split em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}
.plan-row-pay span, .payrow span { display: block; color: var(--muted); font-size: 11px; }
.plan-row-pay b, .payrow b { font-family: var(--display); font-size: 22px; font-weight: 800; }
.payrow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}
.arrow { color: var(--green); }

.bar { height: 6px; border-radius: 99px; background: #efeae2; overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; background: var(--green); }
.timer { margin-top: 8px; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--green); font-size: 13px; }

.note {
  padding: 12px 14px;
  background: #f4f8f2;
  color: #24523a;
  font-size: 13px;
  line-height: 1.45;
}
.empty {
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed #c9d8d0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  background: transparent;
}

.row, .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips { margin-top: 12px; }
.row .btn { width: auto; flex: 1; }
.btn {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 13px 14px;
  font-weight: 650;
  background: var(--green);
  color: white;
  text-align: center;
  text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.small { width: auto; display: inline-flex; padding: 8px 12px; border-radius: 999px; font-size: 13px; }
.btn.ok { background: var(--green-2); color: var(--green); }
.btn.danger { background: var(--danger-bg); color: var(--danger); }
.chip {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 650;
  font-size: 13px;
}
.link { background: none; border: 0; padding: 0; color: var(--green); font-weight: 700; }
.switch { margin-top: 14px; color: var(--muted); text-align: center; }

label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 13px; font-weight: 650; }
label span, .hint { display: block; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 12px; font-weight: 500; }
input, textarea, select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  padding: 13px 12px;
  font-size: 16px;
  outline: none;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 2px solid #8dceb0;
  outline-offset: 1px;
}
.check { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.check input { width: 18px; height: 18px; padding: 0; }

.seg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: #e7eeea;
  margin-bottom: 14px;
}
.seg button {
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  padding: 9px 6px;
}
.seg button.on { background: white; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stats div { padding: 12px; }
.stats b { display: block; font-family: var(--display); font-size: 20px; font-weight: 800; word-break: break-word; }
.stats span { color: var(--muted); font-size: 12px; }

.person, .txn {
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  background: none;
  border-radius: 0;
  box-shadow: none;
}
.person b, .txn b { display: block; font-size: 14px; }
.person p, .txn p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.plus { color: var(--green); }
.minus { color: var(--danger); }
.strike { text-decoration: line-through; color: var(--muted); }

.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 16px;
  margin-bottom: 4px;
}
.qr-card img { width: min(230px, 70%); height: auto; border-radius: 12px; background: white; }
.upi-line { margin: 0; font-weight: 700; word-break: break-all; }
.upi-card {
  margin: -4px 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--green-2);
  border: 1px solid #b7e0c8;
}
.upi-card span { color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.upi-card b { display: block; margin-top: 2px; font-size: 16px; }
.upi-card p { margin-top: 2px; color: #3d6b52; font-size: 13px; word-break: break-all; }

.pulse {
  width: 8px; height: 8px; border-radius: 99px; background: var(--green); display: inline-block;
  box-shadow: 0 0 0 0 rgba(14, 122, 69, 0.45);
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } }

#nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin: 0 10px calc(8px + env(safe-area-inset-bottom));
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d7e4dc;
  box-shadow: var(--shadow);
}
#nav[hidden] { display: none; }
.nav-btn {
  border: 0;
  background: transparent;
  color: #7b8a84;
  display: grid;
  justify-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 0 4px;
  border-radius: 12px;
}
.nav-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav-btn.on { color: var(--green); background: var(--green-2); }
#spin-fab {
  position: absolute;
  z-index: 15;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px rgba(11, 143, 91, 0.34);
}
#spin-fab[hidden] { display: none; }
#spin-fab svg {
  width: 28px;
  height: 28px;
  stroke: white;
  fill: none;
  stroke-width: 1.8;
  transform-origin: center;
  transform-box: fill-box;
  animation: nav-spin 2.6s linear infinite;
}
@keyframes nav-spin { to { transform: rotate(360deg); } }

#modal { position: absolute; inset: 0; z-index: 20; display: none; }
#modal.open { display: block; }
.backdrop { position: absolute; inset: 0; background: rgba(28, 24, 18, 0.46); border: 0; width: 100%; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: #ffffff;
  animation: sheet 0.28s ease;
}
.handle { width: 40px; height: 4px; border-radius: 4px; margin: 6px auto 12px; background: #d5e0da; }
@keyframes sheet { from { transform: translateY(16px); } to { transform: none; } }

#toasts {
  position: absolute;
  left: 12px; right: 12px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink-btn);
  color: #f6f1e6;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 650;
}

.center-state {
  min-height: 52vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  color: var(--muted);
}
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid #e6dfd4;
  border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.screen { animation: rise 0.28s ease; }
.screen.auth { margin: auto 0; width: 100%; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

#device.intro-mode #view {
  padding: 0;
  overflow: hidden;
}
.intro-screen {
  position: relative;
  min-height: 100%;
  height: 100%;
  background: #04281d;
  color: #fff;
  animation: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.intro-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  background: #04281d;
}
.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.04);
  transform-origin: center center;
  background: #04281d;
}
.intro-video.off { opacity: 0; pointer-events: none; }
.intro-watermark-cover {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 11%;
  z-index: 2;
  background: linear-gradient(180deg, rgba(4, 40, 29, 0) 0%, #04281d 50%, #04281d 100%);
  pointer-events: none;
}
.intro-sound {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  left: 14px;
  z-index: 5;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.intro-sound[hidden] { display: none !important; }
.intro-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  place-content: center;
  place-items: center;
  gap: 12px;
  text-align: center;
  padding: 32px;
  background:
    radial-gradient(420px 240px at 50% 28%, rgba(11, 143, 91, 0.45), transparent 60%),
    linear-gradient(180deg, #0b8f5b 0%, #04281d 72%);
}
.intro-fallback.on { display: grid; }
.intro-fallback img {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}
.intro-fallback strong {
  font-size: 34px;
  letter-spacing: -0.04em;
}
.intro-fallback p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.45;
}
.intro-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(4, 40, 29, 0.15) 0%, rgba(4, 40, 29, 0.2) 42%, rgba(4, 40, 29, 0.92) 100%);
  pointer-events: none;
}
.intro-skip {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  z-index: 5;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.intro-bottom {
  position: relative;
  z-index: 4;
  padding: 24px 18px calc(28px + env(safe-area-inset-bottom));
}
.intro-bottom .eyebrow { color: #9fe0c2; }
.intro-bottom h1 {
  color: #fff;
  font-size: 32px;
  margin: 6px 0 16px;
}
.intro-bottom .row { gap: 10px; }
.intro-bottom .btn.ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

#success {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: rgba(243, 246, 244, 0.82);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
#success[hidden] { display: none; }
#success p {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  opacity: 0;
}
.success-mark {
  width: 96px;
  height: 96px;
  position: relative;
}
.success-mark svg { width: 100%; height: 100%; overflow: visible; }
.success-mark circle {
  fill: #e8f6ee;
  stroke: #0e7a45;
  stroke-width: 2;
}
.success-mark path {
  fill: none;
  stroke: #0e7a45;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
}
.burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0;
}
#success.play .success-mark { animation: pop 0.5s cubic-bezier(0.2, 1.45, 0.4, 1); }
#success.play path { animation: draw 0.38s 0.22s ease forwards; }
#success.play p { animation: rise 0.4s 0.28s ease forwards; }
#success.play .burst { animation: burst 0.75s ease-out forwards; }
@keyframes pop {
  0% { transform: scale(0.35); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes burst {
  0% { opacity: 1; transform: scale(0.4); box-shadow: 0 0 0 #0e7a45; }
  70% { opacity: 1; }
  100% {
    opacity: 0;
    transform: scale(1);
    box-shadow:
      46px -38px 0 0 #0e7a45,
      -50px -28px 0 0 #9a6b24,
      8px -58px 0 0 #0e7a45,
      -18px 52px 0 0 #9a6b24,
      54px 22px 0 0 #0e7a45,
      -54px 16px 0 0 #1b8a52,
      28px 48px 0 0 #0e7a45,
      -36px -54px 0 0 #c4a15a;
  }
}
@media (prefers-reduced-motion: reduce) {
  .screen, #success.play .success-mark, #success.play p, #success.play .burst { animation: none; }
  #success.play path { animation: none; stroke-dashoffset: 0; }
  #success.play p, #success.play .success-mark { opacity: 1; }
}

.spin-card {
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}
.spin-card b { display: block; margin: 2px 0; font-size: 16px; }
.spin-card p { color: var(--muted); font-size: 12px; line-height: 1.4; }
.spin-card span {
  flex: none;
  background: var(--green);
  color: white;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
}
.wheel-wrap { position: relative; width: 280px; height: 280px; margin: 8px auto 16px; }
.wheel-pointer {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: -2px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 18px solid #063d2c;
}
.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  border: 8px solid white;
  box-shadow: var(--shadow);
  transition: transform 4.2s cubic-bezier(0.12, 0.7, 0.08, 1);
}
.wheel span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  margin-left: -36px;
  margin-top: -9px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.wheel span.on-dark { color: #f6f1e6; }
@media (prefers-reduced-motion: reduce) {
  .wheel { transition: none; }
  #spin-fab svg { animation: none; }
}

pre.lookup {
  white-space: pre-wrap;
  word-break: break-word;
  background: #17241c;
  color: #e7f6ee;
  border-radius: 14px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
}

.home .sec { margin-top: 28px; }
.quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.strip div { padding: 14px 6px; text-align: center; }
.strip div + div { box-shadow: inset 1px 0 0 var(--line); }
.strip b {
  display: block;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.strip span { color: var(--muted); font-size: 11px; }
.quick button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 16px;
  padding: 12px 4px 10px;
  display: grid;
  justify-items: center;
  gap: 4px;
  font-weight: 700;
}
.quick .ico { width: 22px; height: 22px; stroke: var(--green); }
.quick span { font-size: 12px; }

.steps { display: grid; gap: 8px; }
.step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}
.step > b {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--green-2);
  color: var(--green);
  display: grid;
  place-items: center;
  flex: none;
  font-size: 13px;
}
.step p { color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.4; }

.menu {
  margin-top: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.menu-label {
  margin: 0;
  padding: 12px 14px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.menu-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: white;
  text-align: left;
}
.menu-ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--green-2);
  display: grid;
  place-items: center;
  flex: none;
}
.ico { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.menu-ico .ico, .mark.sm .ico { stroke: var(--green); }
.mark.sm { width: 46px; height: 46px; background: var(--green-2); color: var(--green); }
.back { display: inline-flex; align-items: center; gap: 2px; }
.back .ico { width: 18px; height: 18px; stroke: var(--green); }
.page-head { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.page-head h1 { font-size: 26px; }
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
.screen.fill { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.help-screen {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.chat-log {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding-bottom: 8px;
}
.composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: auto;
  flex: none;
  padding: 10px 0 2px;
  background: var(--paper);
  position: sticky;
  bottom: 0;
  z-index: 3;
}
.bubble {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 16px;
  line-height: 1.4;
}
.bubble p { margin: 0; font-size: 14px; }
.bubble small { display: block; margin-top: 4px; font-size: 11px; opacity: 0.75; }
.bubble.me { align-self: flex-end; background: var(--green); color: white; border-bottom-right-radius: 5px; }
.bubble.them { align-self: flex-start; background: white; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bubble img {
  display: block;
  max-width: 100%;
  width: min(220px, 70vw);
  border-radius: 12px;
  margin-bottom: 6px;
  background: #0b1f18;
}
.composer-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.composer input { flex: 1; width: 100%; }
.composer .btn { width: 48px; height: 48px; padding: 0; border-radius: 14px; flex: none; }
.composer .ico { stroke: white; width: 20px; height: 20px; }
.attach {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
  display: grid;
  place-items: center;
  flex: none;
  cursor: pointer;
  position: relative;
}
.attach .ico { stroke: var(--green); width: 20px; height: 20px; }
.attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.shot-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: white;
}
.shot-preview img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
}
.shot-preview span { flex: 1; font-size: 12px; color: var(--muted); }
.shot-preview button {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-weight: 700;
  font-size: 12px;
  padding: 4px;
}
.chips .chip { max-width: 100%; white-space: normal; text-align: left; height: auto; }
.menu-row:last-child { border-bottom: 0; }
.menu-row b { display: block; font-size: 14px; }
.menu-row > span:not(.menu-ico) { flex: 1; min-width: 0; }
.menu-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.menu-row em { font-style: normal; color: #8aa094; font-size: 22px; line-height: 1; }

.admin-tabs {
  display: flex;
  overflow: auto;
  margin-bottom: 12px;
}
.admin-tabs button { flex: 1 0 auto; white-space: nowrap; }
.admin-stats { margin-bottom: 4px; }
.admin-main .sec:first-child { margin-top: 0; }

@media (max-width: 420px) {
  .quick span { font-size: 11px; }
  .stats b { font-size: 16px; }
}

@media (min-width: 980px) {
  #device.desk {
    width: min(1120px, calc(100% - 32px));
  }
  #device.desk .admin-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }
  #device.desk .admin-tabs {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
  }
  #device.desk .admin-tabs button { text-align: left; padding-left: 12px; }
  #device.desk .plan-grid,
  #device.desk .user-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  #device.desk .user-grid .person {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    background: white;
  }
  #device.desk .admin-main form .row .btn { width: auto; }
}
