:root {
  --ink: #17202f;
  --muted: #7d8796;
  --line: #edf0f5;
  --soft: #f6f8fb;
  --purple: #6257e8;
  --purple-dark: #5045d4;
  --orange: #ff9c61;
  --teal: #2ebca8;
  --pink: #e96c98;
  --shadow: 0 22px 55px rgba(36, 39, 80, .10);
  font-family: 'DM Sans', 'Noto Sans SC', sans-serif;
  color: var(--ink);
  background: #f5f7fb;
}
* { box-sizing: border-box; }
html, body { width:100%; max-width:100%; overflow-x:hidden; }
body { margin: 0; min-width: 320px; background: #f5f7fb; color: var(--ink); }
button, input { font: inherit; }
button { border: 0; cursor: pointer; }
.hidden { display: none !important; }
.level-card { margin: 18px 0 0; padding: 18px; border-radius: 16px; border: 1px solid #f4e5cf; background: linear-gradient(120deg,#fff6e3,#fffaf3); }
.level-card strong { font-size: 15px; }
.level-icons { min-height: 36px; margin: 12px 0 5px; font-size: 24px; overflow-wrap: anywhere; }
.level-card > small { color: #a1875d; font-size: 11px; }
.membership-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.membership-badges span { padding: 5px 8px; border-radius: 8px; color: #c88222; background: #ffedc8; font-size: 11px; }
.feature-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.feature-actions button { flex: 1 1 120px; }
.product-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.product-card { padding: 15px 12px; border: 1px solid #f0e5d5; border-radius: 13px; background: #fffbf4; }
.product-card strong { color: #bf8b32; }
.product-card small { display: block; margin-top: 8px; font-size: 10px; color: #9d9688; }
.product-card button { width: 100%; }
.product-card button:disabled, .modal-form button:disabled { opacity: .5; cursor: not-allowed; }
.message-text.payment-message { padding: 0; background: transparent; }
.packet-open,.transfer-card { display: grid; gap: 8px; width: 230px; max-width: 100%; padding: 17px; text-align: left; border-radius: 12px; background: linear-gradient(130deg,#f79442,#ee5945); color: #fff; }
.packet-open strong,.transfer-card strong { font-size: 17px; }
.packet-open span,.transfer-card span { font-size: 12px; overflow-wrap: anywhere; }
.packet-open small,.transfer-card small { margin-top: 8px; padding-top: 9px; border-top: 1px solid #ffffff44; font-size: 11px; color: #fff5df; }
.packet-detail { padding: 20px 10px; border-radius: 16px; background: #fff3e6; text-align: center; }
.packet-detail > strong { font-size: 30px; color: #e27235; }
.toast { position: fixed; z-index: 40; left: 50%; top: 20px; transform: translate(-50%, -15px); opacity: 0; pointer-events: none; padding: 11px 16px; border-radius: 999px; background: #20283a; color: #fff; font-size: 13px; box-shadow: var(--shadow); transition: .22s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #d54e68; }

/* Auth */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; background: radial-gradient(circle at 15% 10%, #ede9ff 0, transparent 34%), radial-gradient(circle at 90% 90%, #ffe9e0 0, transparent 35%), #f8f9fd; position: relative; overflow: hidden; }
.auth-decoration { position: absolute; width: 510px; height: 510px; border: 1px solid rgba(98,87,232,.09); border-radius: 50%; right: -210px; top: -200px; box-shadow: 0 0 0 38px rgba(98,87,232,.03), 0 0 0 82px rgba(98,87,232,.02); }
.auth-card { width: min(100%, 440px); padding: 34px; background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.7); border-radius: 28px; box-shadow: 0 30px 80px rgba(56, 54, 106, .14); position: relative; backdrop-filter: blur(16px); }
.brand-mark { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.brand-mark > span { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; font-size: 20px; border-radius: 12px; background: linear-gradient(135deg, #887cff, #584cdc); box-shadow: 0 8px 18px rgba(98,87,232,.25); }
.brand-mark strong { display: block; font-size: 18px; letter-spacing: -.02em; }
.brand-mark small { display: block; margin-top: 2px; color: #a0a7b4; font-size: 8px; letter-spacing: .16em; }
.auth-heading { padding: 44px 0 20px; }
.eyebrow { margin: 0 0 7px; color: #8b92a4; font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.auth-heading h1, .page-heading h2, .welcome-row h2 { margin: 0; font-size: clamp(26px, 5vw, 32px); line-height: 1.2; letter-spacing: -.04em; }
.auth-heading p:last-child, .page-heading > div > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.stack-form { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; color: #606a7d; font-size: 12px; font-weight: 600; }
.field i { color: #aab0bb; font-style: normal; font-weight: 400; }
.field input { width: 100%; padding: 13px 14px; color: var(--ink); border: 1px solid #e6eaf0; border-radius: 12px; outline: none; background: #fbfcfe; transition: .2s; }
.field input:focus { border-color: #a69ff3; box-shadow: 0 0 0 4px rgba(98,87,232,.10); background: #fff; }
.primary-button { margin-top: 5px; padding: 14px; color: #fff; font-weight: 700; border-radius: 12px; background: linear-gradient(135deg, #786cf3, #574cdb); box-shadow: 0 12px 20px rgba(98,87,232,.20); }
.auth-switch { margin: 20px 0 0; color: #929aaa; text-align: center; font-size: 12px; }
.auth-switch button { padding: 0; color: var(--purple); background: none; font-weight: 700; }
.demo-hint { margin: 26px 0 -2px; padding-top: 16px; color: #a2a8b5; border-top: 1px solid var(--line); font-size: 10px; text-align: center; }

/* Shell */
.app-shell { width:100%; min-height: 100vh; overflow-x:hidden; background: #f6f8fb; }
.app-shell > .topbar { display: none; }
.topbar { position: sticky; z-index: 8; top: 0; display: flex; align-items: center; justify-content: space-between; height: 70px; padding: 0 max(20px, calc((100vw - 1060px) / 2)); background: rgba(246,248,251,.88); backdrop-filter: blur(16px); }
.brand-mark.compact { gap: 9px; }
.brand-mark.compact > span { width: 30px; height: 30px; font-size: 16px; border-radius: 10px; }
.brand-mark.compact strong { font-size: 16px; }
.top-actions, .chat-head-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { display: grid; place-items: center; width: 35px; height: 35px; color: #70798a; border: 1px solid #e7eaf0; border-radius: 11px; background: #fff; position: relative; }
.icon-button b { position: absolute; width: 6px; height: 6px; top: 7px; right: 7px; border: 2px solid #f6f8fb; border-radius: 50%; background: #e96c98; }
.avatar, .profile-avatar { display: grid; place-items: center; color: #fff; font-weight: 700; border-radius: 12px; background: linear-gradient(135deg, #ffb58c, #eb7b8e); }
.avatar { width: 35px; height: 35px; font-size: 12px; }
.main-content { width: min(100%, 1060px); margin: 0 auto; padding: 12px 20px 108px; }
.panel { display: none; animation: fade-in .28s ease; }
.active-panel { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.welcome-row, .page-heading, .section-head, .profile-header, .wallet-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.welcome-row { padding: 20px 0 26px; }
.online-pill { padding: 8px 11px; color: #5e687a; border: 1px solid #e8ebf2; border-radius: 999px; background: #fff; font-size: 11px; white-space: nowrap; }
.online-pill span { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #3cca9b; box-shadow: 0 0 0 3px #ddf8ed; }
.hero-card { display: flex; align-items: center; justify-content: space-between; min-height: 190px; padding: 28px 34px; color: #fff; overflow: hidden; border-radius: 24px; background: linear-gradient(110deg, #6556e9 0%, #776bec 45%, #8b7cf3 100%); box-shadow: 0 18px 34px rgba(98,87,232,.20); position: relative; }
.hero-card:after { content: ''; position: absolute; width: 330px; height: 330px; right: -140px; bottom: -220px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; box-shadow: 0 0 0 36px rgba(255,255,255,.04), 0 0 0 80px rgba(255,255,255,.03); }
.hero-card h3 { max-width: 340px; margin: 4px 0 8px; font-size: 23px; letter-spacing: -.04em; }
.hero-card p:not(.eyebrow) { max-width: 420px; margin: 0; color: rgba(255,255,255,.72); font-size: 12px; }
.eyebrow.light { color: rgba(255,255,255,.62); }
.ghost-button { display: inline-flex; align-items: center; gap: 13px; margin-top: 22px; padding: 10px 0; color: var(--ink); background: transparent; font-size: 12px; font-weight: 700; }
.light-button { color: #fff; }
.ghost-button span { font-size: 18px; transition: transform .2s; }
.ghost-button:hover span { transform: translateX(4px); }
.hero-orb { display: grid; place-items: center; width: 108px; height: 108px; margin-right: 45px; color: rgba(255,255,255,.86); font-size: 40px; border: 1px solid rgba(255,255,255,.22); border-radius: 35px; background: rgba(255,255,255,.12); transform: rotate(12deg); box-shadow: 0 0 0 13px rgba(255,255,255,.05); }
.section-head { margin: 34px 0 17px; }
.section-head h3 { margin: 0; font-size: 16px; letter-spacing: -.025em; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.text-button { padding: 7px 0; color: var(--purple); background: transparent; font-size: 12px; font-weight: 700; }
.group-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.group-card { display: flex; align-items: center; gap: 13px; min-height: 78px; padding: 14px; border: 1px solid #edf0f5; border-radius: 16px; background: #fff; box-shadow: 0 8px 25px rgba(42,52,84,.04); transition: .18s; cursor: pointer; }
.group-card .group-icon { border:0; padding:0; cursor:pointer; }
.group-code-label { margin-left:5px; padding:2px 5px; color:#e8754e; border-radius:4px; background:#fff0e9; font-size:8px; font-style:normal; font-weight:500; vertical-align:middle; }
.group-card:hover { border-color: #d8d4ff; transform: translateY(-2px); box-shadow: 0 13px 28px rgba(42,52,84,.08); }
.group-icon { display: grid; flex: 0 0 auto; place-items: center; width: 43px; height: 43px; color: #fff; font-size: 18px; border-radius: 14px; background: linear-gradient(135deg, #ffb878, #ec7b89); }
.group-icon.purple { background: linear-gradient(135deg, #9d8dfb, #6257e8); }
.group-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.group-card small { display: block; margin-top: 5px; color: #969eac; font-size: 10px; }
.group-card .join-label { margin-left: auto; padding: 6px 8px; color: var(--purple); border-radius: 8px; background: #f0eeff; font-size: 10px; font-weight: 700; }
.friends-head { margin-top: 31px; }
.friend-list { display: flex; gap: 15px; overflow-x: auto; padding: 2px 0 10px; }
.friend-empty { color: #a0a6b2; font-size: 12px; }
.friend { min-width: 62px; text-align: center; }
.friend-avatar { display: grid; place-items: center; width: 42px; height: 42px; margin: auto; color: #fff; border-radius: 14px; background: #8b7cf3; font-size: 13px; font-weight: 700; }
.friend:nth-child(3n) .friend-avatar { background: #f2a06e; }.friend:nth-child(4n) .friend-avatar { background: #60bda9; }
.friend small { display: block; overflow: hidden; margin-top: 7px; color: #6f798a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

/* Tasks, team, mine */
.page-heading { padding: 22px 0 24px; align-items: flex-end; }.page-heading > div:first-child { flex: 1; }
.balance-badge { min-width: 120px; padding: 11px 13px; border: 1px solid #e9eaf4; border-radius: 14px; background: #fff; text-align: right; }.balance-badge span { display:block; color:#9aa2b1; font-size:10px; }.balance-badge strong { display:block; margin-top: 3px; color: var(--purple); font-size: 17px; }
.task-filter { display: flex; gap: 8px; margin-bottom: 16px; }.filter-chip { padding: 8px 13px; color: #8c94a3; border-radius: 999px; background: #fff; font-size: 11px; }.filter-chip.active { color: #fff; background: var(--ink); }
.task-list { display: grid; gap: 12px; }.task-card { padding: 19px; border: 1px solid #edf0f5; border-radius: 17px; background: #fff; }.task-card-top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }.task-card h3 { margin:0; font-size:14px; }.task-card p { margin:8px 0 17px; color:#8992a2; font-size:11px; line-height:1.65; }.reward { color:#e66c48; font-size:17px; font-weight:700; white-space:nowrap; }.reward small { color:#b7a096; font-size:10px; font-weight:500; }.task-card-bottom { display:flex; align-items:center; justify-content:space-between; }.task-tag { padding:5px 8px; color:#5c66a8; border-radius:7px; background:#f0f2ff; font-size:10px; }.task-action { padding:8px 14px; color:#fff; border-radius:9px; background:var(--purple); font-size:11px; font-weight:700; }.task-action.done { color:#6eaa8b; background:#eaf7f0; cursor:default; }
.team-spark { display:grid; place-items:center; width:47px; height:47px; color:#fff; border-radius:16px; background:linear-gradient(135deg,#ffb88a,#eb708f); font-size:22px; }.invite-card { display:flex; align-items:center; justify-content:space-between; padding:20px 22px; color:#fff; border-radius:20px; background:linear-gradient(108deg,#6556e9,#7c6bf0); box-shadow:0 17px 32px rgba(98,87,232,.18); }.invite-card p { margin:0 0 7px; color:rgba(255,255,255,.72); font-size:11px; }.invite-card strong { display:block; font-size:25px; letter-spacing:.16em; }.invite-card small { display:block; margin-top:6px; color:rgba(255,255,255,.63); font-size:10px; }.copy-button { color:#fff; border-color:rgba(255,255,255,.23); background:rgba(255,255,255,.15); }.metric-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:13px; }.metric-card { padding:15px; border:1px solid #edf0f5; border-radius:16px; background:#fff; }.metric-card span,.metric-card small { display:block; color:#9aa2b1; font-size:10px; }.metric-card strong { display:block; margin:9px 0 4px; font-size:22px; letter-spacing:-.05em; }.metric-card strong i { font-size:15px; font-style:normal; }.metric-card.accent strong { color:var(--purple); }.team-list { display:grid; gap:8px; }.team-member { display:flex; align-items:center; gap:11px; padding:12px; border:1px solid #edf0f5; border-radius:13px; background:#fff; }.team-member .mini-avatar { display:grid; place-items:center; width:32px; height:32px; color:#fff; border-radius:10px; background:#8b7cf3; font-size:11px; font-weight:700; }.team-member strong { display:block; font-size:12px; }.team-member small { display:block; margin-top:3px; color:#a0a7b4; font-size:10px; }.team-member time { margin-left:auto; color:#b0b5c0; font-size:10px; }.empty-state { padding: 26px 15px; color:#9aa2b1; border:1px dashed #dfe3ea; border-radius:15px; text-align:center; font-size:12px; }
.profile-header { justify-content:flex-start; padding:24px 0 21px; }.profile-header > div:nth-child(2) { flex:1; }.profile-header .icon-button { margin-left:auto; }.profile-avatar { width:55px; height:55px; font-size:20px; border-radius:18px; }.profile-header h2 { margin:0; font-size:21px; }.profile-header p:last-child { margin:6px 0 0; color:#8b94a4; font-size:11px; }.wallet-card { padding:20px 22px 18px; color:#fff; border-radius:22px; background:linear-gradient(115deg,#242d49,#343d61); box-shadow:0 18px 35px rgba(31,42,75,.20); }.wallet-top { color:rgba(255,255,255,.65); font-size:11px; }.wallet-label { color:rgba(255,255,255,.35); font-size:9px; letter-spacing:.16em; }.wallet-card > strong { display:block; margin:19px 0 18px; font-size:32px; letter-spacing:-.06em; }.wallet-actions { display:flex; gap:8px; }.wallet-actions button { flex:1; padding:10px 7px; color:#e4e7ff; border:1px solid rgba(255,255,255,.12); border-radius:10px; background:rgba(255,255,255,.08); font-size:11px; }.wallet-actions button:first-child { color:#fff; background:rgba(117,106,240,.65); }.quick-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-top:14px; }.quick-card { min-height:112px; padding:12px 9px; border:1px solid #edf0f5; border-radius:15px; background:#fff; text-align:left; }.quick-icon { display:grid; place-items:center; width:28px; height:28px; margin-bottom:14px; border-radius:9px; font-size:13px; }.quick-icon.indigo { color:#675ce8; background:#efedff; }.quick-icon.orange { color:#e78a4d; background:#fff1e9; }.quick-icon.teal { color:#28a993; background:#e7f8f4; }.quick-icon.pink { color:#dd668f; background:#fff0f5; }.quick-card strong { display:block; font-size:11px; }.quick-card small { display:block; margin-top:5px; color:#a1a8b4; font-size:9px; }.admin-section { margin-top:31px; padding-top:25px; border-top:1px solid #e9edf2; }.admin-tag { padding:5px 8px; color:#d67c3c; border-radius:7px; background:#fff0e6; font-size:9px; font-weight:700; letter-spacing:.08em; }.admin-tabs { display:flex; gap:7px; margin-bottom:12px; }.admin-tab { padding:8px 13px; color:#9aa2b0; border-radius:8px; background:#fff; font-size:11px; }.admin-tab.active { color:var(--purple); background:#efedff; font-weight:700; }.admin-row { display:flex; align-items:center; gap:8px; padding:11px 0; border-bottom:1px solid #edf0f5; }.admin-row:last-child { border-bottom:0; }.admin-row .admin-user { flex:1; }.admin-user strong { display:block; font-size:11px; }.admin-user small { display:block; margin-top:3px; color:#9ca3b0; font-size:9px; }.admin-balance { color:var(--purple); font-size:11px; font-weight:700; }.admin-actions { display:flex; gap:4px; }.admin-actions button { padding:5px 7px; color:#7b8391; border-radius:6px; background:#f3f5f8; font-size:9px; }.admin-actions button.danger { color:#d55c6d; background:#fff0f2; }.logout-button { width:100%; margin-top:25px; padding:12px; color:#9ca3b0; border:1px solid #e4e8ee; border-radius:12px; background:transparent; font-size:12px; }

/* Nav and drawers */
.bottom-nav { position:fixed; z-index:10; right:0; bottom:0; left:0; display:flex; justify-content:center; gap:0; height:83px; padding:9px max(20px, calc((100vw - 500px) / 2)) 13px; border-top:1px solid #edf0f5; background:rgba(255,255,255,.93); box-shadow:0 -9px 24px rgba(45,52,82,.05); backdrop-filter:blur(17px); }.nav-item { display:flex; flex:1; flex-direction:column; align-items:center; justify-content:center; gap:5px; max-width:115px; color:#a2a9b6; background:transparent; font-size:21px; }.nav-item small { font-size:10px; }.nav-item.active { color:var(--purple); }.nav-item.active span { filter:drop-shadow(0 5px 8px rgba(98,87,232,.25)); }
/* These overlays are viewport children, never part of the home page flow. */
html.overlay-open { overflow: hidden; overscroll-behavior: none; }
body.overlay-open { position: fixed; width: 100%; overflow: hidden; }
.drawer-backdrop, .modal-backdrop {
  position: fixed;
  inset: 0;
  top: var(--overlay-top, 0px);
  height: 100vh;
  height: var(--overlay-height, 100dvh);
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  overscroll-behavior: none;
  background: rgba(21, 28, 43, .4);
}
.drawer-backdrop { z-index: 20; }
.chat-drawer {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f3f4f7;
  box-shadow: var(--shadow);
}
.drawer-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  min-height: 64px;
  border-bottom: 1px solid #e6e8ee;
  background: #fff;
}
.drawer-head .icon-button { flex: 0 0 40px; width: 40px; height: 40px; font-size: 23px; }
.chat-heading { flex: 1; min-width: 0; padding: 3px; background: transparent; text-align: left; color: var(--ink); }
.chat-heading strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.chat-heading small { display: block; margin-top: 4px; color: #929aaa; font-size: 11px; }
.chat-head-actions { display: flex; flex: 0 0 auto; gap: 2px; }
.message-list {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 20px 14px;
  background: #f3f4f7;
}
.message { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 20px; }
.message-avatar { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; background: #ee7567; color: #fff; font-size: 16px; }
.message-bubble { min-width: 0; max-width: calc(100% - 75px); }
.message-bubble > small { display: block; margin: 0 0 6px 2px; color: #949baa; font-size: 11px; overflow-wrap: anywhere; }
.message-text { padding: 11px 13px; border-radius: 0 13px 13px 13px; background: #fff; color: #243044; font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.message.mine { flex-direction: row-reverse; }
.message.mine .message-avatar { background: #7371d9; }
.message.mine .message-bubble > small { text-align: right; }
.message.mine .message-text { border-radius: 13px 0 13px 13px; background: #dce9ff; }
.message.system { display: block; margin: 6px 0 20px; text-align: center; }
.message.system .message-avatar, .message.system small { display: none; }
.message.system .message-bubble { max-width: 100%; }
.message.system .message-text { display: inline-block; padding: 5px 12px; border-radius: 8px; background: #e8ebf0; color: #8a92a0; font-size: 11px; }
.chat-toolbar { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #e2e5eb; background: #fff; }
.chat-toolbar > button { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; background: #f2f4f8; color: #737e91; font-size: 24px; }
.chat-toolbar input { flex: 1; width: 0; min-width: 0; height: 42px; padding: 10px 12px; border: 1px solid #e7eaf0; border-radius: 10px; outline: none; background: #f6f7fa; font-size: 16px; }
.chat-toolbar input:focus { border-color: #9496da; }
.chat-toolbar .send-button { flex-basis: 56px; width: 56px; color: #fff; background: #ef3442; font-size: 14px; font-weight: 700; }
.send-button:disabled { opacity: .55; cursor: wait; }
.modal-backdrop { z-index: 30; align-items: center; padding: 24px; }
.modal-card { position: relative; width: 100%; max-width: 480px; max-height: 100%; min-height: 0; padding: 24px; border-radius: 20px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: #fff; box-shadow: var(--shadow); }
.modal-close { position: sticky; z-index: 2; top: 0; display: block; width: 36px; height: 36px; margin: -12px -12px 4px auto; border-radius: 50%; background: #eef0f5; color: #536078; font-size: 25px; }
.modal-card h3 { margin: 0 0 10px; font-size: 21px; }
.modal-card p { color: #8b94a4; font-size: 13px; line-height: 1.7; }
.modal-form { display: grid; gap: 15px; margin-top: 20px; }
.modal-form label { display: grid; gap: 8px; color: #737e91; font-size: 13px; }
.modal-form input, .modal-form textarea { width: 100%; padding: 12px; border: 1px solid #e2e6ee; border-radius: 10px; font: inherit; font-size: 16px; }
.modal-form textarea { min-height: 100px; resize: vertical; }
.notice-card { padding: 15px; border-radius: 12px; background: #f3f5fa; color: #737e91; font-size: 13px; line-height: 1.8; }
@media (max-width: 600px) {
  .chat-drawer { max-width: none; }
  .modal-backdrop { padding: 0; }
  .modal-card { max-width: none; height: 100%; border-radius: 0; padding: calc(24px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 800px) { .bottom-nav { padding-left: 20px; padding-right: 20px; } }
.profile-pop { display:flex; align-items:center; gap:14px; margin:10px 0 16px; padding:17px; border-radius:16px; background:linear-gradient(135deg,#edf0ff,#fff); }.profile-pop-avatar { display:grid; place-items:center; width:52px; height:52px; color:#fff; border-radius:50%; background:linear-gradient(135deg,#ffb27e,#eb7188); font-size:18px; font-weight:700; }.profile-pop strong,.member-pop strong { display:block; font-size:14px; }.profile-pop small,.member-pop small { display:block; margin-top:5px; color:#929aaa; font-size:10px; }.profile-pop-actions { display:flex; gap:8px; }.profile-pop-actions button { flex:1; }.secondary-button { padding:12px; color:var(--purple); border:1px solid #dfddff; border-radius:12px; background:#f4f2ff; font-weight:700; }.member-pop-list { display:grid; gap:5px; margin-top:13px; }.member-pop { display:flex; align-items:center; gap:10px; width:100%; padding:10px; border:0; border-radius:11px; background:#fafbfe; text-align:left; }.member-pop .profile-pop-avatar { width:34px; height:34px; font-size:12px; }.member-pop span:nth-child(2) { flex:1; }.member-pop i { color:#abb1bf; font-size:22px; font-style:normal; }
.qq-group-cover { margin:-24px -24px 15px; padding:28px 18px 22px; color:#fff; background:linear-gradient(135deg,#28334e,#5d6b92); text-align:center; }.qq-group-avatar { display:grid; place-items:center; width:70px; height:70px; margin:0 auto 12px; color:#fff; border:3px solid rgba(255,255,255,.55); border-radius:22px; background:linear-gradient(135deg,#ff9b79,#ed596a); font-size:26px; font-weight:700; }.qq-group-cover h3 { margin:0; font-size:20px; }.qq-group-cover p { margin:7px 0 0; color:rgba(255,255,255,.72); font-size:11px; }.qq-group-meta { display:flex; justify-content:space-between; gap:8px; padding:11px 0; color:#8f97a6; border-bottom:1px solid #edf0f5; font-size:10px; }.member-pop-title { margin:15px 0 7px; color:#4c5669; font-size:12px; font-weight:700; }.member-pop-title small { margin-left:4px; color:#a1a8b4; font-weight:400; }
@keyframes drawer-in { from { transform:translateX(100%); } to { transform:translateX(0); } }
@media (min-width: 800px) { .bottom-nav { right:50%; left:auto; width:540px; transform:translateX(50%); border:1px solid #edf0f5; border-bottom:0; border-radius:22px 22px 0 0; }.main-content { padding-bottom:120px; }.group-list { grid-template-columns:repeat(3,minmax(0,1fr)); }.task-list { grid-template-columns:repeat(2,minmax(0,1fr)); }.task-card:first-child { grid-column:span 2; } }
@media (max-width: 560px) { .auth-card { padding:27px 21px; }.hero-card { min-height:175px; padding:24px 22px; }.hero-orb { width:78px; height:78px; margin-right:6px; font-size:28px; }.hero-card h3 { font-size:19px; }.group-list { grid-template-columns:1fr; }.quick-grid { grid-template-columns:repeat(2,1fr); }.metric-grid { grid-template-columns:repeat(3,1fr); gap:7px; }.metric-card { padding:12px 9px; }.metric-card strong { font-size:19px; }.welcome-row { align-items:flex-start; flex-direction:column; gap:10px; } }
.admin-entry { display:flex; align-items:center; justify-content:space-between; margin:18px 14px 0; padding:15px 16px; color:#ef1d29; border:1px solid #ffd4d7; border-radius:12px; background:#fff6f6; font-size:14px; font-weight:700; text-decoration:none; }.admin-entry span { font-size:20px; }

/* Reference-style chat and profile screens */
.chat-home-panel, .mine-panel { min-height: calc(100vh - 83px); margin: 0 -20px; padding: 0 20px 96px; background: #fff; }
.chat-topbar { display:flex; align-items:center; justify-content:space-between; height:84px; margin:0 -20px; padding:24px 20px 11px; color:#fff; background:linear-gradient(115deg,#ff3936 0%,#f31f29 48%,#ff6043 100%); position:relative; overflow:hidden; }
.chat-topbar:after, .mine-topbar:after { content:''; position:absolute; width:230px; height:160px; right:-18px; top:-71px; border:1px solid rgba(255,255,255,.16); border-radius:50%; box-shadow:0 0 0 14px rgba(255,255,255,.05),0 0 0 33px rgba(255,255,255,.035); transform:rotate(-18deg); }
.chat-topbar strong { font-size:23px; letter-spacing:-.03em; }.chat-top-actions { display:flex; align-items:center; gap:20px; position:relative; z-index:1; }.chat-top-actions button { padding:0; color:#fff; background:transparent; font-size:27px; line-height:1; }.chat-list-intro { display:flex; align-items:center; justify-content:space-between; min-height:45px; color:#a0a5ad; font-size:11px; border-bottom:1px solid #f2f2f2; }.chat-list-intro .text-button { color:#f22d32; font-size:11px; }.chat-list { display:block; }.chat-list .group-card { display:flex; align-items:center; gap:13px; min-height:88px; padding:14px 0; border:0; border-bottom:1px solid #f0f0f0; border-radius:0; box-shadow:none; }.chat-list .group-card:hover { border-color:#f0f0f0; transform:none; box-shadow:none; }.chat-list .group-icon { width:59px; height:59px; border-radius:50%; flex-basis:59px; background:linear-gradient(135deg,#f9c3a7,#f14b38); border:1px solid #f8ded8; font-size:23px; }.chat-list .group-icon.purple { background:linear-gradient(135deg,#f59f7c,#ed4138); }.chat-list .group-card > div { flex:1; min-width:0; }.chat-list .group-card strong { font-size:15px; }.chat-list .group-card small { margin-top:6px; color:#9ca0a7; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.chat-list .group-card:first-child small { color:#f4343a; }.chat-list .group-card .join-label { display:none; }.chat-unread { min-width:31px; padding:6px 8px; color:#fff; border-radius:18px; background:#ef2029; font-size:12px; font-weight:700; text-align:center; }.friends-head { margin-top:16px; }.chat-home-panel .friend-list { padding-bottom:8px; }.chat-home-panel .friend-empty { color:#acb0b7; }
.mine-panel { background:#fff; }.mine-topbar { display:flex; align-items:center; gap:16px; height:86px; margin:0 -20px; padding:14px 20px; color:#fff; background:linear-gradient(115deg,#f11820,#ed1e24 52%,#ff4a3e); position:relative; overflow:hidden; }.mine-title { font-size:23px; font-weight:700; align-self:flex-start; margin-top:7px; }.mine-user { display:flex; align-items:center; gap:10px; flex:1; position:relative; z-index:1; }.mine-user .profile-avatar { width:51px; height:51px; border-radius:50%; background:#8d75ef; border:1px solid rgba(255,255,255,.35); }.mine-user strong { display:block; color:#fff; font-size:18px; }.mine-user small { display:block; margin-top:3px; color:#fff; font-size:12px; }.mine-top-actions { display:flex; align-items:center; gap:17px; position:relative; z-index:1; }.mine-top-actions button { padding:0; color:#fff; background:transparent; font-size:25px; }.mine-section-title { padding:30px 14px 14px; color:#ef1d29; font-size:16px; font-weight:700; }.settings-list { margin:0 0 17px; }.setting-row { display:flex; align-items:center; width:100%; min-height:77px; padding:0 14px; color:#343434; border-bottom:1px solid #ededed; background:#fff; text-align:left; }.setting-row:first-child { border-top:0; }.setting-row .setting-icon { display:grid; flex:0 0 auto; place-items:center; width:37px; height:37px; margin-right:39px; color:#fff; border-radius:10px; background:linear-gradient(145deg,#ff4350,#e90016); font-size:17px; font-weight:700; }.setting-row strong { font-size:17px; font-weight:500; }.setting-row .setting-value { margin-left:auto; color:#9b9b9b; font-size:15px; }.setting-row .orange-text { color:#f03b35; }.setting-row i { margin-left:12px; color:#9a9a9a; font-size:31px; font-style:normal; font-weight:300; line-height:1; }.mine-panel .admin-section { margin-top:25px; }.mine-panel .logout-button { margin:25px 14px 0; width:calc(100% - 28px); color:#f02a35; border-color:#ffd6d8; }.mine-panel + * { background:#fff; }
@media (min-width:800px) { .chat-home-panel, .mine-panel { width:540px; margin:0 auto; padding-left:20px; padding-right:20px; border-left:1px solid #f0f0f0; border-right:1px solid #f0f0f0; } }

/* Selected profile design 01: classic red, with live membership status. */
.mine-panel { background: #f5f6fa; padding-bottom: 28px; }
.mine-panel .classic-profile-header { display: block; height: auto; min-height: 185px; padding: 22px 23px 40px; background: linear-gradient(115deg,#ee1f36,#fa5647); overflow: hidden; }
.classic-profile-title { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; margin-bottom: 26px; }
.classic-profile-title h2 { margin: 0; font-size: 23px; }
.classic-profile-title small { font-size: 10px; letter-spacing: 2px; color: rgba(255,255,255,.7); }
.classic-profile-header .mine-user { gap: 16px; }
.classic-profile-header .mine-user .profile-avatar { flex: 0 0 61px; width: 61px; height: 61px; border-radius: 21px; font-size: 25px; background: linear-gradient(145deg,#b6a4ff,#7763db); box-shadow: 0 0 0 4px #ffffff30; border: 0; }
.classic-profile-identity { min-width: 0; }
.classic-profile-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.classic-profile-header .mine-user strong { font-size: 22px; overflow-wrap: anywhere; }
.classic-profile-header .mine-user small { margin-top: 7px; font-size: 12px; color: rgba(255,255,255,.8); }
#profile-vip-tag { color: #82530f; background: #ffe7a5; padding: 4px 6px; border-radius: 5px; font-size: 10px; font-weight: 700; }
.classic-level-card { position: relative; z-index: 1; margin: -18px 0 0; padding: 16px 18px; border: 1px solid #edf0f5; border-radius: 17px; background: #fff; box-shadow: 0 9px 20px #df465112; }
.classic-level-heading { display: flex; justify-content: space-between; align-items: center; }
.classic-level-heading strong { font-size: 13px; }
.classic-level-heading > span { font-size: 12px; color: #ed3043; font-weight: 700; }
.classic-level-card .level-icons { margin: 12px 0 8px; min-height: 32px; font-size: 25px; color: #e8a629; line-height: 1.5; }
.classic-level-description { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 10px; color: #828b9c; }
.classic-benefits-heading { display: flex; justify-content: space-between; align-items: center; margin: 22px 2px 12px; }
.classic-benefits-heading h3 { margin: 0; font-size: 14px; }
.classic-benefits-heading > span { font-size: 11px; color: #828b9c; }
.classic-membership-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.classic-membership { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 3px; min-height: 100px; border: 1px solid #edf0f5; border-radius: 13px; background: #fff; color: #222b3b; }
.classic-gem { height: 29px; display: grid; place-items: center; font-size: 29px; line-height: 1; color: var(--gem-color); text-shadow: 0 3px 7px color-mix(in srgb,var(--gem-color) 20%,transparent); }
.classic-membership strong { font-size: 12px; }
.classic-membership small { color: #828b9c; font-size: 10px; white-space: nowrap; }
.classic-membership.is-inactive { background: #fafbfc; }
.classic-membership.is-inactive .classic-gem { color: #c3c9d3; text-shadow: none; }
.classic-wallet-list { margin: 16px 0 0; }
.classic-wallet-list .setting-row { min-height: 65px; padding: 14px 15px; border: 1px solid #edf0f5; border-radius: 16px; }
.classic-wallet-list .setting-row .setting-icon { margin-right: 9px; width: 24px; height: 24px; border-radius: 0; font-size: 21px; color: #ed3043; background: none; }
.classic-wallet-list .setting-row strong { font-size: 13px; font-weight: 600; }
.classic-wallet-list .setting-row .setting-value { color: #222b3b; font-size: 17px; font-weight: 700; }
.classic-wallet-list .setting-row i { margin-left: 8px; font-size: 22px; }
.classic-member-center { width: 100%; padding: 14px; margin-top: 14px; border-radius: 12px; background: #ed3043; color: #fff; font-size: 13px; font-weight: 600; }
.classic-profile-note { margin: 15px 0 0; color: #929aaa; text-align: center; font-size: 10px; }
.mine-panel .logout-button { margin-top: 18px; padding: 10px; background: transparent; color: #8b94a4; border: 0; font-size: 11px; }
.nav-item.active { color: #ed3043; }
@media (max-width: 359px) { .classic-level-card { padding: 15px 12px; } .classic-membership small { font-size: 9px; } }
.official-account-badge { display:inline-flex; align-items:center; vertical-align:middle; padding:2px 6px; border-radius:5px; background:#e8f3ff; color:#096bbf; font-size:11px; line-height:1.6; font-weight:600; white-space:nowrap; }
.registered-id { padding:20px; text-align:center; font-size:34px; letter-spacing:5px; color:#6656df; background:#f4f1ff; border-radius:14px; }
.account-id-notice { padding:12px; margin:0; border-radius:10px; color:#6656c2; background:#f3f1ff; font-size:13px; line-height:1.7; }
.benefits-purpose { font-size:12px; color:#778399; line-height:1.7; margin:0 0 14px; }
.message-sound-control { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:12px 0 3px; padding:10px 12px; border-radius:12px; background:#f5f6fa; }
.message-sound-control > div { flex:1 1 135px; min-width:0; }
.message-sound-control strong { display:block; color:#536078; font-size:12px; font-weight:600; }
.message-sound-control small { display:block; margin-top:4px; color:#7b8495; font-size:11px; line-height:1.5; }
.message-sound-control button { min-height:40px; padding:8px 10px; border-radius:8px; background:#fff; color:#b9273c; font-size:12px; }
.message-sound-control button:disabled { opacity:.5; }
.avatar-image { display:block; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.profile-avatar,.message-avatar,.group-icon,.profile-pop-avatar,.friend-avatar,.mini-avatar,.qq-group-avatar { overflow:hidden; flex-shrink:0; }
.profile-avatar:has(.avatar-image),.message-avatar:has(.avatar-image),.group-icon:has(.avatar-image) { padding:0; }
.avatar-upload-preview { width:128px; height:128px; display:grid; place-items:center; overflow:hidden; border-radius:20px; background:#f1f3f7; color:#8590a2; font-size:13px; }
.avatar-upload-preview img { width:100%; height:100%; object-fit:cover; }
.group-avatar-edit { border:1px solid #ffffff60; border-radius:8px; padding:7px 12px; color:#fff; background:#ffffff18; margin:0 0 12px; }

/* Selected membership design 02: two compact rows within the identity card. */
.classic-identity-card { position:relative; z-index:1; margin-top:-22px; padding:17px 14px 14px; background:#fff; border:1px solid #edf0f5; border-radius:17px; box-shadow:0 8px 18px #de3f4910; }
.classic-identity-card .classic-level-card { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin:0; padding:0; border:0; border-radius:0; box-shadow:none; }
.classic-identity-card .classic-level-heading { gap:8px; }
.classic-identity-card .classic-level-heading strong { font-size:11px; font-weight:500; color:#7b8495; }
.classic-identity-card .classic-level-heading > span { font-size:11px; }
.classic-identity-card .level-icons { min-height:24px; margin:0; font-size:19px; line-height:1.4; overflow-wrap:anywhere; }
.classic-identity-card .classic-level-description { flex-basis:100%; font-size:10px; }
.classic-identity-card .classic-benefits-heading { padding-top:14px; margin:13px 0 8px; border-top:1px solid #eef0f4; gap:8px; }
.classic-identity-card .classic-benefits-heading h3 { font-size:12px; font-weight:600; }
.classic-identity-card .classic-benefits-heading > span { font-size:11px; white-space:nowrap; }
.classic-identity-card .classic-membership-grid { grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px 4px; }
.classic-identity-card .classic-membership { min-height:62px; padding:5px 0; gap:5px; border:0; border-radius:7px; background:transparent; color:#334055; }
.classic-identity-card .classic-membership strong { font-size:11px; line-height:1.4; font-weight:500; }
.classic-membership:focus-visible { outline:2px solid #ed3043; outline-offset:2px; }
.membership-icon { position:relative; display:grid; place-items:center; width:32px; height:32px; color:var(--gem-color); flex-shrink:0; }
.membership-icon svg { display:block; width:26px; height:26px; overflow:visible; filter:drop-shadow(0 2px 2px #19274112); }
.membership-icon b { position:absolute; bottom:-1px; left:50%; transform:translateX(-50%); padding:0 3px; border-radius:3px; background:var(--gem-color); color:#fff; font-size:8px; line-height:1.35; font-style:italic; font-weight:700; }
.is-inactive .membership-icon { color:#b4bcc8; }
.is-inactive .membership-icon svg { filter:none; }
.is-inactive .membership-icon b { background:#b4bcc8; }
.classic-identity-card .classic-membership.is-inactive strong { color:#7e899b; }
.classic-identity-card .classic-membership:hover { background:#f6f7fa; }
.badge-status-legend { display:flex; gap:16px; margin-top:13px; font-size:10px; color:#7b8495; }
.badge-status-legend > span { display:flex; align-items:center; gap:5px; }
.badge-status-legend i { width:5px; height:5px; background:#bcc3ce; border-radius:50%; }
.badge-status-legend i.is-lit { background:#ed4355; }
.classic-identity-card .benefits-purpose { margin:8px 0 0; color:#7b8495; font-size:11px; line-height:1.7; }
.classic-member-center { display:flex; align-items:center; justify-content:space-between; padding:18px 16px; background:#fff; color:#334055; border:1px solid #edf0f5; border-radius:14px; text-align:left; }
.classic-member-center small { color:#7b8495; font-size:11px; font-weight:400; }
.membership-detail-hero { display:flex; flex-direction:column; align-items:center; gap:10px; padding:16px 0 23px; }
.membership-detail-hero .membership-icon { width:54px; height:54px; }
.membership-detail-hero .membership-icon svg { width:44px; height:44px; }
.membership-detail-hero .membership-icon b { font-size:11px; }
.membership-detail-hero h3 { margin:0; }
.membership-state { padding:4px 10px; background:#f0f3f8; border-radius:6px; color:#7b8495; font-size:12px; }
.is-open .membership-state { background:#fff0f2; color:#dc3549; }
.membership-detail-section { border-top:1px solid #eef0f4; padding:14px 0; }
.membership-detail-section h4 { margin:0; font-size:14px; }
.membership-detail-section p { margin:8px 0 0; color:#59667c; }
.membership-disclaimer { padding:12px; background:#f6f7fa; border-radius:10px; }
.membership-detail-buy,.membership-detail-all { width:100%; margin-top:12px; }
.membership-detail-buy:disabled { opacity:.5; cursor:default; }
@media (max-width:359px) { .classic-identity-card { padding-left:12px; padding-right:12px; } .classic-identity-card .classic-membership-grid { grid-template-columns:repeat(5,minmax(0,1fr)); } }
