/* The "Gói Nếp" screen (goi.js): a full screen over the app like the shop, the tokens of pop.css, light and dark alike. */
html.gn-on { overflow: hidden; }
html.gn-on .toast { bottom: calc(118px + env(safe-area-inset-bottom)); }
.gn { position: fixed; inset: 0; z-index: 62; overflow: hidden auto; overscroll-behavior: contain; color: var(--ink);
  background-color: var(--bg); background-image: var(--paper-grain); animation: gn-in var(--t-page, 180ms) var(--ease-out, ease-out); font-family: var(--font); }
.gn * { box-sizing: border-box; }
.gn button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
.gn .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gn-in { --gn-bar: 56px; max-width: 920px; min-height: 100%; margin: 0 auto; padding: 0 16px; display: flex; flex-direction: column; }
.gn-body { flex: 1; padding-bottom: 28px; }

/* the bar: X and the name, frosted when the page runs under it */
.gn-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; height: calc(var(--gn-bar) + env(safe-area-inset-top)); margin: 0 calc(50% - 50vw);
  padding: env(safe-area-inset-top) calc(50vw - 50% + 16px) 0 calc(50vw - 50% + 8px); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.gn-x { position: relative; z-index: 1; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--ink); }
.gn-x svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.gn-x:active { background: var(--fill); }
.gn-top h1 { position: absolute; left: 60px; right: 60px; pointer-events: none; margin: 0; text-align: center; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }

.gn-hero { display: flex; align-items: center; gap: 10px; margin: 6px 0 22px; padding-left: 4px; }
.gn-hero div { flex: 1; min-width: 0; }
.gn-hero h2 { margin: 0; font-size: 27px; line-height: 34px; font-weight: 800; letter-spacing: -.03em; }
.gn-hero p { margin: 6px 0 0; font-size: 15px; line-height: 21px; color: var(--ink2); }
.gn-hero img { flex: none; width: 96px; height: 86px; object-fit: contain; margin: -6px -6px 0 0; animation: gn-hop .7s cubic-bezier(.3, 1.5, .5, 1) .1s backwards; }

/* ---------- plan cards ---------- */
.gn-plans { display: grid; gap: 12px; }
.gn-plan { position: relative; padding: 18px; background: var(--card); border-radius: var(--r-card); box-shadow: var(--sh-card), inset 0 0 0 1px var(--rim);
  cursor: pointer; transition: box-shadow .2s var(--ease-out); animation: gn-up .42s var(--ease-out) backwards; outline: none; }
.gn-plan:nth-child(2) { animation-delay: .06s; }
.gn-plan.gn-feat { background: linear-gradient(180deg, color-mix(in srgb, var(--honey) 9%, var(--card)), var(--card) 46%); }
.gn-plan.on { box-shadow: var(--sh-card), inset 0 0 0 2px var(--acc); }
.gn-plan:focus-visible { box-shadow: var(--sh-card), inset 0 0 0 2px var(--acc), 0 0 0 4px color-mix(in srgb, var(--acc) 30%, transparent); }
.gn-p-top { display: flex; align-items: flex-start; gap: 12px; }
.gn-radio { flex: none; position: relative; width: 24px; height: 24px; margin-top: 3px; border-radius: 50%; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink3) 55%, transparent);
  transition: background-color .18s, box-shadow .18s; }
.gn-radio::after { content: ""; position: absolute; inset: 7.5px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform .22s cubic-bezier(.3, 1.6, .5, 1); }
.on > .gn-p-top .gn-radio { background: var(--acc-btn); box-shadow: none; }
.on > .gn-p-top .gn-radio::after { transform: scale(1); }
.gn-p-name { flex: 1; min-width: 0; }
.gn-p-name b, .gn-p-price b { display: block; font-size: 19px; line-height: 26px; font-weight: 700; letter-spacing: -.02em; }
.gn-p-price { flex: none; text-align: right; }
.gn-p-price b { font-weight: 800; font-variant-numeric: tabular-nums; }
.gn-p-name small, .gn-p-price small { display: block; font-size: 14px; line-height: 19px; color: var(--ink3); font-weight: 500; font-variant-numeric: tabular-nums; }
.gn-flip { display: inline-block; animation: gn-flip .32s var(--ease-out); }
.gn-p-price b.gn-flip, .gn-p-name small.gn-flip { display: block; }

.gn-seal { position: absolute; top: -9px; right: 18px; padding: 3px 7px 4px; border-radius: 6px; background: var(--red-btn); color: #fff;
  font: 700 12.5px/1 'Pretendard Variable', Pretendard, var(--font); letter-spacing: .04em; transform: rotate(4deg);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45), inset 0 0 0 3px var(--red-btn); animation: gn-stamp .3s cubic-bezier(.5, 0, .9, .5) .35s backwards; }

/* the term switch */
.gn-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0 0 12px; padding: 4px; background: var(--fill); border-radius: 16px; }
.gn .gn-seg button { min-height: 50px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--ink2); line-height: 1.15; transition: background-color .18s, box-shadow .18s, color .18s; }
.gn-seg button small:empty { display: none; }
.gn-seg button small { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 700; color: var(--acc-ink); }
.gn .gn-seg button.on { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(70, 58, 30, .08), 0 4px 10px -6px rgba(70, 58, 30, .3); }
html[data-theme="dark"] .gn .gn-seg button.on { background: #343932; box-shadow: none; }
.gn-save { margin: 10px 2px 0; min-height: 19px; font-size: 14px; line-height: 19px; color: var(--ink2); }
.gn-save b { color: var(--acc-ink); font-weight: 700; font-variant-numeric: tabular-nums; }

.gn-perks { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 9px; }
.gn-perks li { display: flex; gap: 10px; font-size: 15.5px; line-height: 22px; }
/* the perk the screen was opened for (goiOpen from), first and lightly lit */
.gn-perks li.gn-hi { margin: -4px -8px; padding: 4px 8px; border-radius: 10px; background: color-mix(in srgb, var(--honey) 16%, var(--card)); }
.gn-perks em { font-style: normal; font-weight: 700; }
.gn-tick { flex: none; width: 18px; height: 18px; margin-top: 2px; fill: none; stroke: var(--acc); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- the table: three columns side by side, the picked one on a green band that slides ---------- */
.gn-sec { margin: 30px 4px 12px; font-size: 19px; line-height: 26px; font-weight: 700; letter-spacing: -.025em; }
.gn-sec-p { margin: -6px 4px 12px; font-size: 14.5px; line-height: 20px; color: var(--ink2); }
.gn-cmp { --lw: 0%; --cw: 33.3333%; --band: color-mix(in srgb, var(--acc) 11%, var(--card));
  position: relative; padding: 1px 1px 0; background: var(--card); border-radius: var(--r-card); box-shadow: var(--sh-card), inset 0 0 0 1px var(--rim); }
html[data-theme="dark"] .gn-cmp { --band: color-mix(in srgb, var(--acc) 15%, var(--card)); }
.gn-cmp-head { position: sticky; top: calc(var(--gn-bar) + env(safe-area-inset-top)); z-index: 3; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--card); border-radius: var(--r-card) var(--r-card) 0 0; transition: box-shadow .2s, border-radius .2s; }
.gn-cmp-head.stuck { border-radius: 0; box-shadow: 0 1px 0 var(--line), 0 10px 16px -12px rgba(40, 32, 16, .5); }
html[data-theme="dark"] .gn-cmp-head.stuck { box-shadow: 0 1px 0 var(--line), 0 10px 18px -10px rgba(0, 0, 0, .75); }
.gn-cmp-head::after { content: ""; position: absolute; left: 0; right: 0; top: calc(100% + 1px); height: 24px; pointer-events: none; opacity: 0;
  background: linear-gradient(var(--card) 45%, color-mix(in srgb, var(--card) 0%, transparent)); transition: opacity .15s; }
.gn-cmp-head.stuck::after { opacity: 1; }
.gn-cmp-head::before, .gn-band { content: ""; position: absolute; left: calc(var(--lw) + var(--cw) * var(--pick, 1) + 4px); width: calc(var(--cw) - 8px); background: var(--band);
  transition: left .38s var(--ease-out); pointer-events: none; }
.gn-cmp-head::before { top: 8px; bottom: 0; border-radius: 16px 16px 0 0; }
.gn-band { top: 0; bottom: 8px; border-radius: 0 0 16px 16px; }
.gn-h0 { display: none; }
.gn .gn-h { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0;
  padding: 16px 4px 12px; text-align: center; }
.gn .gn-h[disabled] { cursor: default; }
.gn-h b { font-size: 15px; line-height: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--ink2); transition: color .2s; }
.gn-h small { font-size: 12.5px; line-height: 17px; font-weight: 600; color: var(--ink3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gn-h.on b { color: var(--acc-ink); }
.gn-cmp-rows { position: relative; padding-bottom: 8px; }
.gn-row { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.gn-l { grid-column: 1 / -1; position: relative; z-index: 1; padding: 12px 16px 6px; background: var(--card); font-size: 13.5px; line-height: 19px; }
.gn-l b { font-weight: 700; color: var(--ink); }
.gn-l small { display: block; color: var(--ink3); font-size: 12.5px; line-height: 17px; font-weight: 500; }
.gn-row.gn-hi .gn-l { background: color-mix(in srgb, var(--honey) 16%, var(--card)); }
.gn-row.gn-hi .gn-l b { color: var(--honey-ink); }
.gn-c { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 6px 10px; text-align: center;
  font-size: 13.5px; line-height: 18px; font-weight: 500; color: var(--ink2); text-wrap: balance; transition: color .2s; }
.gn-c.on { color: var(--ink); font-weight: 700; }
.gn-c .gn-tick { width: 20px; height: 20px; margin: 0; }
.gn-c:not(.on) .gn-tick { stroke: color-mix(in srgb, var(--acc) 70%, var(--ink3)); }
.gn-no { width: 20px; height: 20px; fill: none; stroke: var(--ink3); stroke-width: 2.4; stroke-linecap: round; opacity: .55; }

/* ---------- spare minutes, the centre ---------- */
.gn-mins { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gn .gn-min { text-align: left; background: var(--card); border-radius: 20px; box-shadow: var(--sh-card), inset 0 0 0 1px var(--rim); padding: 14px 16px 15px; }
.gn-min b { display: block; font-size: 22px; line-height: 28px; font-weight: 800; letter-spacing: -.03em; }
.gn-min b span { margin-left: 4px; font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--ink2); }
.gn-min-p { display: block; margin-top: 8px; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gn-min small { display: block; font-size: 13px; color: var(--ink3); font-weight: 500; font-variant-numeric: tabular-nums; }
.gn-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 4px 0; font-size: 14px; line-height: 20px; color: var(--ink2); }
.gn-note svg { flex: none; width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: var(--ink3); stroke-width: 2; stroke-linecap: round; }
.gn-org { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 14px 14px 14px 18px; background: var(--card); border-radius: var(--r-card);
  box-shadow: var(--sh-card), inset 0 0 0 1px var(--rim); }
.gn-org div { flex: 1; min-width: 0; }
.gn-org b { display: block; font-size: 16px; line-height: 22px; font-weight: 700; }
.gn-org small { display: block; font-size: 14px; line-height: 19px; color: var(--ink3); }
.gn .gn-org-go { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--r-chip); background: var(--acc-soft);
  color: var(--acc-ink); font-size: 15px; font-weight: 700; text-decoration: none; }

/* ---------- the buy button, stuck to the foot ---------- */
.gn-dock { position: sticky; bottom: 0; z-index: 4; margin: 0 calc(50% - 50vw); padding: 12px calc(50vw - 50% + 16px) calc(14px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.gn-dock-in { max-width: 480px; margin: 0 auto; }
.gn .gn-buy { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 100%; min-height: 62px; padding: 8px 20px;
  border-radius: var(--r-btn); background: var(--acc-btn); color: #fff; box-shadow: var(--sh-btn); transition: scale var(--t-press, 90ms) var(--ease-out); }
.gn .gn-buy:active { scale: .98; }
.gn-buy b { font-size: 17px; line-height: 22px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.gn-buy small { padding: 1px 9px 2px; border-radius: var(--r-chip); background: rgba(255, 255, 255, .2); font-size: 12.5px; line-height: 17px; font-weight: 700; }
.gn-dock p { margin: 8px 0 0; text-align: center; font-size: 13px; line-height: 18px; color: var(--ink3); }
.gn-qr { display: inline-block; width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; fill: currentColor; }

/* ---------- the ways in: Hôm nay's top bar, the card on Tôi, the shop's foot ---------- */
.gn-sprout { flex: none; width: 22px; height: 22px; }
html.pop .topbar .tb-goi, .tb-goi { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 3px; height: 36px; padding: 0 12px 0 8px; border: 0;
  font: inherit; font-size: 14px; font-weight: 800; color: var(--acc-ink, #2E7D3A); border-radius: var(--r-chip, 999px); cursor: pointer;
  background: var(--card); box-shadow: var(--sh-card), inset 0 0 0 1px var(--rim, transparent); }
.tb-goi .gn-sprout { width: 21px; height: 21px; margin-top: -1px; }
.tb-goi:active { scale: .94; }
/* a computer: the pills sit in the sidebar card (pc.js); they drop their words so the button fits beside them */
html.pop .pc-me .tb-stats:has(.tb-goi) .rd-stat small { display: none; }
html.pop .pc-me .tb-goi span { display: none; }
html.pop .pc-me .tb-goi { width: 38px; padding: 0; height: 38px; background: var(--card2); box-shadow: inset 0 0 0 1px var(--line); }
.gn-card { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 12px; padding: 16px 12px 16px 18px; border: 0; text-align: left; color: var(--ink);
  font: inherit; cursor: pointer; overflow: hidden; border-radius: var(--r-card, 20px);
  background: linear-gradient(135deg, color-mix(in srgb, var(--honey) 22%, var(--card)), color-mix(in srgb, var(--acc) 12%, var(--card)));
  box-shadow: var(--sh-card), inset 0 0 0 1px color-mix(in srgb, var(--honey) 30%, transparent); }
.gn-card-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.gn-card-tx small { display: flex; align-items: center; gap: 5px; font-size: 13.5px; line-height: 19px; font-weight: 700; color: var(--honey-ink); }
.gn-card-tx small .gn-sprout { width: 17px; height: 17px; }
.gn-card-tx b { margin-top: 2px; font-size: 20px; line-height: 26px; font-weight: 800; letter-spacing: -.02em; }
.gn-card-tx > span { margin-top: 2px; font-size: 14px; line-height: 19px; color: var(--ink2); }
.gn-card-go { display: inline-flex; align-items: center; gap: 2px; margin-top: 12px; min-height: 36px; padding: 0 10px 0 14px; border-radius: var(--r-chip, 999px);
  background: var(--acc-btn); color: #fff; font-style: normal; font-size: 14.5px; font-weight: 700; }
.gn-card-go .chev { width: 16px; height: 16px; color: inherit; }
.gn-card img { flex: none; width: 86px; height: 78px; object-fit: contain; margin: -4px -6px -8px -4px; }
html[data-theme="dark"] .gn-card { box-shadow: var(--sh-card), inset 0 0 0 1px color-mix(in srgb, var(--honey) 22%, transparent); }
.sh-goi { display: flex; align-items: center; gap: 12px; width: 100%; margin: 16px 0 8px; padding: 12px 14px; border: 0; text-align: left; color: var(--ink); font: inherit; cursor: pointer;
  border-radius: 16px; background: color-mix(in srgb, var(--honey) 14%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--honey) 28%, transparent); }
.sh-goi > span { flex: 1; min-width: 0; }
.sh-goi b { display: block; font-size: 15px; line-height: 21px; font-weight: 700; }
.sh-goi small { display: block; font-size: 13px; line-height: 18px; color: var(--ink2); }
.sh-goi .chev { flex: none; color: var(--ink3); }

/* ---------- wider: the table gets a first column of names, the cards sit side by side ---------- */
@media (min-width: 600px) {
  .gn-cmp { --lw: 34%; --cw: 22%; }
  .gn-cmp-head, .gn-row { grid-template-columns: 34% repeat(3, 22%); }
  .gn-h0 { display: block; }
  .gn-l { grid-column: auto; align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding: 14px 12px 14px 22px; font-size: 15px; line-height: 21px; }
  .gn-l b { font-weight: 600; }
  .gn-l small { font-size: 13px; line-height: 18px; }
  .gn-row:last-child .gn-l { border-bottom-left-radius: 16px; }
  .gn-c { min-height: 54px; padding: 10px 8px; font-size: 14.5px; }
  .gn-h b { font-size: 16px; }
  .gn-h small { font-size: 13px; }
}
@media (min-width: 760px) {
  .gn-plans { grid-template-columns: 1fr 1fr; align-items: start; gap: 16px; }
  .gn-hero { margin: 18px 0 28px; }
  .gn-hero h2 { font-size: 32px; line-height: 40px; }
  .gn-more { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: end; }
  .gn-org { margin-top: 0; flex-direction: column; align-items: flex-start; padding: 20px; }
}

@keyframes gn-in { from { opacity: 0; translate: 28px 0; } }
@keyframes gn-up { from { opacity: 0; transform: translateY(12px); } }
@keyframes gn-hop { from { opacity: 0; transform: translateY(16px) scale(.8); } }
@keyframes gn-flip { from { opacity: .2; transform: translateY(5px); } }
@keyframes gn-stamp { from { opacity: 0; transform: rotate(4deg) scale(1.7); } }
@media (prefers-reduced-motion: reduce) {
  .gn, .gn-plan, .gn-hero img, .gn-seal, .gn-flip { animation: none; }
  .gn-cmp-head::before, .gn-band, .gn-radio::after { transition: none; }
}
