/* PVD PEA — member mobile app.
   Playful / soft-pastel design (ADR-002): PEA blue/purple primary + pastel accents,
   Noto Sans Thai system-wide (headings/body/numbers), card-based + soft shadows, 3D-sticker gamification.
   Most styling is Tailwind utilities; this file holds the base layer + helpers. */

:root {
  --primary: #2961ee;
  --primary-light: #5481f1;
  --secondary: #6945dc;
  --ink: #14215a;       /* deep indigo */
  --body: #334155;      /* slate-700 */
  --muted: #64748b;     /* slate-500 */
  --page: #f6f8fe;
}

html { background: var(--page); scroll-behavior: smooth; overflow-x: clip; }
body { overflow-x: clip; }
/* No header (native-app feel) — keep content clear of the status bar in standalone mode */
#main-content { padding-top: calc(env(safe-area-inset-top, 0px) + 1.25rem); }

body {
  min-height: 100dvh;
  color: var(--body);
  background:
    radial-gradient(circle at 100% -4%, rgba(105, 69, 220, .08), transparent 20rem),
    radial-gradient(circle at -8% 6%, rgba(41, 97, 238, .08), transparent 22rem),
    radial-gradient(circle at 50% 120%, rgba(191, 233, 216, .35), transparent 26rem),
    var(--page);
}

h1, h2, h3, h4 { font-family: "Noto Sans Thai", "Noto Sans Thai", sans-serif; font-weight: 600; letter-spacing: 0; }
.num { font-family: "Noto Sans Thai", ui-sans-serif, system-ui, sans-serif; font-feature-settings: "tnum" "lnum"; }

button, a, input { touch-action: manipulation; }
:where(button, a, input, [tabindex]):focus-visible {
  outline: 3px solid rgba(41, 97, 238, .45);
  outline-offset: 2px;
  border-radius: 14px;
}

/* Screen transitions */
.app-screen { animation: screen-in .26s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Hide scrollbars on horizontal rails */
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ---- Cards (website "ContentCard" feel) ---- */
.card-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 1rem;
  background: linear-gradient(135deg, #2961ee, #6945dc);
}
.card-media.is-article { background: linear-gradient(135deg, #2961ee, #6945dc); }
.card-media.is-news { background: linear-gradient(135deg, #2961ee, #1e6ba8); }
.card-media.is-announcement { background: linear-gradient(135deg, #f0a93a, #e6792f); }
.card-media.is-pr { background: linear-gradient(135deg, #6945dc, #b14463); }
.card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.group:hover .card-media img,
a:hover .card-media img { transform: scale(1.04); }
.card-media .card-media-icon { position: absolute; inset: 0; margin: auto; opacity: .9; }

/* ---- Playful card + pastel system (ADR-002) ---- */
.play-card {
  position: relative;
  border-radius: 1.75rem;
  background: #fff;
  border: 1.5px solid #fff;
  box-shadow: 0 14px 0 rgba(41, 97, 238, .035), 0 18px 40px rgba(20, 33, 90, .09);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease;
}
@media (hover: hover) { .play-card:hover { transform: translateY(-3px); box-shadow: 0 16px 0 rgba(41,97,238,.05), 0 26px 50px rgba(105,69,220,.14); } }

/* Pastel accent pairs (bg + readable ink) */
.pastel-mint   { background: #DDF5EA; color: #1E7A55; }
.pastel-bloom  { background: #FBE3E8; color: #B14463; }
.pastel-butter { background: #FFF0B7; color: #9A6B00; }
.pastel-lilac  { background: #EDE7FB; color: #6B4BC0; }
.pastel-peach  { background: #FFE8D5; color: #B5601F; }
.pastel-sky    { background: #E7F2FB; color: #1E6BA8; }

/* Eyebrow label above section headings */
.eyebrow { font-family: "Noto Sans Thai", sans-serif; font-size: .68rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--secondary); }

/* 3D sticker placement (glossy SVGs floating on a card corner) */
.sticker { filter: drop-shadow(0 10px 12px rgba(48, 70, 121, .22)); pointer-events: none; user-select: none; }
.sticker-float { transform: rotate(-2deg); }

/* PVD Avatar tier medallion — glossy 3D coin */
.medallion {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  box-shadow: inset 0 3px 6px rgba(255,255,255,.55), inset 0 -8px 14px rgba(0,0,0,.22), 0 12px 24px rgba(20,33,90,.22);
}
.medallion::before {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35);
}
.medallion::after {
  content: "";
  position: absolute;
  top: 12%;
  left: 18%;
  width: 42%;
  height: 26%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.85), transparent 70%);
  filter: blur(1px);
}
.medallion > * { position: relative; z-index: 1; }
.medallion.tier-Bronze   { background: radial-gradient(circle at 32% 26%, #f6c79a, #c87f3c 55%, #9c5a22); }
.medallion.tier-Silver   { background: radial-gradient(circle at 32% 26%, #f4f8fc, #b3c0d0 55%, #8fa0b5); color: #41506a; }
.medallion.tier-Gold     { background: radial-gradient(circle at 32% 26%, #fff2bf, #f3c33f 55%, #d99400); color: #6b4a00; }
.medallion.tier-Platinum { background: radial-gradient(circle at 32% 26%, #efeaff, #9d86ea 50%, #6945dc); }

.line-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Filter chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 38px;
  padding: 0 .95rem;
  border-radius: 999px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all .2s ease;
}
.chip[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(41, 97, 238, .25);
}

/* Bottom navigation */
.tabbar-btn { color: #94a3b8; transition: color .2s ease; }
.tabbar-btn[aria-current="page"] { color: var(--primary); }
.tabbar-btn[aria-current="page"] .tabbar-ico {
  background: #e7eeff;
  transform: translateY(-2px);
}
.tabbar-ico { transition: all .2s ease; }

/* Service / list rows (services + profile) */
.service-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .03);
  transition: border-color .2s ease, transform .2s ease;
}
.service-row:hover { border-color: rgba(41, 97, 238, .3); transform: translateY(-1px); }

/* ---- Home: quick actions, section headers, illustrated panels + motion (T-008) ---- */
.quick-action { display: flex; flex-direction: column; align-items: center; gap: .4rem; min-width: 0; border-radius: 1rem; padding: .35rem .15rem; transition: transform .2s ease; }
.quick-action:active { transform: scale(.95); }
.quick-label { overflow-wrap: anywhere; max-width: 100%; }
.quick-ico { display: grid; place-items: center; height: 3rem; width: 3rem; border-radius: 1.1rem; box-shadow: 0 8px 18px rgba(20,33,90,.10); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
@media (hover: hover) { .quick-action:hover .quick-ico { transform: translateY(-3px); } }
.quick-label { font-size: .76rem; font-weight: 600; line-height: 1.15; color: #475569; text-align: center; }

.sec-ico { display: grid; place-items: center; height: 2.25rem; width: 2.25rem; border-radius: .8rem; flex-shrink: 0; }
.sec-title { font-family: "Noto Sans Thai", "Noto Sans Thai", sans-serif; font-size: 1.075rem; font-weight: 700; line-height: 1.2; color: #14215a; }
.sec-sub { margin-top: .1rem; font-size: .75rem; color: #64748b; }
.sec-link { flex-shrink: 0; font-size: .85rem; font-weight: 600; color: #2961ee; }

/* Illustrations sit static (idle up/down motion removed per request) */

/* Events banner (illustrated) */
.event-banner { position: relative; overflow: hidden; min-height: 120px; border-radius: 1.75rem; padding: 1.25rem; color: #fff; background: linear-gradient(135deg, #6945dc, #2961ee); box-shadow: 0 16px 38px rgba(105,69,220,.28); }
.event-banner-text { position: relative; z-index: 1; max-width: 58%; }
.event-banner-illo { position: absolute; right: -.5rem; bottom: -.25rem; width: 8.75rem; z-index: 0; filter: drop-shadow(0 8px 14px rgba(20,33,90,.22)); }

/* What-if CTA (illustrated) */
.whatif-cta { position: relative; display: flex; align-items: center; overflow: hidden; width: 100%; text-align: left; border-radius: 1.75rem; padding: 1.25rem 1.25rem 1.25rem 1.4rem; background: linear-gradient(135deg, #DDF5EA, #E7F2FB); box-shadow: 0 14px 34px rgba(20,33,90,.10); transition: transform .25s ease, box-shadow .25s ease; }
@media (hover: hover) { .whatif-cta:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(20,33,90,.14); } }
.whatif-cta-text { position: relative; z-index: 1; max-width: 64%; }
.whatif-cta-illo { position: absolute; right: -.25rem; bottom: -.5rem; width: 7.75rem; z-index: 0; }

/* Rafiki character mascots peeking on a screen header / card corner (cute gimmick) */
.illo-mascot { position: absolute; z-index: 1; pointer-events: none; user-select: none; filter: drop-shadow(0 8px 12px rgba(20,33,90,.16)); }

/* Character peeking UP from BEHIND a card's top edge (per design reference SCR-…kwrr) */
.illo-peek-wrap { position: relative; }
.illo-peek-wrap > .illo-peeker {
  position: absolute; z-index: 0; pointer-events: none; user-select: none;
  filter: drop-shadow(0 6px 10px rgba(20,33,90,.18));
}
.peek-card { position: relative; z-index: 1; }  /* opaque card sits in front, hiding the character's lower half */

@media (prefers-reduced-motion: reduce) { .illo-float, .illo-mascot, .illo-peeker { animation: none; } }

/* ---- Article reader: editorial / magazine (T-006) ---- */

/* Reading-progress bar (fills with scroll, hidden off-article) */
.read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: linear-gradient(90deg, #2961ee, #6945dc);
  transform: scaleX(0); transform-origin: left center; opacity: 0;
  transition: transform .12s linear, opacity .25s ease;
}

/* Full-bleed per-type cover (kicker + title + byline anchored to bottom) */
.article-cover {
  position: relative;
  margin: -1.25rem -1rem 0;
  min-height: 17rem;
  padding: 3.25rem 1.25rem 2.25rem;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #2961ee, #6945dc);
}
.article-cover.is-article      { background: linear-gradient(135deg, #2961ee, #6945dc); }
.article-cover.is-news         { background: linear-gradient(135deg, #2961ee, #1e6ba8); }
.article-cover.is-announcement { background: linear-gradient(135deg, #f0a93a, #e6792f); }
.article-cover.is-pr           { background: linear-gradient(135deg, #6945dc, #b14463); }
.article-cover-img   { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
/* Bottom-up scrim guarantees white-text contrast even on the light amber cover */
.article-cover-scrim { position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(8,12,30,.84) 0%, rgba(8,12,30,.5) 36%, rgba(8,12,30,.14) 70%, rgba(8,12,30,.04) 100%); }
.article-cover-inner { position: relative; z-index: 2; }
.article-back {
  position: absolute; top: 1rem; left: 1rem; z-index: 3;
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem;
  border-radius: 999px; color: #fff;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(6px); transition: background .2s ease, transform .2s ease;
}
.article-back:hover { background: rgba(255,255,255,.3); transform: translateY(-1px); }
.article-kicker {
  font-family: "Noto Sans Thai", sans-serif; font-size: .72rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.92);
}
.article-title {
  margin-top: .55rem; font-family: "Noto Sans Thai", "Noto Sans Thai", sans-serif; font-weight: 600;
  font-size: clamp(1.6rem, 5.6vw, 2.3rem); line-height: 1.24; color: #fff;
  text-shadow: 0 1px 16px rgba(8,12,30,.35); text-wrap: balance;
}
.article-byline {
  margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  font-size: .85rem; color: rgba(255,255,255,.88);
}
.article-meta-chip {
  display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.24);
  padding: .14rem .6rem; font-weight: 700; font-size: .78rem; color: #fff;
}
.article-meta-dot { width: 4px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.55); }

/* Body card overlaps the cover (cover → story transition) */
.article-shell {
  position: relative; z-index: 2; margin-top: -1.25rem;
  border-radius: 1.75rem; background: #fff; padding: 1.75rem 1.4rem;
  box-shadow: 0 18px 40px rgba(20,33,90,.10);
}

/* Standfirst / lede — typographic emphasis, NOT a side-stripe */
.lede {
  font-family: "Noto Sans Thai", "Noto Sans Thai", sans-serif; font-weight: 500;
  font-size: 1.18rem; line-height: 1.65; color: #1f2d52; text-wrap: pretty;
}
.lede + .reader { margin-top: 1.4rem; padding-top: 1.4rem; border-top: 1px solid #eef1f7; }

.reader { max-width: 42rem; }
.reader p { color: #334155; font-size: 1.06rem; line-height: 1.9; text-wrap: pretty; }
.reader p + p { margin-top: 1.15rem; }
.reader .reader-lead { font-size: 1.12rem; color: #1f2d52; }

/* Pull-quote — large display + oversized quote glyph + color (no border stripe) */
.reader-quote {
  position: relative; margin: 1.9rem 0; padding: 0;
  font-family: "Noto Sans Thai", "Noto Sans Thai", sans-serif; font-weight: 500;
  font-size: 1.3rem; line-height: 1.5; color: #2961ee; text-wrap: pretty;
}
.reader-quote::before {
  content: "\201C"; display: block; font-family: Georgia, "Noto Sans Thai", serif;
  font-size: 3rem; line-height: .7; color: rgba(41,97,238,.26); margin-bottom: .15rem;
}

@media (min-width: 640px) {
  .article-cover { margin: -1.25rem -1.5rem 0; min-height: 19rem; padding: 3.5rem 1.9rem 2.5rem; }
  .article-shell { padding: 2.25rem 2rem; }
  .lede { font-size: 1.28rem; }
}

@media (prefers-reduced-motion: reduce) {
  .read-progress { transition: opacity .2s ease; }
  .article-back { transition: none; }
}

/* Toast */
.toast { transition: opacity .3s ease, transform .3s ease; }

/* ---- Login celebration: confetti + congrats (T-015) ---- */
#celebrate-overlay { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; overflow: hidden; padding: 1.5rem; background: rgba(8,12,30,.55); backdrop-filter: blur(3px); }
#celebrate-overlay.show { display: grid; animation: cel-fade .25s ease; }
@keyframes cel-fade { from { opacity: 0; } to { opacity: 1; } }
.celebrate-card {
  position: relative; z-index: 2; width: min(22rem, 100%); text-align: center;
  border-radius: 1.9rem; background: #fff; padding: 2.75rem 1.5rem 1.5rem;
  box-shadow: 0 30px 70px rgba(20,33,90,.35);
  animation: cel-pop .45s cubic-bezier(.2,.9,.3,1.3) both;
}
@keyframes cel-pop { from { transform: scale(.8) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.celebrate-sticker { position: absolute; left: 50%; top: -2.4rem; width: 5.5rem; transform: translateX(-50%); filter: drop-shadow(0 10px 14px rgba(48,70,121,.28)); }
.celebrate-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--secondary); }
.celebrate-title { margin-top: .25rem; font-size: 1.5rem; font-weight: 800; color: #14215a; }
.celebrate-sub { margin-top: .35rem; font-size: .9rem; color: #64748b; }
.celebrate-reward { margin-top: 1rem; display: inline-flex; align-items: center; gap: .4rem; border-radius: 999px; background: #FFF0B7; color: #9A6B00; padding: .6rem 1.1rem; font-weight: 800; }
.celebrate-btn { margin-top: 1.25rem; min-height: 3rem; width: 100%; border-radius: 1.1rem; background: linear-gradient(135deg, #2961ee, #6945dc); color: #fff; font-weight: 800; box-shadow: 0 12px 26px rgba(41,97,238,.3); transition: transform .2s ease; }
.celebrate-btn:hover { transform: translateY(-2px); }

.confetti { position: absolute; bottom: 2%; width: 8px; height: 12px; border-radius: 2px; opacity: .95; will-change: transform; animation: confetti-up cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes confetti-up {
  0%   { transform: translateY(0) translateX(0) rotate(0); opacity: 1; }
  12%  { opacity: 1; }
  62%  { transform: translateY(var(--y, -78vh)) translateX(calc(var(--x, 0) * 60px)) rotate(calc(var(--r, 540deg) * .7)); opacity: 1; }
  100% { transform: translateY(calc(var(--y, -78vh) + 26vh)) translateX(calc(var(--x, 0) * 120px)) rotate(var(--r, 540deg)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #celebrate-overlay.show, .celebrate-card, .celebrate-sticker { animation: none; }
  .confetti { display: none; }
}

/* =========================================================
   ระดับนักออม (Saver Class) — hero card, rate sheet, share card
   --c1/--c2 = the class gradient stops (set inline per class)
   ========================================================= */
.saver-card { position: relative; overflow: hidden; border-radius: 1.6rem; padding: 1.25rem 1.25rem 1.1rem;
  background: linear-gradient(135deg, var(--c1, #2961ee), var(--c2, #6945dc)); color: #fff;
  box-shadow: 0 16px 40px rgba(20,33,90,.22); }
.saver-card::after { content: ""; position: absolute; right: -2.5rem; top: -3rem; width: 9rem; height: 9rem;
  border-radius: 50%; background: rgba(255,255,255,.14); pointer-events: none; }
.saver-card-head { position: relative; z-index: 1; display: flex; align-items: center; gap: .9rem; }
.saver-emoji { display: grid; place-items: center; height: 3.4rem; width: 3.4rem; flex-shrink: 0;
  border-radius: 1.1rem; background: rgba(255,255,255,.20); font-size: 1.85rem; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.saver-eyebrow { font-size: .68rem; font-weight: 800; letter-spacing: .04em; color: rgba(255,255,255,.82); }
.saver-name { font-size: 1.45rem; font-weight: 800; line-height: 1.15; }
.saver-rate { margin-top: .15rem; font-size: .82rem; color: rgba(255,255,255,.9); }
.saver-track { position: relative; z-index: 1; margin-top: 1rem; height: .5rem; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; }
.saver-fill { height: 100%; border-radius: 999px; background: #fff; box-shadow: 0 0 12px rgba(255,255,255,.6); transition: width .5s cubic-bezier(.22,1,.36,1); }
.saver-percentile { position: relative; z-index: 1; margin-top: .55rem; font-size: .8rem; font-weight: 600; color: rgba(255,255,255,.92); }
.saver-actions { position: relative; z-index: 1; margin-top: 1rem; display: flex; gap: .6rem; }
.saver-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; flex: 1;
  border-radius: 999px; padding: .6rem .9rem; font-size: .82rem; font-weight: 800; cursor: pointer;
  transition: transform .15s ease, background .15s ease; }
.saver-btn:active { transform: scale(.97); }
.saver-btn-ghost { background: rgba(255,255,255,.18); color: #fff; }
.saver-btn-ghost:hover { background: rgba(255,255,255,.28); }
.saver-btn-solid { background: #fff; color: #1F4FD0; box-shadow: 0 6px 16px rgba(0,0,0,.16); }
.saver-btn-solid:hover { transform: translateY(-1px); }
/* on a white surface (rate sheet) the solid button needs brand fill instead */
#rate-sheet .saver-btn-solid, #rule-sheet .saver-btn-solid, #alert-popup .saver-btn-solid { background: linear-gradient(135deg, var(--c1, #2961ee), var(--c2, #6945dc)); color: #fff; }
#rate-sheet .saver-btn-ghost, #rule-sheet .saver-btn-ghost, #alert-popup .saver-btn-ghost { background: #f1f5f9; color: #475569; }

/* =========================================================
   ต้นไม้แห่งความมั่งคั่ง — 2-axis tree card (light surface; the 3D art has a white bg)
   --c1/--c2 = green tier gradient stops (set inline). Size=saving tier, art column=vitality.
   ========================================================= */
.tree-card { position: relative; border-radius: 1.6rem; background: linear-gradient(160deg, #F3FBF5, #E8F7EF);
  box-shadow: 0 14px 36px rgba(16, 80, 60, .14); }
.tree-img { width: 6.9rem; height: 6.9rem; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 8px 12px rgba(16, 80, 60, .18)); }
.tree-body { min-width: 0; flex: 1; }
.tree-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.tree-eyebrow { font-size: .68rem; font-weight: 800; letter-spacing: .02em; color: #15803D; }
.tree-more { flex-shrink: 0; font-size: .72rem; font-weight: 800; color: #0D9488; }
.tree-name { font-size: 1.15rem; font-weight: 800; line-height: 1.2; color: #14215A; }
.tree-name-lg { font-size: 1.7rem; }
.tree-rate { margin-top: .1rem; font-size: .8rem; font-weight: 600; color: #475569; }
.tree-stats { margin-top: .55rem; display: flex; flex-wrap: wrap; gap: .2rem 1rem; font-size: .78rem; font-weight: 700; color: #334155; }
.tree-stats span { display: inline-flex; align-items: center; gap: .3rem; }
.tree-stats svg { color: #D97706; }
.vitality-track { margin-top: .5rem; height: .5rem; border-radius: 999px; background: rgba(13, 148, 136, .16); overflow: hidden; }
.vitality-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--c1, #34D399), var(--c2, #0D9488));
  box-shadow: 0 0 10px rgba(16, 185, 129, .5); transition: width .5s cubic-bezier(.22, 1, .36, 1); }

/* home: display-only, tappable → profile */
.tree-card.is-tappable { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; cursor: pointer;
  transition: transform .18s cubic-bezier(.22, 1, .36, 1), box-shadow .18s ease; }
.tree-card.is-tappable:hover { transform: translateY(-3px); box-shadow: 0 20px 46px rgba(16, 80, 60, .2); }
.tree-card.is-tappable:active { transform: scale(.99); }
.tree-card.is-tappable:focus-visible { outline: 3px solid #34D399; outline-offset: 2px; }

/* profile: hero + actions */
.tree-card.is-hero { padding: 1.2rem 1.4rem 1.4rem; text-align: center; overflow: visible; }
.tree-img-lg { width: 13rem; height: 13rem; margin: -2.2rem auto .1rem; display: block;
  filter: drop-shadow(0 14px 20px rgba(16, 80, 60, .22)); }
.tree-card.is-hero .vitality-track { margin-top: 1rem; }
.tree-vitality-note { margin-top: .5rem; font-size: .82rem; font-weight: 700; color: #0F766E; }
.tree-card .saver-percentile { position: static; margin-top: .35rem; color: #475569; font-weight: 600; }
.tree-actions { margin-top: 1.2rem; display: flex; flex-direction: column; gap: .6rem; }
.tree-actions-row { display: flex; gap: .6rem; }
.tree-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; flex: 1; border: 0;
  border-radius: 999px; padding: .72rem 1rem; font-size: .85rem; font-weight: 800; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.tree-btn:active { transform: scale(.97); }
.tree-btn-solid { background: linear-gradient(135deg, #22C55E, #0D9488); color: #fff; box-shadow: 0 10px 22px rgba(13, 148, 136, .32); }
.tree-btn-solid:hover { transform: translateY(-1px); }
.tree-btn-ghost { background: #fff; color: #0F766E; box-shadow: inset 0 0 0 1.5px rgba(13, 148, 136, .25); }
.tree-btn-ghost:hover { background: #F0FDF4; }
.tree-btn-done { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border-radius: 999px; padding: .72rem 1rem; font-size: .85rem; font-weight: 800; background: #ECFDF5; color: #15803D;
  box-shadow: inset 0 0 0 1.5px rgba(16, 185, 129, .3); }


/* ---- Profile: member card (membership-card hero) + stat tiles ---- */
.pcard { position: relative; overflow: hidden; border-radius: 1.6rem; padding: 1.2rem 1.3rem 1.3rem; color: #fff;
  background: linear-gradient(135deg, #2961ee 0%, #4d3fd6 55%, #6945dc 100%); box-shadow: 0 20px 42px rgba(60,49,160,.32); }
.pcard-sheen { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 130% at 88% -20%, rgba(255,255,255,.32), transparent 52%),
    radial-gradient(90% 80% at -10% 120%, rgba(255,255,255,.14), transparent 60%); }
.pcard > * { position: relative; z-index: 1; }
.pcard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.pcard-logo { font-size: 1.45rem; font-weight: 800; letter-spacing: .04em; line-height: 1; display: flex; flex-direction: column; }
.pcard-logo small { margin-top: .25rem; font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.pcard-tier { flex-shrink: 0; display: inline-flex; align-items: center; gap: .25rem; font-size: .76rem; font-weight: 800;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: .3rem .7rem; backdrop-filter: blur(4px); }
.pcard-share { flex-shrink: 0; display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 800;
  color: #fff; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.32); border-radius: 999px; padding: .35rem .7rem .35rem .6rem;
  backdrop-filter: blur(4px); cursor: pointer; transition: background .18s ease, transform .18s ease; }
.pcard-share:hover { background: rgba(255,255,255,.34); transform: translateY(-1px); }
.pcard-share:active { transform: translateY(0); }
.pcard-idrow { margin-top: 1.3rem; display: flex; align-items: center; gap: .9rem; }
.pcard-avatar { width: 3.6rem; height: 3.6rem; flex-shrink: 0; border-radius: 1.1rem; display: grid; place-items: center;
  font-size: 1.3rem; font-weight: 800; color: #fff; background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.4);
  box-shadow: inset 0 1px 6px rgba(255,255,255,.25); }
.pcard-idtext { min-width: 0; }
.pcard-name { font-size: 1.3rem; font-weight: 800; line-height: 1.15; }
.pcard-pos { margin-top: .1rem; font-size: .84rem; font-weight: 600; opacity: .92; }
.pcard-dept { margin-top: .1rem; font-size: .72rem; opacity: .72; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-meta { margin-top: 1.25rem; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: .6rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.2); }
.pcard-meta dt { font-size: .64rem; font-weight: 600; letter-spacing: .04em; opacity: .72; text-transform: uppercase; }
.pcard-meta dd { margin-top: .2rem; font-size: .92rem; font-weight: 800; letter-spacing: .02em; }
.pcard-meta-id dd { letter-spacing: .06em; }

.pstats { margin: -0.5rem .55rem 0; position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem;
  background: #fff; border-radius: 1.3rem; padding: .9rem .5rem; box-shadow: 0 16px 32px rgba(20,33,90,.12); }
.pstat { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .25rem .1rem; border-radius: .9rem; background: none; transition: transform .15s ease, background .15s ease; }
button.pstat { cursor: pointer; }
button.pstat:hover { background: #f4f7ff; }
button.pstat:active { transform: scale(.95); }
.pstat-ico { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .7rem; }
.pstat-emoji { font-size: 1rem; }
.pstat b { font-size: 1.15rem; font-weight: 800; color: #14215A; line-height: 1; }
.pstat .pstat-frac { font-size: .72rem; font-weight: 700; color: #94a3b8; }
.pstat small { font-size: .66rem; font-weight: 600; color: #64748b; text-align: center; }

/* Profile sections — unified icon-chip headers (match the card set) */
.prof-sec { margin-top: 1.6rem; }
.prof-sec-head { display: flex; align-items: center; gap: .65rem; margin-bottom: .8rem; }
.prof-sec-head > div { flex: 1; min-width: 0; }
.prof-sec-count { flex-shrink: 0; font-size: .78rem; font-weight: 800; color: #1F4FD0; background: #EEF3FF; border-radius: 999px; padding: .2rem .6rem; }

/* ---- เหรียญตรา (sliced art medallion + progress ring) ---- */
.badges-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem .4rem; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4rem; padding: .3rem .1rem;
  background: none; border: 0; cursor: pointer; transition: transform .15s ease; }
.badge:active { transform: scale(.95); }
.badge-ring { position: relative; width: 4.4rem; height: 4.4rem; border-radius: 50%; display: grid; place-items: center; padding: 3px; }
.badge-ring.is-locked { background: conic-gradient(#6945dc calc(var(--p) * 360deg), #e6ebf3 0); }
.badge-ring.is-unlocked { background: linear-gradient(135deg, #fbbf24, #f59e0b); filter: drop-shadow(0 8px 15px rgba(217, 119, 6, .32)); }
.badge-ring.is-soon { background: #e6ebf3; }
.badge-disc { position: relative; width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 120% at 30% 18%, #ffffff, #eef2fb); }
.badge-art { width: 84%; height: 84%; object-fit: contain; }
.badge-disc-locked .badge-art { filter: grayscale(1) opacity(.5); }
.badge-ring.is-soon .badge-art { filter: grayscale(1) opacity(.35); }
.badge-check { position: absolute; right: -2px; bottom: -2px; width: 1.35rem; height: 1.35rem; border-radius: 50%;
  display: grid; place-items: center; background: #22c55e; color: #fff; font-size: .8rem; font-weight: 800;
  border: 2px solid #fff; box-shadow: 0 3px 8px rgba(16, 80, 60, .3); }
.badge-label { font-size: .72rem; font-weight: 800; color: #0b2a4a; line-height: 1.15; }
.badge-status { font-size: .66rem; font-weight: 700; color: #94a3b8; }
.badge-status.is-unlocked { color: #16a34a; }
.badge-status.is-soon { color: #b08900; }
.badge-seeall { margin-top: 1rem; display: flex; width: 100%; align-items: center; justify-content: center; gap: .4rem;
  border-radius: 1rem; border: 1.5px solid #e2e8f0; background: #fff; padding: .8rem; font-weight: 800; color: #2961ee;
  cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.badge-seeall:hover { border-color: rgba(41, 97, 238, .4); transform: translateY(-1px); }

/* ---- หน้า list เหรียญ: แท็บกรอง + หมวด ---- */
.badge-filters { display: flex; gap: .5rem; margin-bottom: 1.2rem; }
.badge-filter { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 0;
  border-radius: 999px; padding: .6rem .5rem; font-size: .82rem; font-weight: 800; cursor: pointer;
  background: #eef2f7; color: #64748b; transition: background .15s ease, color .15s ease; }
.badge-filter .num { font-size: .72rem; opacity: .8; }
.badge-filter.is-active { background: linear-gradient(135deg, #2961ee, #6945dc); color: #fff; box-shadow: 0 8px 18px rgba(41, 97, 238, .25); }
.badge-catsec { margin-bottom: 1.6rem; }
.badge-cat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .85rem;
  font-size: .98rem; font-weight: 800; color: #0b2a4a; }
.badge-cat-count { font-size: .8rem; font-weight: 700; color: #94a3b8; }

/* ---- หน้ารายละเอียดเหรียญ ---- */
.badge-detail-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; padding: .5rem 0 1.4rem; }
.badge-detail-medallion .badge-ring { width: 7.5rem; height: 7.5rem; }
.badge-detail-medallion .badge-check { width: 2rem; height: 2rem; font-size: 1.1rem; }
.badge-detail-cat { font-size: .8rem; font-weight: 700; color: #6945dc; }
.badge-detail-name { font-size: 1.5rem; font-weight: 800; color: #0b2a4a; line-height: 1.15; }
.badge-statuschip { display: inline-flex; align-items: center; padding: .35rem .9rem; border-radius: 999px;
  font-size: .8rem; font-weight: 800; background: #eef2f7; color: #64748b; }
.badge-statuschip.is-on { background: #dcfce7; color: #15803d; }
.badge-statuschip.is-soon { background: #fef3c7; color: #b08900; }
.badge-detail-card { margin-top: 1rem; border-radius: 1.3rem; background: #fff; padding: 1.1rem 1.2rem;
  box-shadow: 0 10px 26px rgba(20, 33, 90, .07); }
.badge-detail-cardhead { display: flex; align-items: center; justify-content: space-between; font-size: .82rem;
  font-weight: 800; color: #0b2a4a; margin-bottom: .7rem; }
.badge-detail-cardhead .num { color: #2961ee; }
.badge-detail-text { font-size: .92rem; line-height: 1.6; color: #334155; }
.badge-soonnote { font-size: .9rem; line-height: 1.6; color: #92760a; background: #fffbeb; }
.badge-source-btn { margin-top: .9rem; display: inline-flex; align-items: center; gap: .4rem; border: 0; cursor: pointer;
  border-radius: 999px; padding: .6rem 1.1rem; font-size: .85rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #2961ee, #6945dc); box-shadow: 0 8px 18px rgba(41, 97, 238, .25); }
.badge-evi { display: flex; flex-direction: column; }
.badge-evi-row { display: flex; align-items: center; gap: .75rem; padding: .65rem .1rem; border-bottom: 1px solid #eef2f7; text-align: left; }
.badge-evi-row:last-child { border-bottom: 0; }
.badge-evi-row.is-link { cursor: pointer; }
.badge-evi-ico { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .7rem; flex-shrink: 0;
  background: #dcfce7; color: #16a34a; }
.badge-evi-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.badge-evi-main strong { font-size: .86rem; font-weight: 700; color: #0b2a4a; line-height: 1.3; }
.badge-evi-main span { font-size: .72rem; color: #94a3b8; }
.badge-evi-arrow { color: #cbd5e1; flex-shrink: 0; }
.badge-evi-empty { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1.8rem 1rem; text-align: center; }
.badge-evi-empty p { font-size: .95rem; font-weight: 800; color: #0b2a4a; }
.badge-evi-empty span { font-size: .8rem; color: #94a3b8; }

/* ---- Coin history (ledger) ---- */
.coinsum-card { position: relative; overflow: hidden; border-radius: 1.6rem; padding: 1.3rem 1.4rem 1.2rem; color: #fff;
  background: linear-gradient(150deg, #f59e0b, #d97706); box-shadow: 0 16px 38px rgba(217, 119, 6, .30); }
.coinsum-label { font-size: .82rem; font-weight: 600; color: rgba(255, 255, 255, .8); }
.coinsum-total { margin-top: .2rem; font-size: 2rem; font-weight: 800; line-height: 1.1; }
.coinsum-total span { font-size: .95rem; font-weight: 700; color: rgba(255, 255, 255, .82); }
.coinsum-split { margin-top: 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.coinsum-split > div { display: flex; flex-direction: column; gap: .1rem; background: rgba(255, 255, 255, .16); border-radius: 1rem; padding: .55rem .8rem; }
.coinsum-split small { font-size: .68rem; font-weight: 600; color: rgba(255, 255, 255, .82); }
.coinsum-up, .coinsum-down { font-size: 1.05rem; font-weight: 800; }
.coinlog-head { margin: 1.6rem 0 .7rem; font-size: 1rem; font-weight: 800; color: #0b2a4a; }
.coinlog { display: flex; flex-direction: column; }
.coinlog-row { display: flex; align-items: center; gap: .85rem; padding: .8rem .2rem; border-bottom: 1px solid #eef2f7; }
.coinlog-row:last-child { border-bottom: 0; }
.coinlog-ico { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: .9rem; flex-shrink: 0; }
.coinlog-ico.is-up { background: #dcfce7; color: #16a34a; }
.coinlog-ico.is-down { background: #fee2e2; color: #dc2626; }
.coinlog-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .12rem; }
.coinlog-reason { font-size: .88rem; font-weight: 700; color: #0b2a4a; line-height: 1.2; }
.coinlog-date { font-size: .72rem; font-weight: 600; color: #94a3b8; }
.coinlog-delta { flex-shrink: 0; font-size: 1rem; font-weight: 800; }
.coinlog-delta.is-up { color: #16a34a; }
.coinlog-delta.is-down { color: #dc2626; }
.coinlog-empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2.5rem 1rem; text-align: center; }
.coinlog-empty p { font-size: 1rem; font-weight: 800; color: #0b2a4a; }
.coinlog-empty span { font-size: .82rem; color: #94a3b8; }

/* share / rate-sheet previews use the same art (transparent → sits straight on the surface) */
.share-tree-wrap { position: relative; display: grid; place-items: center; margin: .5rem auto 1rem; }
.share-tree-wrap::before { content: ""; position: absolute; width: 13rem; height: 13rem; border-radius: 50%;
  background: #ffffff; box-shadow: 0 10px 40px 8px rgba(255, 255, 255, .45), 0 14px 30px rgba(20, 20, 60, .18); }
.share-tree { position: relative; display: block; width: 12.5rem; height: 12.5rem; object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(20, 20, 60, .14)); }
.rate-preview-tree { width: 7rem; height: 7rem; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(16, 80, 60, .2)); }

/* =========================================================
   Home — mini cards, financial-health card, compact news cards
   (balance hero reuses the .illo-peek-wrap / .peek-card pattern)
   ========================================================= */
.mini-card { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; border-radius: 1.3rem; background: #fff;
  padding: 1rem; text-align: left; box-shadow: 0 10px 26px rgba(20, 33, 90, .08); cursor: pointer;
  transition: transform .16s cubic-bezier(.22, 1, .36, 1), box-shadow .16s ease; }
.mini-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(20, 33, 90, .14); }
.mini-card:active { transform: scale(.98); }
.mini-ico { display: grid; height: 2.4rem; width: 2.4rem; place-items: center; border-radius: .95rem; margin-bottom: .35rem; }
.mini-label { font-size: .78rem; font-weight: 600; color: #64748b; }
.mini-value { font-size: 1.05rem; font-weight: 800; color: #14215A; line-height: 1.25; }

.health-card { padding: 1.25rem; }
.health-head { display: flex; align-items: center; gap: .65rem; }
.health-track { margin-top: 1rem; height: .6rem; border-radius: 999px; background: #E6EDF8; overflow: hidden; }
.health-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22C55E, #0D9488);
  box-shadow: 0 0 10px rgba(16, 185, 129, .45); transition: width .6s cubic-bezier(.22, 1, .36, 1); }
.health-stats { margin-top: 1rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; text-align: center; }
.health-stats > div { border-radius: 1rem; background: #F4F7FD; padding: .7rem .35rem; }
.health-stat-val { font-size: 1.15rem; font-weight: 800; color: #14215A; line-height: 1.1; }
.health-stat-lbl { margin-top: .2rem; font-size: .68rem; font-weight: 600; color: #64748b; }
.health-btn { margin-top: 1.1rem; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border-radius: 999px; padding: .8rem 1rem; font-size: .88rem; font-weight: 800; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #2961EE, #6945DC); box-shadow: 0 12px 26px rgba(41, 97, 238, .3);
  transition: transform .15s ease; }
.health-btn:hover { transform: translateY(-1px); }
.health-btn:active { transform: scale(.98); }

.news-card { display: flex; align-items: center; gap: .9rem; width: 100%; border-radius: 1.3rem; background: #fff; padding: .8rem;
  text-align: left; box-shadow: 0 8px 22px rgba(20, 33, 90, .08); cursor: pointer;
  transition: transform .16s cubic-bezier(.22, 1, .36, 1), box-shadow .16s ease; }
.news-card:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(20, 33, 90, .14); }
.news-card:active { transform: scale(.99); }
.news-thumb { width: 5.1rem; height: 5.1rem; aspect-ratio: 1; border-radius: 1.05rem; flex-shrink: 0; }
.news-body { min-width: 0; flex: 1; }
.news-badge { display: inline-block; border-radius: 999px; background: #EEF3FF; color: #2961EE; padding: .15rem .6rem;
  font-size: .64rem; font-weight: 800; letter-spacing: .02em; }
.news-title { margin-top: .35rem; font-size: .95rem; font-weight: 700; line-height: 1.3; color: #14215A; }
.news-meta { margin-top: .35rem; font-size: .72rem; font-weight: 500; color: #94a3b8; }
.news-read { margin-left: .4rem; border-radius: 999px; background: #ECFDF5; color: #15803D; padding: .05rem .4rem; font-size: .64rem; font-weight: 800; }
.news-arrow { flex-shrink: 0; color: #cbd5e1; transition: transform .15s ease, color .15s ease; }
.news-card:hover .news-arrow { transform: translateX(2px); color: #2961EE; }

/* Bottom sheet — ปรับอัตราการออม / เงื่อนไขแจ้งเตือน / popup แจ้งเตือน */
#rate-sheet, #rule-sheet, #alert-popup, #reward-sheet { position: fixed; inset: 0; z-index: 82; display: none; align-items: flex-end; justify-content: center;
  background: rgba(8,12,30,.5); backdrop-filter: blur(2px); }
#rate-sheet.show, #rule-sheet.show, #alert-popup.show, #reward-sheet.show { display: flex; animation: cel-fade .2s ease; }
#rule-sheet .rate-card, #alert-popup .rate-card, #reward-sheet .rate-card { max-height: 88vh; overflow-y: auto; }
#reward-sheet .saver-btn-solid { background: linear-gradient(135deg, #2961ee, #6945dc); color: #fff; }
#reward-sheet .saver-btn-ghost { background: #f1f5f9; color: #475569; }
.rate-card { width: min(28rem, 100%); border-radius: 1.6rem 1.6rem 0 0; background: #fff; padding: .85rem 1.4rem 1.6rem;
  box-shadow: 0 -18px 50px rgba(20,33,90,.25); animation: sheet-up .32s cubic-bezier(.22,1,.36,1) both; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.rate-grip { display: block; width: 2.5rem; height: .3rem; margin: 0 auto .9rem; border-radius: 999px; background: #e2e8f0; }
.rate-title { font-size: 1.2rem; font-weight: 800; color: #14215A; }
.rate-sub { margin-top: .15rem; font-size: .82rem; color: #64748b; }
.rate-preview { display: flex; flex-direction: column; align-items: center; gap: .15rem; margin: 1.2rem 0 .4rem; text-align: center; }
.rate-preview-emoji { font-size: 3rem; line-height: 1; }
.rate-preview-rate { font-size: 2rem; font-weight: 800; color: var(--c2, #6945dc); }
.rate-preview-name { font-size: .95rem; font-weight: 700; color: #14215A; }
.rate-preview-up { margin-top: .35rem; border-radius: 999px; background: #FFF0B7; color: #9A6B00; padding: .25rem .7rem; font-size: .76rem; font-weight: 800; }
.rate-slider { width: 100%; margin-top: 1rem; accent-color: var(--c2, #6945dc); }
.rate-scale { display: flex; justify-content: space-between; margin-top: .25rem; font-size: .72rem; font-weight: 600; color: #94a3b8; }
.rate-buttons { margin-top: 1.3rem; display: flex; gap: .7rem; }

/* Full-screen share card — "อวด" */
#saverclass-overlay { position: fixed; inset: 0; z-index: 83; display: none; place-content: safe center; justify-items: center;
  overflow-y: auto; padding: 1.5rem; background: rgba(8,12,30,.6); backdrop-filter: blur(3px); }
#saverclass-overlay.show { display: grid; animation: cel-fade .25s ease; }
.share-sheet { position: relative; z-index: 2; width: min(23rem, 100%); display: flex; flex-direction: column; align-items: stretch; gap: .9rem; }
.share-x { position: absolute; right: -.25rem; top: -2.4rem; height: 2.2rem; width: 2.2rem; border-radius: 999px; background: rgba(255,255,255,.2); color: #fff; font-weight: 700; cursor: pointer; }
.share-card { position: relative; overflow: hidden; border-radius: 1.7rem; padding: 2rem 1.5rem; text-align: center; color: #fff;
  background: linear-gradient(150deg, var(--c1, #2961ee), var(--c2, #6945dc)); box-shadow: 0 26px 60px rgba(0,0,0,.4);
  animation: cel-pop .45s cubic-bezier(.2,.9,.3,1.3) both; }
.share-card::before { content: ""; position: absolute; left: -3rem; bottom: -3rem; width: 11rem; height: 11rem; border-radius: 50%; background: rgba(255,255,255,.12); }
/* พรีวิว = ภาพ canvas เดียวกับไฟล์ที่บันทึก (parity) */
.share-card.is-image { padding: 0; background: transparent; }
.share-card.is-image::before { display: none; }
.share-card-img { display: block; width: 100%; border-radius: 1.7rem; }
.share-brand { position: relative; font-size: 1.5rem; font-weight: 800; letter-spacing: .05em; color: rgba(255,255,255,.85); }
.share-emoji { position: relative; display: block; margin: .6rem 0 .3rem; font-size: 4.5rem; line-height: 1; }
.share-name { position: relative; font-size: 2rem; font-weight: 800; line-height: 1.1; }
.share-tier { position: relative; margin-top: .2rem; font-size: .85rem; font-weight: 600; color: rgba(255,255,255,.9); }
.share-member { position: relative; margin-top: 1rem; font-size: 1.05rem; font-weight: 800; }
.share-rate { position: relative; margin-top: .2rem; font-size: .9rem; color: rgba(255,255,255,.95); }
.share-pctile { position: relative; margin-top: .15rem; font-size: .82rem; color: rgba(255,255,255,.85); }
.share-stats { position: relative; margin-top: 1rem; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .4rem; padding: .7rem .4rem; border-radius: 1.1rem; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); }
.share-stat { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.share-stat b { font-size: 1rem; font-weight: 800; line-height: 1.1; }
.share-stat span { font-size: .66rem; font-weight: 600; color: rgba(255,255,255,.85); }
.share-badges { position: relative; margin-top: .9rem; }
.share-badges-h { font-size: .72rem; font-weight: 700; color: rgba(255,255,255,.9); margin-bottom: .45rem; }
.share-badges-row { display: flex; justify-content: center; gap: .4rem; flex-wrap: wrap; }
.share-badge { width: 2.7rem; height: 2.7rem; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0,0,0,.25)); }
.share-app { position: relative; margin-top: 1.1rem; display: flex; align-items: center; gap: .7rem; text-align: left;
  padding: .7rem; border-radius: 1.1rem; background: rgba(255,255,255,.96); box-shadow: 0 8px 20px rgba(20,20,60,.18); }
.share-app-logo { width: 2.9rem; height: 2.9rem; flex-shrink: 0; border-radius: .8rem; object-fit: cover; }
.share-app-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .05rem; }
.share-app-text b { font-size: .95rem; font-weight: 800; color: #1b2a6b; line-height: 1.1; }
.share-app-text span { font-size: .64rem; font-weight: 600; color: #5a6588; line-height: 1.25; }
.share-app-cta { color: #2961ee !important; font-weight: 800 !important; margin-top: .12rem; }
.share-qr { flex-shrink: 0; width: 3.4rem; height: 3.4rem; padding: .2rem; border-radius: .5rem; background: #fff; }
.share-qr svg { display: block; width: 100%; height: 100%; }
.share-bonus:not(:empty) { text-align: center; border-radius: 999px; background: #FFF0B7; color: #9A6B00; padding: .5rem .9rem; font-size: .85rem; font-weight: 800; }
.share-actions { display: flex; gap: .7rem; }
.share-actions .saver-btn-ghost { background: rgba(255,255,255,.16); color: #fff; }
.share-actions .saver-btn-ghost:hover { background: rgba(255,255,255,.26); }

@media (prefers-reduced-motion: reduce) {
  #rate-sheet.show, #rule-sheet.show, #alert-popup.show, .rate-card, #saverclass-overlay.show, .share-card { animation: none; }
  .saver-fill, .vitality-fill, .health-fill { transition: none; }
  .tree-img, .tree-img-lg { animation: none; }
}

/* =========================================================
   Alert rules — CTA in notification card, settings rows, rule editor chips
   ========================================================= */
.notif-cta { margin-top: .6rem; display: inline-flex; align-items: center; gap: .25rem; border-radius: 999px;
  background: #EEF3FF; color: #2961EE; padding: .4rem .9rem; font-size: .78rem; font-weight: 800;
  transition: background .15s ease; }
.notif-cta:hover { background: #E0E9FF; }

/* settings list rows */
.rule-row { display: flex; align-items: center; gap: .7rem; border-radius: 1.1rem; background: #fff; padding: .85rem 1rem;
  box-shadow: 0 8px 22px rgba(20,33,90,.07); }
.rule-desc { flex: 1; min-width: 0; font-size: .85rem; font-weight: 600; color: #14215A; line-height: 1.4; }
.rule-desc.is-off { color: #94a3b8; }
.rule-switch { position: relative; flex-shrink: 0; width: 2.6rem; height: 1.5rem; border-radius: 999px; background: #cbd5e1; transition: background .2s ease; }
.rule-switch.is-on { background: linear-gradient(135deg, #2961ee, #6945dc); }
.rule-knob { position: absolute; top: 2px; left: 2px; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.2,.9,.3,1.3); }
.rule-switch.is-on .rule-knob { transform: translateX(1.1rem); }
.rule-icon-btn { flex-shrink: 0; font-size: 1rem; line-height: 1; padding: .25rem; border-radius: .5rem; transition: background .15s ease; }
.rule-icon-btn:hover { background: #f1f5f9; }

/* rule editor sheet fields */
.rule-field-label { margin: 1rem 0 .45rem; font-size: .8rem; font-weight: 700; color: #475569; }
.rule-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.rule-chip { border-radius: 999px; border: 1.5px solid #e2e8f0; background: #fff; padding: .45rem .9rem; font-size: .82rem; font-weight: 700; color: #475569; transition: all .15s ease; }
.rule-chip.is-active { border-color: transparent; background: linear-gradient(135deg, #2961ee, #6945dc); color: #fff; box-shadow: 0 6px 16px rgba(41,97,238,.25); }
.rule-preview { margin-top: 1rem; border-radius: .9rem; background: #EEF3FF; color: #1F4FD0; padding: .7rem .9rem; font-size: .82rem; font-weight: 700; text-align: center; }

/* =========================================================
   Demo Control Plane (#demo)
   ========================================================= */
.demo-note { border-radius: 1rem; background: #EEF3FF; color: #1F4FD0; padding: .8rem 1rem; font-size: .82rem; font-weight: 600; line-height: 1.5; }
.demo-note code { background: rgba(31,79,208,.12); border-radius: .3rem; padding: .05rem .3rem; font-weight: 700; }
.demo-group { border-radius: 1.3rem; background: #fff; padding: 1.1rem 1.1rem 1.25rem; box-shadow: 0 8px 22px rgba(20,33,90,.07); }
.demo-h { font-size: .95rem; font-weight: 800; color: #14215A; margin-bottom: .85rem; }
.demo-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.demo-btn { border-radius: .8rem; background: #f1f5f9; color: #334155; padding: .6rem .85rem; font-size: .82rem; font-weight: 700; transition: background .15s ease; }
.demo-btn:hover { background: #e2e8f0; }
.demo-btn-primary { background: linear-gradient(135deg, #2961ee, #6945dc); color: #fff; }
.demo-btn-primary:hover { filter: brightness(1.05); background: linear-gradient(135deg, #2961ee, #6945dc); }
.demo-btn-danger { background: #FBE3E8; color: #B14463; }
.demo-btn-danger:hover { background: #F6C4D0; }
.demo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem .7rem; }
.demo-field { display: flex; flex-direction: column; gap: .25rem; font-size: .74rem; font-weight: 700; color: #64748b; }
.demo-input { width: 100%; border-radius: .6rem; border: 1.5px solid #e2e8f0; padding: .45rem .6rem; font-size: .9rem; font-weight: 700; color: #14215A; }
.demo-input:focus { outline: none; border-color: #2961ee; }

/* =========================================================
   Reward Center — preview, catalog, vouchers, gifts, slide-to-use
   ========================================================= */
/* Profile preview card */
.reward-preview { border-radius: 1.5rem; background: #fff; padding: 1.1rem 1.1rem 1rem; box-shadow: 0 14px 34px rgba(20,33,90,.08); }
.reward-prev-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.reward-prev-coins { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; background: #FFF7DE; color: #9A6B00; padding: .35rem .7rem; font-size: .9rem; font-weight: 800; }
.reward-prev-rail { display: flex; gap: .6rem; overflow-x: auto; margin-top: .95rem; padding-bottom: .2rem; }
.reward-mini { flex: 0 0 8.8rem; text-align: left; border-radius: 1.1rem; overflow: hidden; display: flex; flex-direction: column;
  background: #fff; box-shadow: 0 10px 22px rgba(20,33,90,.12); transition: transform .18s ease; }
.reward-mini:hover { transform: translateY(-2px); }
.reward-mini .rwd-cover { border-radius: 0; aspect-ratio: 16/10; }
.reward-mini-body { display: flex; flex-direction: column; gap: .2rem; padding: .55rem .65rem .65rem; }
.reward-mini-name { font-size: .8rem; font-weight: 800; color: #14215A; line-height: 1.2; }
.reward-mini-cost { display: inline-flex; align-items: center; gap: .25rem; font-size: .95rem; font-weight: 800; color: #9A6B00; }
.reward-mini-cost small { font-size: .6rem; font-weight: 700; color: #94a3b8; }
.reward-prev-all { margin-top: .95rem; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border-radius: 999px; background: #EEF3FF; color: #1F4FD0; font-weight: 800; font-size: .9rem; padding: .65rem; }

/* Reward Center header coin chip + segmented tabs */
.reward-coin-chip { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; background: #FFF7DE; color: #9A6B00; padding: .4rem .8rem; font-size: .88rem; font-weight: 800; }
.reward-segments { display: grid; grid-template-columns: repeat(2, 1fr); gap: .3rem; background: #EEF1F8; border-radius: 999px; padding: .28rem; }
.reward-seg { border-radius: 999px; padding: .5rem .4rem; font-size: .88rem; font-weight: 800; color: #64748b; transition: all .18s ease; }
.reward-seg.is-active { background: #fff; color: #1F4FD0; box-shadow: 0 6px 16px rgba(20,33,90,.12); }

/* Catalog grid + cards */
.rwd-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.rwd-card { background: #fff; border-radius: 1.25rem; padding: .8rem; box-shadow: 0 12px 28px rgba(20,33,90,.08); display: flex; flex-direction: column; gap: .6rem; }
.rwd-vtop { display: flex; align-items: center; justify-content: space-between; gap: .4rem; border-radius: .95rem; padding: .75rem .85rem; color: #fff;
  background-image: linear-gradient(140deg, rgba(255,255,255,.16), rgba(20,33,90,.40)); background-color: var(--c, #2961ee); }
.rwd-brand { font-size: .92rem; font-weight: 800; }
.rwd-value { font-size: 1.15rem; font-weight: 800; }
.rwd-codetype { align-self: flex-start; font-size: .66rem; font-weight: 800; color: #64748b; background: #f1f5f9; border-radius: 999px; padding: .15rem .55rem; }
.rwd-gift-ico { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 1rem; color: #fff;
  background-image: linear-gradient(140deg, rgba(255,255,255,.18), rgba(20,33,90,.34)); background-color: var(--c, #2961ee); }
.rwd-gift-name { font-size: .92rem; font-weight: 800; color: #14215A; line-height: 1.25; }
.rwd-gift-desc { font-size: .76rem; color: #64748b; line-height: 1.35; }
.rwd-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.rwd-cost { display: inline-flex; align-items: center; gap: .25rem; font-size: 1rem; font-weight: 800; color: #9A6B00; }
.rwd-btn { border-radius: 999px; background: #2961ee; color: #fff; font-size: .82rem; font-weight: 800; padding: .45rem .95rem; box-shadow: 0 8px 18px rgba(41,97,238,.28); }
.rwd-btn:disabled { background: #e2e8f0; color: #94a3b8; box-shadow: none; cursor: not-allowed; }

/* "ของฉัน" — my vouchers + gift orders */
.reward-empty { text-align: center; color: #64748b; font-size: .92rem; line-height: 1.7; padding: 2.5rem 1rem; }
.reward-mine-head { font-size: .95rem; font-weight: 800; color: #14215A; margin: 1.2rem 0 .6rem; }
.reward-mine-head:first-child { margin-top: 0; }
.reward-mine-list { display: flex; flex-direction: column; gap: .6rem; }
.reward-mine-row { width: 100%; display: flex; align-items: center; gap: .75rem; text-align: left; background: #fff; border-radius: 1.1rem; padding: .8rem; box-shadow: 0 8px 20px rgba(20,33,90,.07); }
.reward-mine-row.is-used { opacity: .62; }
.reward-mine-ico { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; flex: 0 0 auto; border-radius: .85rem; color: #fff;
  background-image: linear-gradient(140deg, rgba(255,255,255,.18), rgba(20,33,90,.32)); background-color: var(--c, #2961ee); }
.reward-mine-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.reward-mine-main strong { font-size: .9rem; font-weight: 800; color: #14215A; }
.reward-mine-main small { font-size: .74rem; color: #64748b; }
.order-status { flex: 0 0 auto; font-size: .68rem; font-weight: 800; border-radius: 999px; padding: .25rem .6rem; white-space: nowrap; }
.order-status.is-active { background: #DDF5EA; color: #1E7A55; }
.order-status.is-used { background: #f1f5f9; color: #94a3b8; }
.order-status.is-processing { background: #FFF0B7; color: #9A6B00; }
.order-status.is-shipping { background: #E7F2FB; color: #1E6BA8; }
.order-status.is-delivered { background: #DDF5EA; color: #1E7A55; }
.order-status.is-expired { background: #FBE3E8; color: #B14463; }
.reward-mine-count { font-size: .72rem; font-weight: 800; color: #1F4FD0; background: #EEF3FF; border-radius: 999px; padding: .05rem .45rem; }
.reward-mine-sub { font-size: .72rem; font-weight: 600; color: #94a3b8; }
.used-stamp.is-expired { border-color: #94a3b8; color: #64748b; }

/* Voucher detail */
.voucher-hero { border-radius: 1.5rem; padding: 1.4rem; color: #fff; display: flex; flex-direction: column; gap: .2rem; text-align: center;
  background-image: linear-gradient(140deg, rgba(255,255,255,.14), rgba(20,33,90,.42)); background-color: var(--c, #2961ee); box-shadow: 0 16px 34px rgba(20,33,90,.20); }
.voucher-brand { font-size: 1rem; font-weight: 700; opacity: .92; }
.voucher-value { font-size: 2.4rem; font-weight: 800; line-height: 1.1; }
.voucher-name { font-size: .9rem; opacity: .92; }
.voucher-code { position: relative; margin-top: 1.1rem; background: #fff; border: 2px dashed #d6deec; border-radius: 1.25rem; padding: 1.4rem; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.voucher-code.is-used { filter: grayscale(.7); opacity: .7; }
.voucher-codebox { display: grid; place-items: center; min-height: 6rem; }
.voucher-codebox svg { width: 170px; height: 170px; }
.voucher-codebox svg.voucher-barcode { width: 100%; max-width: 250px; height: 72px; }
.voucher-codestr { font-size: .92rem; font-weight: 800; letter-spacing: .08em; color: #14215A; }
.voucher-fallback { font-size: 1.1rem; font-weight: 800; letter-spacing: .12em; color: #14215A; }
.used-stamp { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-12deg); border: 3px solid #B14463; color: #B14463; font-weight: 800; font-size: 1.1rem; border-radius: .6rem; padding: .3rem .9rem; background: rgba(255,255,255,.7); }
.voucher-exp { margin-top: .9rem; text-align: center; font-size: .84rem; font-weight: 700; color: #64748b; }
.voucher-terms { margin-top: 1.2rem; background: #fff; border-radius: 1.25rem; padding: 1.1rem 1.2rem; box-shadow: 0 10px 24px rgba(20,33,90,.06); }
.voucher-terms h3 { font-size: .92rem; font-weight: 800; color: #14215A; margin-bottom: .55rem; }
.voucher-terms ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.voucher-terms li { position: relative; padding-left: 1.1rem; font-size: .82rem; color: #475569; line-height: 1.45; }
.voucher-terms li::before { content: '•'; position: absolute; left: .2rem; color: #2961ee; font-weight: 800; }

/* Slide to use */
.slide-use { position: relative; margin-top: 1.4rem; height: 3.6rem; border-radius: 999px; background: #EEF1F8; overflow: hidden; display: flex; align-items: center; }
.slide-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 3.6rem; border-radius: 999px; background: linear-gradient(135deg, #2961ee, #6945dc); }
.slide-label { position: relative; z-index: 1; width: 100%; text-align: center; font-size: .9rem; font-weight: 800; color: #475569; padding-left: 1.5rem; pointer-events: none; }
.slide-thumb { position: absolute; left: 4px; top: 4px; z-index: 2; width: calc(3.6rem - 8px); height: calc(3.6rem - 8px); border-radius: 999px; background: linear-gradient(135deg, #2961ee, #6945dc); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(41,97,238,.4); cursor: grab; touch-action: none; }
.slide-thumb:active { cursor: grabbing; }
.slide-hint { margin-top: .55rem; text-align: center; font-size: .76rem; color: #94a3b8; }

/* Reward sheet — voucher confirm + gift checkout */
.reward-sheet-card { max-height: 90vh; overflow-y: auto; }
.sheet-reward { margin-top: .4rem; border-radius: 1.2rem; padding: 1.1rem; color: #fff; display: flex; flex-direction: column; gap: .15rem; text-align: center;
  background-image: linear-gradient(140deg, rgba(255,255,255,.14), rgba(20,33,90,.42)); background-color: var(--c, #2961ee); }
.sheet-reward.is-gift { text-align: left; }
.sheet-reward-brand { font-size: .88rem; font-weight: 700; opacity: .92; }
.sheet-reward-value { font-size: 1.8rem; font-weight: 800; }
.sheet-reward-name { font-size: 1rem; font-weight: 800; }
.sheet-reward-desc { font-size: .82rem; opacity: .92; }
.sheet-cost { margin-top: 1rem; text-align: center; font-size: .92rem; color: #475569; }
.sheet-cost b { color: #14215A; }
.addr-head { margin-top: 1.1rem; font-size: .88rem; font-weight: 800; color: #14215A; }
.addr-form { margin-top: .6rem; display: flex; flex-direction: column; gap: .6rem; }
.addr-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.addr-field { display: flex; flex-direction: column; gap: .25rem; font-size: .74rem; font-weight: 700; color: #64748b; }
.addr-field input { width: 100%; border-radius: .7rem; border: 1.5px solid #e2e8f0; padding: .55rem .7rem; font-size: .9rem; font-weight: 600; color: #14215A; }
.addr-field input:focus { outline: none; border-color: #2961ee; }
.addr-variant { margin-top: 1rem; }
.addr-variant-label { font-size: .82rem; font-weight: 800; color: #14215A; }
.addr-variant-opts { margin-top: .5rem; display: flex; flex-wrap: wrap; gap: .45rem; }
.variant-chip { border-radius: 999px; border: 1.5px solid #e2e8f0; background: #fff; color: #475569; font-size: .82rem; font-weight: 800; padding: .4rem .9rem; }
.variant-chip.is-active { border-color: #2961ee; background: #EEF3FF; color: #1F4FD0; }

/* Catalog card with cover + reward detail (T-026) */
.rwd-cover { position: relative; aspect-ratio: 16/9; border-radius: 1.1rem 1.1rem 0 0; overflow: hidden; display: flex; align-items: flex-end; padding: .7rem .8rem;
  background-image: linear-gradient(150deg, rgba(255,255,255,.12), rgba(20,33,90,.5)); background-color: var(--c, #2961ee); color: #fff; }
.rwd-cover.is-big { aspect-ratio: 16/8; border-radius: 1.4rem; padding: 1rem 1.1rem; }
.rwd-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.rwd-cover-img + .rwd-cover-emoji { opacity: 0; }
.rwd-cover-emoji { position: absolute; right: -.4rem; top: 50%; transform: translateY(-50%) rotate(-8deg); font-size: 4.2rem; line-height: 1; opacity: .9; filter: drop-shadow(0 6px 10px rgba(20,33,90,.3)); z-index: 0; }
.rwd-cover.is-big .rwd-cover-emoji { font-size: 6rem; right: .2rem; }
.rwd-cover-info { position: relative; z-index: 1; display: flex; flex-direction: column; text-shadow: 0 2px 8px rgba(20,33,90,.4); }
.rwd-cover-brand { font-size: .95rem; font-weight: 800; }
.rwd-cover.is-big .rwd-cover-brand { font-size: 1.2rem; }
.rwd-cover-value { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.rwd-cover.is-big .rwd-cover-value { font-size: 2.2rem; }
.rwd-cover-stock { position: absolute; top: .55rem; right: .55rem; z-index: 1; font-size: .64rem; font-weight: 800; color: #B14463; background: #fff; border-radius: 999px; padding: .18rem .55rem; box-shadow: 0 4px 10px rgba(20,33,90,.18); }
.rwd-card2 { display: flex; flex-direction: column; text-align: left; background: #fff; border-radius: 1.1rem; box-shadow: 0 12px 28px rgba(20,33,90,.08); overflow: hidden; transition: transform .18s ease; }
.rwd-card2:hover { transform: translateY(-3px); }
.rwd-card2.is-soldout { opacity: .55; filter: grayscale(.4); }
.rwd-card2-body { display: flex; flex-direction: column; gap: .45rem; padding: .7rem .8rem .8rem; flex: 1; }
.rwd-card2-name { font-size: .9rem; font-weight: 800; color: #14215A; line-height: 1.25; }
.rwd-card2-meta { display: flex; flex-wrap: wrap; gap: .3rem; }
.rwd-chip { font-size: .62rem; font-weight: 800; color: #1F4FD0; background: #EEF3FF; border-radius: 999px; padding: .14rem .5rem; }
.rwd-chip-soft { color: #64748b; background: #f1f5f9; }
.rwd-open { font-size: .74rem; font-weight: 800; color: #1F4FD0; }

.rwd-detail-name { margin-top: 1rem; font-size: 1.3rem; font-weight: 800; color: #14215A; line-height: 1.3; }
.rwd-detail-desc { margin-top: .35rem; font-size: .9rem; color: #475569; line-height: 1.55; }
.rwd-meta { margin-top: 1.1rem; background: #fff; border-radius: 1.25rem; padding: .4rem 1.1rem; box-shadow: 0 10px 24px rgba(20,33,90,.06); }
.rwd-meta-row { display: flex; align-items: center; gap: .7rem; padding: .7rem 0; border-bottom: 1px solid #f1f5f9; }
.rwd-meta-row:last-child { border-bottom: 0; }
.rwd-meta-ico { display: grid; place-items: center; width: 2rem; height: 2rem; flex: 0 0 auto; border-radius: .6rem; background: #EEF3FF; color: #2961ee; }
.rwd-meta-label { font-size: .84rem; color: #64748b; }
.rwd-meta-val { margin-left: auto; text-align: right; font-size: .86rem; font-weight: 700; color: #14215A; }
.rwd-detail-terms { margin-top: 1.1rem; background: #fff; border-radius: 1.25rem; padding: 1.1rem 1.2rem; box-shadow: 0 10px 24px rgba(20,33,90,.06); }
.rwd-detail-terms h3 { font-size: .92rem; font-weight: 800; color: #14215A; margin-bottom: .55rem; }
.rwd-detail-terms ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.rwd-detail-terms li { position: relative; padding-left: 1.1rem; font-size: .82rem; color: #475569; line-height: 1.45; }
.rwd-detail-terms li::before { content: '•'; position: absolute; left: .2rem; color: #2961ee; font-weight: 800; }
.rwd-detail-cta { position: sticky; bottom: 0; margin: 1.2rem -1px 0; padding: .8rem 0 .2rem; display: flex; align-items: center; gap: .8rem; background: linear-gradient(to top, var(--page-bg, #f7faf8) 72%, transparent); }
.rwd-detail-cost { display: inline-flex; align-items: center; gap: .3rem; font-size: 1rem; font-weight: 800; color: #9A6B00; white-space: nowrap; }
.rwd-redeem-btn { flex: 1; border-radius: 999px; background: linear-gradient(135deg, #2961ee, #6945dc); color: #fff; font-size: .98rem; font-weight: 800; padding: .85rem; box-shadow: 0 12px 26px rgba(41,97,238,.32); }
.rwd-redeem-btn:disabled { background: #e2e8f0; color: #94a3b8; box-shadow: none; cursor: not-allowed; }

.voucher-number { font-size: 1.7rem; font-weight: 800; letter-spacing: .14em; color: #14215A; text-align: center; }

/* Marketplace — featured banner, popular/new rails, badges (T-027) */
.rwd-badges { position: absolute; top: .5rem; left: .5rem; z-index: 1; display: flex; gap: .3rem; }
.rwd-badge { font-size: .62rem; font-weight: 800; border-radius: 999px; padding: .15rem .5rem; box-shadow: 0 4px 10px rgba(20,33,90,.18); }
.rwd-badge.is-new { background: #FFF0B7; color: #9A6B00; }
.rwd-badge.is-hot { background: #FBE3E8; color: #B14463; }
.rwd-section-head { font-size: 1rem; font-weight: 800; color: #14215A; margin: 1.4rem 0 .7rem; }
.rwd-rail-sec:first-child .rwd-section-head, .rwd-feature + .rwd-rail-sec .rwd-section-head { margin-top: 1.4rem; }
.rwd-rail { display: flex; gap: .8rem; overflow-x: auto; padding-bottom: .3rem; }
.rwd-railcard { flex: 0 0 9.6rem; display: flex; flex-direction: column; text-align: left; background: #fff; border-radius: 1.1rem; box-shadow: 0 12px 26px rgba(20,33,90,.09); overflow: hidden; transition: transform .18s ease; }
.rwd-railcard:hover { transform: translateY(-3px); }
.rwd-railcard-body { display: flex; flex-direction: column; gap: .3rem; padding: .6rem .7rem .7rem; }
.rwd-railcard-name { font-size: .82rem; font-weight: 800; color: #14215A; }
.rwd-railcount { font-size: .66rem; font-weight: 800; color: #B14463; }
.rwd-railcount.is-soft { color: #1E6BA8; }
.line-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* Featured highlight banner */
.rwd-feature { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; text-align: left; overflow: hidden;
  border-radius: 1.5rem; padding: 1.2rem 1.3rem; color: #fff; min-height: 9.5rem;
  background-image: linear-gradient(135deg, rgba(255,255,255,.16), rgba(20,33,90,.5)); background-color: var(--c, #2961ee); box-shadow: 0 18px 38px rgba(20,33,90,.22); }
.rwd-feature-illo { position: absolute; right: -1.2rem; bottom: -1rem; width: 9.5rem; opacity: .9; z-index: 0; filter: drop-shadow(0 8px 14px rgba(20,33,90,.25)); }
.rwd-feature-emoji { position: absolute; right: 6.6rem; top: .9rem; font-size: 2.6rem; opacity: .85; z-index: 0; transform: rotate(-8deg); }
.rwd-feature-tag { position: relative; z-index: 1; font-size: .68rem; font-weight: 800; background: rgba(255,255,255,.24); border-radius: 999px; padding: .2rem .6rem; }
.rwd-feature-brand { position: relative; z-index: 1; margin-top: .35rem; font-size: 1.4rem; font-weight: 800; text-shadow: 0 2px 8px rgba(20,33,90,.4); }
.rwd-feature-name { position: relative; z-index: 1; font-size: .86rem; opacity: .94; max-width: 64%; line-height: 1.35; text-shadow: 0 2px 8px rgba(20,33,90,.35); }
.rwd-feature-cta { position: relative; z-index: 1; margin-top: .7rem; display: inline-flex; align-items: center; gap: .7rem; }
.rwd-feature-cost { display: inline-flex; align-items: center; gap: .3rem; background: rgba(255,255,255,.95); color: #9A6B00; font-weight: 800; font-size: .86rem; border-radius: 999px; padding: .35rem .8rem; }
.rwd-feature-go { font-size: .86rem; font-weight: 800; }

/* Stock breakdown (สิทธิ์ทั้งหมด/คงเหลือ/แลกไปแล้ว) */
.rwd-stock-head { margin-top: 1.2rem; font-size: .88rem; font-weight: 800; color: #14215A; }
.rwd-stock { margin-top: .5rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; background: #fff; border-radius: 1.1rem 1.1rem 0 0; padding: 1rem .8rem .9rem; box-shadow: 0 10px 24px rgba(20,33,90,.06); }
.rwd-stock.is-unlimited { border-radius: 1.1rem; grid-template-columns: 1fr; text-align: center; }
.rwd-stock-unl { font-size: 1rem; font-weight: 800; color: #1F4FD0; }
.rwd-stock-stat { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.rwd-stock-stat b { font-size: 1.5rem; font-weight: 800; color: #14215A; line-height: 1.1; }
.rwd-stock-stat.is-rem b { color: #1E7A55; }
.rwd-stock-stat span { font-size: .72rem; color: #64748b; }
.rwd-stock-bar { height: .5rem; border-radius: 0 0 1.1rem 1.1rem; background: #EEF1F8; overflow: hidden; box-shadow: 0 10px 24px rgba(20,33,90,.06); }
.rwd-stock-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22c55e, #16a394); }

/* Voucher code-view toggle (รหัส / บาร์โค้ด / QR — same code string) */
.voucher-views { margin-top: .9rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; background: #EEF1F8; border-radius: 999px; padding: .28rem; }
.vview { border-radius: 999px; padding: .5rem; font-size: .86rem; font-weight: 800; color: #64748b; transition: all .18s ease; }
.vview.is-active { background: #fff; color: #1F4FD0; box-shadow: 0 6px 16px rgba(20,33,90,.12); }
.voucher-textcode { font-size: 1.9rem; font-weight: 800; letter-spacing: .22em; color: #14215A; text-align: center; padding: 1.2rem .4rem; word-break: break-all; }

/* Redeem confetti burst */
.redeem-confetti { position: fixed; inset: 0; z-index: 90; overflow: hidden; pointer-events: none; }
/* canvas-confetti layer (School Pride) — top-most, click-through */
#fx-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 95; }

@media (prefers-reduced-motion: reduce) {
  #reward-sheet.show, .reward-mini, .reward-mine-row, .rwd-card2, .rwd-railcard, .vview { animation: none; transition: none; }
  .redeem-confetti, #fx-confetti { display: none; }
}
