/* สมาชิกหยกสด — mobile-first 390 px, max 430 px (รวมเมนูล่าง) · โทนตาม mockup CRM หยกสด C1–C5 (2026-10-17) */
:root {
  --green: #227f24; --green-dark: #1c651c; --green-mid: #52a33d; --green-light: #87cc57; --lime: #8fd25c;
  --bg: #f4f9ee; --ink: #0d2615; --muted: #4e6352; --line: #eaf2e4; --field: #eef6e6; --mint: #e8f7dc; --sun: #ffd84d;
  --red: #a12c22; --red-line: #d9a19b; --card: #ffffff; --r: 24px; --r2: 18px; --shadow: 0 6px 20px rgba(34,127,36,.10);
  --maxw: 430px; --nav-h: 86px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* .card sets display:flex, which would otherwise beat the hidden attribute */
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Sarabun, "Noto Sans Thai Looped", system-ui, sans-serif; font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
h1, h2, h3, .pr, .logo { font-family: Prompt, Sarabun, sans-serif; font-weight: 600; margin: 0; }
h1 { font-size: 24px; } h2 { font-size: 17px; padding-top: 4px; } h3 { font-size: 16px; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
#app { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); position: relative; }
body.nonav #app { padding-bottom: 24px; }

/* hero */
.hero { position: relative; background: var(--green); color: #fff; border-radius: 0 0 28px 28px; padding: 18px 18px 56px; overflow: hidden; }
.hero.short { padding-bottom: 44px; }
.hero .grass { position: absolute; right: -4px; bottom: 32px; width: 176px; height: 104px; pointer-events: none; }
.hero .brand { display: flex; align-items: center; gap: 10px; position: relative; }
.hero .mark { width: 40px; height: 40px; border-radius: 12px; border: 2px solid #fff; background: var(--green-dark); object-fit: cover; flex-shrink: 0; display: block; }   /* หยกสด logo (web/assets/icon.png) */
.splash .logo-img { width: 150px; height: auto; display: block; }
.hero .hi { font-family: Prompt, Sarabun, sans-serif; font-size: 20px; font-weight: 600; line-height: 1.25; }
.hero .sub { font-size: 13px; opacity: .95; }
.hero .big { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; position: relative; }
.hero .big b { font-family: Prompt, Sarabun, sans-serif; font-size: 56px; font-weight: 700; line-height: 1.1; }
.hero .big span { font-family: Prompt, Sarabun, sans-serif; font-size: 18px; font-weight: 500; }
.hero h1 { position: relative; font-size: 26px; font-weight: 700; }
.hero .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--green-dark); border-radius: 999px; padding: 4px; margin-top: 14px; position: relative; }
.hero .seg button { height: 38px; border-radius: 999px; border: 0; background: transparent; color: #fff; font-size: 13.5px; font-weight: 600; }
.hero .seg button.on { background: var(--lime); color: var(--ink); }
.hero .back { color: #fff; text-decoration: none; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; position: relative; margin-bottom: 8px; }

/* body under hero */
.bd { padding: 0 16px; display: flex; flex-direction: column; gap: 12px; margin-top: -40px; position: relative; }
.bd.flat { margin-top: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.lime { background: var(--lime); color: var(--ink); } .pill.sun { background: var(--sun); color: var(--ink); } .pill.mint { background: var(--mint); color: var(--green-dark); } .pill.gray { background: #eef1ec; color: var(--muted); } .pill.cream { background: #fff; color: var(--muted); }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.tight { gap: 4px; }
.mut { color: var(--muted); font-size: 13px; line-height: 1.45; }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.sb { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* buttons */
.cta { width: 100%; height: 54px; border-radius: 999px; border: 0; background: var(--green); color: #fff; font-size: 16px; font-weight: 700; box-shadow: 0 8px 20px rgba(34,127,36,.28); display: flex; align-items: center; justify-content: center; text-decoration: none; }
/* LINE sign-in: quiet outline, the phone OTP button stays the primary one (คุณจ๊าก 2026-10-18 00:20 "สีอย่าเด่นมาก") */
.cta.line { background: #fff; color: var(--ink); border: 1.5px solid #cfe3d2; box-shadow: none; font-weight: 600; }
.ghost { display: flex; align-items: center; justify-content: center; height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--green); background: #fff; color: var(--green); font-size: 14px; font-weight: 700; text-decoration: none; width: 100%; }
.ghost.dng { border-color: var(--red-line); color: var(--red); }
.ghost.s { height: 36px; width: auto; font-size: 13px; padding: 0 12px; }
.go { height: 40px; border-radius: 999px; border: 0; background: var(--green); color: #fff; font-size: 14px; font-weight: 700; }
button:disabled, .go:disabled { opacity: .45; cursor: default; }
.lk { background: none; border: 0; color: var(--green); font-weight: 700; font-size: 14px; padding: 6px 4px; }

/* fields */
.fld { display: flex; flex-direction: column; gap: 4px; }
.lb { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.in, input:not([type=checkbox]), select, textarea { height: 44px; border: 0; border-radius: 14px; padding: 0 14px; font-size: 15px; color: var(--ink); background: var(--field); width: 100%; }
textarea { height: auto; padding: 10px 14px; }
input.code { font: 600 28px Prompt, Sarabun; letter-spacing: 10px; text-align: center; height: 56px; }
.sw { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 14px; background: #cfdcc8; position: relative; margin: 0; flex-shrink: 0; cursor: pointer; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s; }
.sw:checked { background: var(--green); } .sw:checked::after { left: 23px; }
.tg { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; line-height: 1.4; min-height: 48px; border-top: 1px solid var(--line); padding: 6px 0; }
.tg:first-child { border-top: 0; }
.tg .t { font-size: 14.5px; font-weight: 600; }
.li { display: flex; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; }
.li .ic { width: 36px; height: 36px; border-radius: 12px; background: var(--mint); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.li .ic svg, .qa svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.li .k { font-size: 12.5px; color: var(--muted); } .li .v { font-size: 15px; font-weight: 600; }
.mv { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.mv:first-child { border-top: 0; }
.mv b.plus { color: var(--green); } .mv b.minus { color: var(--red); }

/* QR */
.qrbox { display: flex; gap: 14px; align-items: center; }
.qrbox .qr { width: 150px; height: 150px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.qrbox .qr svg { width: 150px; height: 150px; }
.qrbox .qrtxt { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* tier card + pixel bar */
.art { position: relative; border-radius: var(--r2); overflow: hidden; background: linear-gradient(135deg, var(--green) 0%, var(--green-mid) 60%, var(--green-light) 100%); color: #fff; padding: 18px 16px; min-height: 120px; display: flex; flex-direction: column; justify-content: flex-end; }
.art .tiername { position: absolute; left: 16px; top: 16px; padding: 4px 14px; border-radius: 999px; background: var(--green-dark); font-family: Prompt, Sarabun, sans-serif; font-weight: 600; font-size: 14px; }
.art .id { font-family: Prompt, Sarabun, sans-serif; font-size: 18px; letter-spacing: 1px; }
.art .grass2 { position: absolute; right: 0; bottom: -6px; width: 150px; height: 88px; opacity: .55; }
.px { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 3px; }
.px span { height: 14px; border-radius: 3px; background: #e1eedb; }
.px span.f { background: var(--green-mid); } .px span.n { background: var(--lime); }

/* quick actions */
.qa { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.qa a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink); text-decoration: none; min-height: 44px; text-align: center; }
.qa i { width: 52px; height: 52px; border-radius: 18px; background: var(--lime); display: flex; align-items: center; justify-content: center; }
.qa svg { width: 24px; height: 24px; }

/* rewards grid */
.rgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rw { position: relative; background: #fff; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.rw .img { width: 100%; height: 108px; object-fit: cover; display: block; background: linear-gradient(135deg, var(--mint), var(--green-light)); }
.rw .pt { position: absolute; left: 8px; top: 8px; padding: 3px 10px; border-radius: 999px; background: var(--lime); color: var(--ink); font-family: Prompt, Sarabun, sans-serif; font-weight: 600; font-size: 13px; }
.rw .rb { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; flex-grow: 1; }
.rw .rt { font-size: 14px; font-weight: 600; line-height: 1.3; }
.rw .go { margin-top: auto; }
.perks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.perk { background: #eaf6dc; border-radius: 20px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.perk small { font-size: 12px; color: #2c583d; }

/* coupon tickets */
.tk { position: relative; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 6px 18px rgba(34,127,36,.12); }
.tk .img { width: 100%; aspect-ratio: 2 / 1; height: auto; object-fit: cover; display: block; background: linear-gradient(135deg, var(--green), var(--green-light)); }
.tk div.img { aspect-ratio: auto; height: 96px; }   /* no picture: a short green band instead of a 2:1 blank */
.tk .tb { position: relative; border-top: 2px dashed #dbe8d3; margin: 0 16px; padding: 12px 0 14px; display: flex; flex-direction: column; gap: 6px; }
/* the two notches sit exactly on the dashed line whatever the image height */
.tk .tb::before, .tk .tb::after { content: ''; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); }
.tk .tb::before { left: -27px; } .tk .tb::after { right: -27px; }
.tk .tt { font-family: Prompt, Sarabun, sans-serif; font-weight: 600; font-size: 16px; line-height: 1.3; }
.tk .eff { font-family: Prompt, Sarabun, sans-serif; font-weight: 600; font-size: 15px; color: var(--green-dark); }
.tk .desc { font-size: 13.5px; line-height: 1.45; white-space: pre-line; }
.tk.dim { opacity: .6; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.45; padding: 0 2px; }

/* notices */
.warn { background: #fff7d6; border: 1px solid var(--sun); border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.err { background: #fde9e7; border: 1px solid #f1b9b3; border-radius: 14px; padding: 12px 14px; font-size: 14px; color: var(--red); }
.ok { background: var(--mint); border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.bar { height: 8px; background: var(--mint); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green-mid); }
.splash { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; gap: 8px; padding: 24px; }
.logo { font-size: 32px; color: var(--green); letter-spacing: 1px; }
.links { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; padding: 4px 2px 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; border-radius: 99px; background: var(--mint); color: var(--green-dark); font-size: 13px; border: 0; }
.chip.on { background: var(--green); color: #fff; }
.msg { padding: 10px 0; border-top: 1px solid var(--line); }
.msg:first-child { border-top: 0; }
.msg.unread .t::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px; }
.msg .t { font-weight: 600; }
.kpi { text-align: center; }
.kpi .v { font: 600 22px Prompt, Sarabun; color: var(--green-dark); }
.kpi .l { font-size: 12px; color: var(--muted); }

/* floating bottom nav (4 tabs) */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; padding: 8px 12px calc(14px + env(safe-area-inset-bottom)); pointer-events: none; }
#tabs .nav { max-width: calc(var(--maxw) - 24px); margin: 0 auto; background: #fff; border-radius: 22px; box-shadow: 0 8px 24px rgba(13,38,21,.12); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px; gap: 4px; pointer-events: auto; }
#tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: 16px; font-size: 12px; color: var(--muted); text-decoration: none; }
#tabs a.on { background: var(--lime); color: var(--ink); font-weight: 700; }
#tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 12px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 99px; font-size: 14px; z-index: 9; max-width: 90vw; }
#toast.bad { background: var(--red); }
@media (min-width: 480px) { body { background: #e9f1e2; } #app { background: var(--bg); box-shadow: 0 0 0 1px #dce8d4; } }
/* LINE Login option on the sign-in card (คำสั่งคุณจ๊าก 2026-10-17 23:55) */
.cta.line { display: flex; align-items: center; justify-content: center; gap: 10px; }
.cta.line .line-ic { display: inline-flex; align-items: center; justify-content: center; height: 24px; padding: 0 7px; border-radius: 6px; background: #06c755; color: #fff; font-family: Prompt, Sarabun, sans-serif; font-weight: 800; font-size: 11px; letter-spacing: .5px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: #dbe8d3; }
