:root {
  --brand: #27306B;
  --brand-soft: #E9EBF7;
  --gold: #F5B301;
  --ok: #0F7B6C;
  --ok-soft: #E1F4F1;
  --bad: #B3261E;
  --warn: #7A5200;
  --warn-soft: #FFF4D6;
  --bg: #F4F5F9;
  --card: #FFFFFF;
  --border: #DCDFEA;
  --text: #1B1E2E;
  --grey: #636A80;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.ver { font-size: 11px; font-weight: 400; opacity: 0.7; margin-left: -4px; align-self: flex-end; padding-bottom: 3px; }
.bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #6D28D9, #2563EB); color: #fff; /* same as the Android app's header */
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  font-size: 19px; font-weight: 700;
}
.logo { width: 32px; height: 32px; border-radius: 9px; background: #fff; padding: 2px; box-sizing: border-box; } /* thin white border round the icon */
main { max-width: 560px; margin: 0 auto; padding: 8px 16px calc(env(safe-area-inset-bottom) + 32px); }
.section { color: var(--grey); font-size: 14px; font-weight: 700; margin: 20px 2px 6px; display: flex; justify-content: space-between; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-top: 8px; }
.card.warn { background: var(--warn-soft); border-color: var(--warn-soft); color: var(--warn); }
h2 { font-size: 18px; margin: 0 0 4px; }
.muted { color: var(--grey); font-size: 14px; margin: 4px 0; }
.small { font-size: 13px; }
label { display: block; color: var(--grey); font-size: 13px; font-weight: 700; margin: 12px 0 4px; }
input {
  width: 100%; font: inherit; font-size: 17px; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; background: #fff;
}
input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
button {
  width: 100%; font: inherit; font-weight: 700; border-radius: 10px; padding: 12px; margin-top: 12px;
  border: 1px solid var(--brand); background: #fff; color: var(--brand); cursor: pointer;
}
button.primary { background: var(--brand); color: #fff; }
button.big { padding: 18px; font-size: 18px; }
button.danger { border-color: var(--bad); color: var(--bad); }
button:disabled { opacity: .55; }
.err { color: var(--bad); font-weight: 700; font-size: 14px; margin-top: 8px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--grey); margin-top: 2px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #B9BDCC; flex: none; }
.dot.on { background: var(--ok); }
.seg { display: flex; gap: 8px; }
.seg button { margin-top: 8px; }
.seg button.sel { background: var(--brand-soft); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.row:first-child { border-top: 0; }
.amt { font-weight: 700; font-size: 17px; }
.right { text-align: right; color: var(--grey); font-size: 13px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 9px; margin-left: 6px; background: var(--warn-soft); color: var(--warn); vertical-align: 2px; }
.pill { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); }
.test-pill { display: inline-block; margin: 8px 0 0; }

/* Owner Active Status: green blinking light = owner phone online, red fire ball = offline */
.card.owner { display: flex; align-items: center; gap: 14px; }
.light { position: relative; width: 22px; height: 22px; border-radius: 50%; flex: none; margin: 4px; }
.light.wait { background: radial-gradient(circle, #E5E7EB, #9CA3AF); }
.light.live { background: #22C55E; }
.light.live::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%; background: rgba(34, 197, 94, 0.35);
  animation: owner-pulse 1.2s ease-out infinite;
}
.light.fire { background: radial-gradient(circle at 40% 35%, #FDE047, #F97316 55%, #DC2626); box-shadow: 0 0 8px rgba(249, 115, 22, 0.6); }
@keyframes owner-pulse { from { transform: scale(0.5); opacity: 1; } to { transform: scale(1.1); opacity: 0; } }
.owner-state { font-size: 18px; font-weight: 800; color: var(--grey); }
.owner-state.ok { color: var(--ok); }
.owner-state.bad { color: var(--bad); }

/* Access: trial banner, Waiting / Blocked, Pay and Upgrade */
.card.dark { background: #0B0B14; border-color: #0B0B14; color: #fff; }
.card.dark p { color: rgba(255, 255, 255, 0.8); }
.card.banner { background: var(--brand-soft); border-color: var(--brand-soft); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
button.mini { width: auto; margin: 0 0 0 auto; padding: 6px 12px; font-size: 14px; }
button.link { border: none; background: none; color: var(--grey); }
.pay-amount { font-size: 34px; font-weight: 800; color: var(--brand); }
img.qr { display: block; width: 100%; max-width: 360px; margin: 12px auto; background: #fff; border-radius: 12px; }
.pill.warn-pill { background: var(--warn-soft); color: var(--warn); }
button.price-box { display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: linear-gradient(135deg, #0EA5E9, #6366F1); color: #fff; border: none; border-radius: 16px; padding: 14px 16px; margin-top: 10px; }
button.price-box.best { background: linear-gradient(135deg, #6D28D9, #2563EB); }
.pb-name { font-size: 14px; opacity: 0.9; }
.pb-price { font-size: 30px; font-weight: 800; }
.pb-per { font-size: 13px; opacity: 0.85; }

/* Google sign-in (associates) */
.gbtn { display: flex; justify-content: center; margin: 12px 0 4px; min-height: 44px; }
.signed { color: var(--ok); margin: 12px 0 4px; }
.who { margin-left: auto; min-width: 0; max-width: 55%; display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; font-weight: 400; line-height: 1.3; }
.who b, .who span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who b { font-size: 13px; font-weight: 600; }
.who span { margin-top: 3px; padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); }

/* Refer and earn card (violet, as in the Android app) */
.card.refer { background: linear-gradient(135deg, #4C1D95, #6D28D9 55%, #DB2777); color: #fff; border: none; }
.card.refer .small { color: #EDE9FE; }
.refer-tag { font-size: 12px; font-weight: 600; letter-spacing: 1px; color: #FBCFE8; }
.refer-title { font-size: 19px; font-weight: 700; line-height: 1.3; margin: 4px 0 6px; }
.refer-code { display: flex; gap: 8px; margin: 12px 0 8px; }
.refer-code span { flex: 1; border: 1.5px dashed rgba(255, 255, 255, 0.6); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; letter-spacing: 2px; padding: 8px; }
.refer-code button { width: auto; margin: 0; padding: 8px 14px; background: rgba(255, 255, 255, 0.2); color: #fff; border: none; }
.refer-share { background: #fff; color: #5B21B6; border: none; font-weight: 700; }
.refer-stats { margin-top: 8px; }

/* Money the owner sent, shared by choice */
.amt.out { color: #DC2626; }
.tag.out { background: #FEE2E2; color: #DC2626; }

/* Admin announcement card */
.ann-link { display: inline-block; margin: 8px 12px 0 0; font-weight: 600; color: var(--brand); }
.ann-img { display: block; width: 100%; max-height: 360px; object-fit: contain; border-radius: 12px; margin: 8px 0; background: rgba(0,0,0,0.04); }

/* Top right Sign in and its sheet */
.signin { margin: 0; width: auto; padding: 7px 16px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,0.8); background: rgba(255,255,255,0.15); color: #fff; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; }
.sheet-bg { position: fixed; inset: 0; z-index: 10; background: rgba(15,23,42,0.45); display: flex; align-items: flex-start; justify-content: center; padding: 70px 16px 16px; }
.sheet { width: 100%; max-width: 380px; background: var(--card, #fff); border-radius: 22px; padding: 20px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.sheet h2 { margin: 0; }
.sheet .gbtn { margin: 8px 0; }

/* Header tools: announcements, settings, sign out */
.who { flex-direction: row; align-items: center; gap: 6px; max-width: 70%; }
.who-id { min-width: 0; display: flex; flex-direction: column; align-items: flex-end; }
.who-id b, .who-id span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hicon { position: relative; margin: 0; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: none; background: rgba(255,255,255,0.18); color: #fff; font-size: 17px; flex: none; }
.reddot { position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #EF4444; border: 1.5px solid #fff; }
.who { position: relative; }
.avatar-btn { order: 2; flex: none; width: auto; margin: 0; padding: 0; border: none; background: none; border-radius: 50%; cursor: pointer; }
.pmenu { position: absolute; top: calc(100% + 10px); right: 0; z-index: 20; min-width: 210px; max-width: 80vw; padding: 14px; border-radius: 14px;
  background: #fff; color: #1B1E2E; box-shadow: 0 12px 32px rgba(20, 24, 60, 0.25); display: flex; flex-direction: column; align-items: stretch; text-align: left; }
.who .pmenu b { font-size: 14px; }
.who .pmenu span { margin: 2px 0 0; padding: 0; background: none; color: #636A80; font-size: 12px; border-radius: 0; }
.pmenu { padding: 6px; }
.pmenu-head { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid #ECEEF4; display: flex; flex-direction: column; }
.mitem { display: flex; align-items: center; gap: 10px; margin: 0; width: 100%; padding: 10px; border: none; border-radius: 10px; background: none; color: #1B1E2E; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.mitem:hover, .mitem:active { background: #F2F3F8; }
.mitem svg { width: 18px; height: 18px; flex: none; }
.signout { color: #C62828; }
.signout:hover, .signout:active { background: #FFF1F1; }
.sheet:not(.center) { align-items: stretch; text-align: left; }
.sheet .danger { margin-top: 14px; }

/* Joined page: one compact card, payments right below */
.live-card { padding: 12px 14px; }
.live-top { display: flex; flex-direction: column; gap: 2px; }
.live-top .shop { font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-line { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.owner-line .light { width: 14px; height: 14px; margin: 0 4px 0 0; }
.owner-line .owner-state { font-size: 14px; }
.live-card .big { margin-top: 10px; }
.refresh { display: inline-flex; width: 28px; height: 28px; margin: 0 0 0 4px; padding: 0; align-items: center; justify-content: center; border: none; border-radius: 50%; background: none; color: var(--brand); font-size: 17px; vertical-align: middle; }
.refresh.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ann-btn { display: block; margin-top: 10px; padding: 10px; border-radius: 12px; background: rgba(109,40,217,0.1); color: var(--brand); font-weight: 700; text-align: center; text-decoration: none; }

/* Wide screens: Refer and earn | page | Announcements */
@media (min-width: 1100px) {
  main.wide { max-width: 1240px; }
  .cols { display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
  .col-left, .col-right { position: sticky; top: 76px; }
}
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; order: 2; object-fit: cover; border: 2px solid rgba(255,255,255,0.85); background: rgba(255,255,255,0.22); color: #fff; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.owner-text { flex: 1; min-width: 0; }
.test-btn { width: auto; margin: 0 0 0 8px; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; background: rgba(109,40,217,0.1); color: var(--brand); border: none; flex: none; }
.test-btn.activate { background: #F59E0B; color: #fff; }

/* Logo and name in the bar link to the home page. */
.home-link { display: flex; align-items: center; gap: inherit; color: inherit; text-decoration: none; }
