/* FamilyMandarin Club — Telegram Mini App */
:root {
  --amber: #F5B301;
  --amber2: #FFC83D;
  --amber-ink: #C98F00;
  --amber-soft: #FFF4D6;
  --ink: #1A1A1A;
  --bg: #F7F7F8;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --muted: #7A7A80;
  --line: #ECECEF;
  --green: #16A34A;
  --green-soft: #E7F7EC;
  --red: #E5383B;
  --red-soft: #FDECEC;
  --grey-soft: #EFEFF2;
  --shadow: 0 2px 10px rgba(20, 20, 30, .06);
  --sk: #ECECEF;
  --sk2: #F6F6F8;
  --banner: linear-gradient(110deg, #D7E9FF 0%, #EAF3FF 55%, #FFF3D0 100%);
  --cw: calc(min(100vw, 480px) - 32px);
  --u: calc(var(--cw) / 100);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root.dark {
  --bg: #0F0F11;
  --surface: #1C1C1F;
  --text: #F3F3F5;
  --muted: #9A9AA3;
  --line: #2A2A2F;
  --amber-soft: #3A2F10;
  --amber-ink: #FFC83D;
  --green: #34D27B;
  --green-soft: #12301F;
  --red: #FF6B6B;
  --red-soft: #3A1717;
  --grey-soft: #2A2A2F;
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  --sk: #26262A;
  --sk2: #303035;
  --banner: linear-gradient(110deg, #1B2A40 0%, #1E2635 55%, #3A2F10 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.fill { fill: currentColor; stroke: none; }
h1, h2, h3, p { margin: 0; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; }
#view { padding: 14px 16px calc(96px + var(--safe-b)); }
#view.nonav { padding-bottom: calc(28px + var(--safe-b)); }
.fade { animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.row { display: flex; align-items: center; }
.gap { gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.plus { color: var(--green); }
.minus { color: var(--red); }
.box {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.section-title { font-size: 17px; font-weight: 700; margin: 22px 2px 10px; }

/* ---------- top bar (sub screens) ---------- */
.topbar { display: flex; align-items: center; gap: 10px; height: 40px; margin: -4px 0 8px; }
.topbar h1 { font-size: 19px; font-weight: 700; }
.back { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; margin-left: -6px; }
.back:active { background: var(--grey-soft); }

/* ---------- home header ---------- */
.hello { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: var(--amber2);
  display: grid; place-items: center; font-weight: 700; font-size: 17px; overflow: hidden; flex: none;
  box-shadow: 0 0 0 2px var(--amber);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.hello small { display: block; color: var(--muted); font-size: 13px; }
.hello b { display: block; font-size: 18px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 21px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); flex: none;
}

/* ---------- loyalty card (printed card in HTML) ---------- */
.card3d { perspective: 1200px; width: var(--cw); aspect-ratio: 85.6 / 54; margin: 0 auto; cursor: pointer; }
.card-inner { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.3, .7, .3, 1); transform-style: preserve-3d; }
.card3d.flipped .card-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; border-radius: calc(var(--u) * 4.6); overflow: hidden;
  background: linear-gradient(160deg, #FFFFFF 0%, #FBFBFB 60%, #F3F3F3 100%);
  color: #1A1A1A; -webkit-backface-visibility: hidden; backface-visibility: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .14), 0 1px 3px rgba(0, 0, 0, .08);
  font-family: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
:root.dark .face { box-shadow: 0 10px 28px rgba(0, 0, 0, .55); }
.face.rear { transform: rotateY(180deg); display: flex; flex-direction: column; padding: calc(var(--u) * 4.2) calc(var(--u) * 6) calc(var(--u) * 3); }
.wm { position: absolute; height: auto; width: calc(var(--u) * 46); right: calc(var(--u) * -4); top: calc(var(--u) * 1); pointer-events: none; }
.face.rear .wm { width: calc(var(--u) * 30); right: calc(var(--u) * -12); top: calc(var(--u) * 24); }
.f-logo { position: absolute; left: calc(var(--u) * 7.6); top: calc(var(--u) * 8); width: calc(var(--u) * 35); }
.f-bottom { position: absolute; left: calc(var(--u) * 8); right: calc(var(--u) * 4.5); bottom: calc(var(--u) * 7); display: flex; align-items: center; }
.f-lbl { font-size: calc(var(--u) * 2.4); font-weight: 500; color: #333; letter-spacing: .02em; }
.f-big { font-size: calc(var(--u) * 4.3); font-weight: 800; letter-spacing: .01em; line-height: 1.15; white-space: nowrap; }
.f-div { width: 1.5px; align-self: stretch; background: #2A2A2A; margin: 0 calc(var(--u) * 5) 0 calc(var(--u) * 6); opacity: .85; }
.f-head { color: var(--amber); font-size: calc(var(--u) * 6.4); margin-right: calc(var(--u) * 2.8); stroke-width: 2.2; }
.f-nfc { margin-left: auto; font-size: calc(var(--u) * 6); stroke-width: 2.2; }
.b-top { display: flex; align-items: flex-start; justify-content: space-between; }
.b-logo { width: calc(var(--u) * 25); margin-top: calc(var(--u) * .6); }
.b-season { display: flex; align-items: flex-start; gap: calc(var(--u) * 3); }
.b-season svg { color: var(--amber); font-size: calc(var(--u) * 5.6); stroke-width: 2; margin-top: calc(var(--u) * .3); }
.b-season b { display: block; font-size: calc(var(--u) * 3.9); font-weight: 800; line-height: 1.1; }
.b-season i { display: block; font-size: calc(var(--u) * 2.2); color: #333; }
.b-mid { flex: 1; display: flex; align-items: center; margin-top: calc(var(--u) * 1.5); }
.b-qr {
  width: calc(var(--u) * 27); height: calc(var(--u) * 27); flex: none; background: #fff;
  border: calc(var(--u) * 1.1) solid var(--amber); border-radius: calc(var(--u) * 3.4); padding: calc(var(--u) * 1.6);
  display: grid; place-items: center; margin-left: calc(var(--u) * 1.6);
}
.b-qr img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.b-vl { width: calc(var(--u) * .45); height: calc(var(--u) * 22); background: var(--amber); margin: 0 calc(var(--u) * 4.5) 0 calc(var(--u) * 4.5); border-radius: 2px; }
.b-txt { flex: 1; min-width: 0; }
.b-txt h4 { margin: 0; font-size: calc(var(--u) * 3.5); line-height: 1.2; font-weight: 800; }
.b-ul { width: calc(var(--u) * 11); height: calc(var(--u) * .5); background: var(--amber); margin: calc(var(--u) * 2.2) 0 calc(var(--u) * 2.4); border-radius: 2px; }
.b-scan { display: flex; gap: calc(var(--u) * 2.4); align-items: flex-start; }
.b-scan svg { color: var(--amber); font-size: calc(var(--u) * 5.8); stroke-width: 1.8; }
.b-scan b { display: block; font-size: calc(var(--u) * 3); font-weight: 700; line-height: 1.15; }
.b-scan span { display: block; font-size: calc(var(--u) * 2.05); color: #333; line-height: 1.3; margin-top: calc(var(--u) * .5); }
.b-foot {
  display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #E6E6E6;
  padding-top: calc(var(--u) * 2); margin-top: calc(var(--u) * 2); font-size: calc(var(--u) * 2.1); font-weight: 500; white-space: nowrap;
}
.b-foot span { display: flex; align-items: center; gap: calc(var(--u) * 1.4); }
.b-foot svg { color: var(--amber); font-size: calc(var(--u) * 3.6); }
.b-foot i { width: 1px; height: calc(var(--u) * 3.6); background: #333; }
.flip-hint { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }

/* ---------- home tiles ---------- */
.big-tiles { display: grid; grid-template-columns: 1.08fr 1fr; gap: 10px; margin-top: 12px; }
.t-bonus, .t-pkg { border-radius: 18px; padding: 14px 14px 12px; min-height: 104px; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; }
.t-bonus { background: linear-gradient(135deg, #F5B301 0%, #FFC83D 100%); color: #1A1A1A; box-shadow: 0 6px 18px rgba(245, 179, 1, .35); }
.t-bonus::after { content: ""; position: absolute; right: -24px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.t-pkg { background: #1A1A1A; color: #fff; border: 1.5px solid #3A3A3A; }
:root.dark .t-pkg { background: #000; border-color: #5A4A1A; }
.t-lbl { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.t-pkg .t-lbl { color: var(--amber2); text-transform: none; letter-spacing: 0; font-weight: 600; }
.t-val { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -.02em; position: relative; z-index: 1; }
.t-pkg .t-val { font-size: 25px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub { font-size: 11.5px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }

.mini { display: flex; align-items: center; gap: 10px; padding: 11px 12px; }
.ico {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--amber-soft); color: var(--amber); font-size: 20px;
}
.mini small { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; }
.mini b { display: block; font-size: 16px; font-weight: 700; white-space: nowrap; }

.club-banner {
  margin-top: 12px; border-radius: 18px; background: var(--banner); padding: 14px 14px 14px 96px;
  position: relative; overflow: hidden; min-height: 70px; display: flex; flex-direction: column; justify-content: center;
}
.club-banner b { font-size: 15px; font-weight: 800; }
.club-banner span { font-size: 13px; color: var(--muted); }
.club-banner .plane { position: absolute; left: 10px; top: 50%; transform: translateY(-50%) rotate(-8deg); width: 78px; height: 78px; }

.navtile { display: flex; align-items: center; gap: 9px; padding: 11px 10px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.navtile .ico { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
.navtile .chev { margin-left: auto; color: var(--muted); }
.navtile:active, .mini:active, .list-row:active, .vcard:active { transform: scale(.98); }
.navtile, .mini, .list-row, .vcard { transition: transform .12s; }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface);
  border-top: 1px solid var(--line); padding: 8px 8px calc(8px + var(--safe-b));
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .04);
}
.nav[hidden] { display: none; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 500; color: var(--muted); padding: 4px 0; cursor: pointer; }
.nav a svg { font-size: 23px; }
.nav a.active { color: var(--amber-ink); font-weight: 700; }
.nav a.active svg { fill: var(--amber); stroke: var(--amber-ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px;
  border-radius: 14px; font-weight: 700; font-size: 15px; background: linear-gradient(135deg, #F5B301, #FFC83D); color: #1A1A1A;
  box-shadow: 0 4px 14px rgba(245, 179, 1, .35);
}
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: var(--surface); box-shadow: none; border: 1.5px solid var(--line); color: var(--text); }
.btn.sm { height: 40px; font-size: 14px; padding: 0 18px; border-radius: 12px; }
.btn:active { transform: scale(.97); }

/* ---------- bonus ---------- */
.hero { text-align: center; padding: 6px 0 4px; }
.star {
  width: 66px; height: 66px; border-radius: 50%; margin: 4px auto 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #F5B301, #FFC83D); color: #fff; font-size: 32px; box-shadow: 0 6px 18px rgba(245, 179, 1, .4);
}
.hero h2 { font-size: 17px; font-weight: 600; }
.hero .num { font-size: 46px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.stats .box { padding: 10px 4px; text-align: center; }
.stats small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; }
.stats b { display: block; font-size: 18px; font-weight: 700; margin-top: 2px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; }
.list-row .grow small { display: block; font-size: 12px; color: var(--muted); }
.list-row .grow b { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amt { font-weight: 700; font-size: 16px; white-space: nowrap; }
.ico.red { background: var(--red-soft); color: var(--red); }
.ico.green { background: var(--green-soft); color: var(--green); }
.ico.blue { background: #E6F0FF; color: #2F80ED; }
:root.dark .ico.blue { background: #16253D; color: #6EA8FF; }
.ico.dark { background: var(--ink); color: var(--amber2); }
.ico.grey { background: var(--grey-soft); color: var(--muted); }

/* ---------- vouchers ---------- */
.vcard { display: flex; align-items: center; gap: 12px; padding: 10px; cursor: pointer; }
.vcard.off { opacity: .72; cursor: default; }
.vthumb {
  width: 76px; height: 76px; border-radius: 14px; flex: none; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--amber-soft), #FFFBEF); font-size: 38px;
}
:root.dark .vthumb { background: linear-gradient(135deg, #3A2F10, #2A2410); }
.vthumb img { width: 100%; height: 100%; object-fit: cover; }
.vcard h3 { font-size: 16px; font-weight: 700; }
.vcard p { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vmeta { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.vmeta small { font-size: 11.5px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.badge.active { background: var(--green-soft); color: var(--green); }
.badge.used { background: var(--grey-soft); color: var(--muted); }
.badge.expired { background: var(--red-soft); color: var(--red); }
.hint { display: flex; gap: 12px; align-items: center; padding: 14px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.hint .ico { width: 44px; height: 44px; font-size: 24px; }

.empty { text-align: center; padding: 34px 18px; }
.empty .em { font-size: 52px; line-height: 1; margin-bottom: 12px; }
.empty p { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.empty b { display: block; font-size: 16px; margin-bottom: 6px; }

/* ---------- sheet ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; animation: bgIn .2s; }
.sheet-bg[hidden] { display: none; }
@keyframes bgIn { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 480px; background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(22px + var(--safe-b)); text-align: center; animation: up .25s cubic-bezier(.2, .8, .3, 1);
}
@keyframes up { from { transform: translateY(100%); } }
.handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { font-size: 19px; font-weight: 700; }
.sheet .qrbox {
  width: 220px; height: 220px; margin: 16px auto 12px; padding: 12px; background: #fff;
  border: 4px solid var(--amber); border-radius: 20px;
}
.sheet .qrbox img { width: 100%; height: 100%; display: block; }
.code { font: 700 22px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .08em; }

/* ---------- referral ---------- */
.gift { width: 120px; height: 120px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 72px; background: radial-gradient(circle, rgba(255, 200, 61, .45) 0%, rgba(255, 200, 61, 0) 70%); }
.ref-code { font-size: 30px; font-weight: 800; letter-spacing: .01em; margin: 2px 0 12px; }
.share { display: flex; justify-content: center; gap: 18px; margin-top: 12px; }
.share button { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 24px; box-shadow: var(--shadow); }
.share .tgb { background: #2AABEE; }
.share .wab { background: #25D366; }
.share .shb { background: #2F80ED; }
.share-lbl { font-weight: 600; font-size: 15px; margin-top: 22px; }
.ini { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--amber-soft); color: var(--amber-ink); flex: none; }
.count-chip { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; background: var(--amber-soft); color: var(--amber-ink); padding: 5px 12px; border-radius: 99px; margin-top: 12px; }

/* ---------- timeline ---------- */
.tl { position: relative; padding-left: 4px; }
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-item .ico { width: 40px; height: 40px; border-radius: 50%; z-index: 1; }
.tl-body { flex: 1; min-width: 0; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.tl-body small { display: block; font-size: 12px; color: var(--muted); }
.tl-body b { display: block; font-size: 14.5px; font-weight: 600; }
.tl-body span { display: block; font-size: 12.5px; color: var(--muted); }

/* ---------- profile ---------- */
.p-avatar {
  width: 92px; height: 92px; border-radius: 50%; margin: 4px auto 10px; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, #F5B301, #FFC83D); color: #1A1A1A; font-size: 46px; font-weight: 800;
  box-shadow: 0 6px 18px rgba(245, 179, 1, .35);
}
.p-avatar img { width: 100%; height: 100%; object-fit: cover; }
.p-avatar.txt { font-size: 32px; }
.p-name { text-align: center; font-size: 21px; font-weight: 700; line-height: 1.25; margin-bottom: 16px; }
.kv { padding: 2px 14px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv div:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; }
.links { margin-top: 12px; padding: 0 12px; }
.links a { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-weight: 500; cursor: pointer; }
.links a:last-child { border-bottom: 0; }
.links .ico { width: 34px; height: 34px; border-radius: 50%; font-size: 18px; }
.links .chev { margin-left: auto; color: var(--muted); }

/* ---------- contact ---------- */
.callcard { border-radius: 20px; padding: 18px; background: linear-gradient(135deg, #F5B301, #FFC83D); color: #1A1A1A; box-shadow: 0 6px 18px rgba(245, 179, 1, .35); }
.callcard small { font-size: 13px; font-weight: 600; opacity: .8; }
.callcard .ph { font-size: 30px; font-weight: 800; letter-spacing: -.01em; margin: 2px 0 14px; }
.callcard .btn { background: #1A1A1A; color: #fff; box-shadow: none; }
.branch { padding: 14px; }
.branch b { font-size: 15px; display: block; }
.branch p { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.branch .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--amber-soft); color: var(--amber-ink); font-size: 13px; font-weight: 600; cursor: pointer; }

/* ---------- faq / rules ---------- */
details.box { padding: 0 14px; }
details summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 0; font-weight: 600; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
details summary svg { margin-left: auto; transition: transform .2s; color: var(--muted); }
details[open] summary svg { transform: rotate(90deg); }
details p { padding: 0 0 14px; color: var(--muted); font-size: 14px; white-space: pre-line; }
.rules { padding: 16px; font-size: 14.5px; line-height: 1.6; white-space: pre-line; }

/* ---------- state / status screens ---------- */
.state { min-height: 82vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 10px; }
.state .logo-pill { background: #fff; border-radius: 16px; padding: 10px 16px; margin-bottom: 28px; box-shadow: var(--shadow); }
.state .logo-pill img { height: 40px; display: block; }
.state .em { font-size: 64px; margin-bottom: 14px; }
.state h2 { font-size: 21px; font-weight: 800; margin-bottom: 8px; }
.state p { color: var(--muted); font-size: 15px; max-width: 300px; margin-bottom: 24px; }
.state .btn { min-width: 220px; margin-top: 8px; }

.netbar {
  display: flex; align-items: center; gap: 10px; margin: 10px 16px 0; padding: 10px 12px; border-radius: 14px;
  background: var(--red-soft); color: var(--red); font-size: 13.5px; font-weight: 600;
}
.netbar button { margin-left: auto; white-space: nowrap; flex: none; background: var(--red); color: #fff; border-radius: 10px; padding: 7px 12px; font-size: 13px; font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 60;
  background: #1A1A1A; color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: .22s; white-space: nowrap;
}
:root.dark .toast { background: #F3F3F5; color: #1A1A1A; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- skeleton ---------- */
.sk { background: linear-gradient(90deg, var(--sk) 0%, var(--sk2) 40%, var(--sk) 80%); background-size: 300% 100%; animation: shimmer 1.3s linear infinite; border-radius: 14px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -200% 0; } }
.sk-circle { width: 48px; height: 48px; border-radius: 50%; flex: none; }
.sk-line { height: 13px; border-radius: 7px; margin: 5px 0; }
.w40 { width: 40%; } .w60 { width: 60%; }
.sk-card { width: var(--cw); aspect-ratio: 85.6 / 54; margin: 14px auto 0; border-radius: calc(var(--u) * 4.6); }
.sk-tile { height: 104px; border-radius: 18px; }
.sk-small { height: 62px; }
.sk-banner { height: 70px; margin-top: 12px; border-radius: 18px; }
.skel-wrap .grid2:first-of-type { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  .card-inner, .fade, .sheet, .sk { transition: none; animation: none; }
}
