/* =========================================================================
   BANKPEDIAA COMMUNITY — DESIGN SYSTEM v2 (light)
   Skool-inspired: calm, premium, spacious. Light neutral field, one green
   signal color (#16A34A), white cards, soft shadows, restrained motion.
   Source of truth: design.md + snapshots/. Fonts: Plus Jakarta Sans.

   GRID CONTRACT (read this before touching any grid):
   Every multi-card row uses CSS Grid with `minmax(0,1fr)` tracks and
   `grid-auto-rows: 1fr`. With fr-unit tracks the browser allocates exactly
   equal width to every column and equal height to every row, by definition.
   A card can only look "bigger" than its siblings if wrong markup pulls it
   out of the grid flow or an inline width/flex override is added. Every grid
   child gets box-sizing + min-width:0 resets below.
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
* { min-width: 0; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
html { scroll-behavior: smooth; }
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

:root {
  /* Surfaces — light */
  --bg:            #FAFAFA;   /* app field */
  --bg-soft:       #FFFFFF;   /* inputs */
  --panel:         #FFFFFF;   /* cards */
  --panel-2:       #F3F4F6;   /* elevated / hover fill */
  --panel-hover:   #F0F1F3;
  --stroke:        #E5E7EB;
  --stroke-2:      #D1D5DB;
  --stroke-soft:   rgba(17,24,39,0.05);
  --sidebar-bg:    #FFFFFF;

  /* Text */
  --text-hi:       #111827;
  --text-md:       #4B5563;
  --text-lo:       #9CA3AF;

  /* Signal — green */
  --community-green:      #1877F2;   /* brand blue (Facebook-style) */
  --community-green-dim:  #1560C7;
  --community-green-tint: rgba(24, 119, 242, 0.10);
  --community-green-glow: rgba(24, 119, 242, 0.22);
  --green-soft:    #EAF2FE;   /* very light blue fill (active nav, tints) */
  --on-green:      #FFFFFF;   /* text/icon color on a blue fill */

  --gold:          #F59E0B;
  --gold-tint:     rgba(245, 158, 11, 0.12);
  --gold-soft:     #FFFBEB;
  --danger:        #EF4444;
  --danger-tint:   rgba(239, 68, 68, 0.10);
  --info:          #3B82F6;
  --info-tint:     rgba(59, 130, 246, 0.10);
  --purple:        #8B5CF6;
  --purple-tint:   rgba(139, 92, 246, 0.12);

  /* legacy alias kept so nothing depending on old token name breaks */
  --amber: var(--gold);
  --ink: var(--sidebar-bg);

  --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  --r-xs:  8px;
  --r-sm:  12px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  24px;
  --r-pill: 999px;
  /* legacy aliases */
  --radius-lg: var(--r-lg);
  --radius-md: var(--r-md);
  --radius-sm: var(--r-sm);

  --shadow-1: 0 1px 2px rgba(17,24,39,0.04);
  --shadow-2: 0 10px 40px rgba(17,24,39,0.05);
  --shadow-3: 0 20px 50px rgba(17,24,39,0.08);
  --shadow-card: var(--shadow-2);
  --shadow-card-hover: 0 14px 44px rgba(17,24,39,0.09);
  --shadow-glow: 0 0 0 3px rgba(24,119,242,0.14);

  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.15s;
  --dur-med:  0.22s;
  --dur-slow: 0.4s;

  --nav-h: 62px;
  --sidebar-w: 280px;
  --rail-w: 320px;
  --max-content: 760px;
}

body {
  background: var(--bg);
  color: var(--text-md);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Aurora background removed in the light theme — design.md avoids heavy
   decorative backgrounds. Hidden here so existing markup can stay untouched. */
.aurora { display: none !important; }

.app-shell { position: relative; z-index: 1; display: flex; min-height: 100vh; }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text-hi); margin: 0 0 8px; font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: 26px; line-height: 1.25; }
h2 { font-size: 20px; letter-spacing: -0.01em; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; color: var(--text-md); overflow-wrap: anywhere; }
a { color: var(--community-green); text-decoration: none; transition: color var(--dur-fast) ease; overflow-wrap: anywhere; }
a:hover:not(.btn) { color: var(--community-green-dim); }
::selection { background: var(--community-green-tint); color: var(--text-hi); }
:focus-visible { outline: 2px solid var(--community-green); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--stroke-2); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-lo); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---- Layout shells ---- */
.sidebar { display: none; }
.main-col { flex: 1; min-width: 0; padding-bottom: calc(var(--nav-h) + 28px); }

/* Center column + optional right rail live inside .content-area.
   Pages that set a right rail render <div class="content-area"> ...
   otherwise .content is used standalone and still centers. */
.content { max-width: var(--max-content); margin: 0 auto; padding: 22px 16px 40px; animation: viewFadeIn 0.4s var(--ease-out) both; }
.content-area { display: flex; gap: 24px; align-items: flex-start; max-width: calc(var(--max-content) + var(--rail-w) + 24px); margin: 0 auto; padding: 22px 16px 40px; }
.content-area .content { padding: 0; margin: 0; max-width: none; flex: 1; min-width: 0; }
.rightrail { display: none; }
@keyframes viewFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 1000px) {
  .sidebar {
    display: flex; flex-direction: column;
    width: var(--sidebar-w); flex-shrink: 0;
    border-right: 1px solid var(--stroke);
    padding: 20px 14px;
    position: fixed; top: 0; left: 0; height: 100vh;
    overflow-y: auto;
    background: var(--sidebar-bg);
    z-index: 30;
  }
  .main-col { margin-left: var(--sidebar-w); padding-bottom: 40px; }
  .content { padding: 28px 32px 56px; }
  .content-area { padding: 28px 32px 56px; }
  .bottom-nav { display: none !important; }
}
@media (min-width: 1180px) {
  .rightrail { display: block; width: var(--rail-w); flex-shrink: 0; position: sticky; top: 84px; }
}

/* ---- Desktop top bar (sticky search) ---- */
.topbar-desktop {
  display: none;
}
@media (min-width: 1000px) {
  .topbar-desktop {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 32px;
    position: sticky; top: 0; z-index: 25;
    background: rgba(250,250,250,0.85);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border-bottom: 1px solid var(--stroke);
  }
}
.topsearch { flex: 1; max-width: 620px; margin: 0 auto; position: relative; }
.topsearch input {
  width: 100%; height: 44px;
  background: var(--panel); border: 1px solid var(--stroke);
  border-radius: var(--r-pill); padding: 0 16px 0 42px; font-size: 14px; color: var(--text-hi);
  box-shadow: var(--shadow-1);
}
.topsearch input::placeholder { color: var(--text-lo); }
.topsearch .search-ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-lo); pointer-events: none; }
.topsearch .search-ico svg { width: 18px; height: 18px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ---- Topbar (mobile) ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--stroke);
  position: sticky; top: 0;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  z-index: 20;
}
@media (min-width: 1000px) { .topbar { display: none; } }

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; color: var(--text-hi); font-size: 16px; letter-spacing: -0.01em; text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: var(--r-xs);
  background: var(--community-green);
  display: flex; align-items: center; justify-content: center;
  color: var(--on-green); font-weight: 900; font-size: 15px; flex-shrink: 0;
}
.brand-logo-img { height: 26px; width: auto; }
.brand-logo-sm { height: 22px; }

/* ---- Sidebar / drawer shared nav ---- */
.nav-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-lo); font-weight: 700; margin: 16px 12px 6px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--text-md); font-weight: 600; font-size: 14px;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; opacity: 0.9; }
.nav-item:hover { background: var(--panel-2); color: var(--text-hi); }
.nav-item.active {
  background: var(--green-soft);
  color: var(--community-green-dim);
  font-weight: 700;
}
.nav-item.active svg { opacity: 1; color: var(--community-green); }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-top: 1px solid var(--stroke);
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  position: relative;
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 8px;
  color: var(--text-lo); font-size: 10.5px; font-weight: 600;
  transition: color var(--dur-fast) ease;
}
.bottom-nav a svg { width: 21px; height: 21px; transition: transform var(--dur-fast) var(--ease-spring); }
.bottom-nav a.active { color: var(--community-green); }
.bottom-nav a.active svg { transform: translateY(-1px) scale(1.06); }
.bottom-nav a:active svg { transform: scale(0.88); }

.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-pill);
  color: var(--text-md); background: transparent; border: none; cursor: pointer;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-fast) ease;
  flex-shrink: 0; position: relative;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text-hi); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn svg { width: 20px; height: 20px; }

.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 800;
  border-radius: 999px; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid var(--bg);
}
.notif-badge-tab { top: -3px; right: 16px; }
.nav-badge {
  margin-left: auto; background: var(--community-green); color: var(--on-green);
  font-size: 10px; font-weight: 800; border-radius: 999px;
  min-width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
  flex-shrink: 0;
}

.drawer-overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,0.45); backdrop-filter: blur(2px); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity var(--dur-med) ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 85%; max-width: 320px;
  background: var(--sidebar-bg); border-right: 1px solid var(--stroke);
  z-index: 50;
  transform: translateX(-105%);
  transition: transform 0.32s var(--ease-out);
  display: flex; flex-direction: column; overflow-y: auto;
  box-shadow: 24px 0 60px rgba(17,24,39,0.16);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--stroke); }
@media (min-width: 1000px) { .drawer, .drawer-overlay { display: none; } }

/* =========================================================================
   CARDS + GRID
   ========================================================================= */
.card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  transition: border-color var(--dur-med) ease, box-shadow var(--dur-med) ease, transform var(--dur-med) var(--ease-out);
}
.card + .card { margin-top: 16px; }
.card-flat { border-radius: var(--r-md); padding: 16px; box-shadow: none; }
.card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
/* Cards that shouldn't lift (composers, forms, static panels) can add .card-static */
.card-static:hover { transform: none; box-shadow: var(--shadow-card); }

/* Bulletproof uniform grid */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  justify-items: stretch;
  gap: 14px;
}
@media (min-width: 640px)  { .directory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1100px) { .directory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }

.directory-grid > .card,
.directory-grid > * {
  height: 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0 !important;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.member-tile {
  text-align: center;
  padding: 22px 16px;
  align-items: center;
  justify-content: flex-start;
  contain: layout inline-size;
  position: relative;
  overflow: hidden;
}
.member-tile .avatar { width: 60px; height: 60px; min-width: 60px; min-height: 60px; max-width: 60px; max-height: 60px; font-size: 20px; margin: 0 auto 12px; flex-shrink: 0; }
.member-tile .name { font-size: 14px; font-weight: 700; color: var(--text-hi); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.member-tile .role { font-size: 12px; color: var(--text-lo); margin-bottom: 12px; min-height: 14px; overflow: hidden; text-overflow: ellipsis; width: 100%; flex: 1; }

.stat-tile { justify-content: space-between; align-items: flex-start; position: relative; overflow: hidden; }
.stat-tile h2, .stat-tile h3 { margin: 6px 0 0; font-variant-numeric: tabular-nums; }

/* ---- Members Directory ---- */
.dir-controls { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: stretch; }
.dir-controls .topsearch { flex: 1; min-width: 220px; max-width: none; margin: 0; }
.dir-select { width: auto; min-width: 150px; height: 48px; padding: 0 34px 0 14px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--stroke); color: var(--text-hi); font-size: 14px; font-weight: 500; }
.dir-filter-btn { height: 48px; }
.upgrade-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--green-soft); border: 1px solid rgba(24,119,242,0.25); border-radius: var(--r-lg); padding: 14px 18px; margin-bottom: 16px; flex-wrap: wrap; }
.upgrade-banner .ub-text { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--community-green-dim); font-size: 14px; }
.upgrade-banner .ub-text svg { width: 18px; height: 18px; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.dir-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.dir-card { display: flex; align-items: flex-start; gap: 14px; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 18px; min-width: 0; transition: box-shadow var(--dur-med) ease, transform var(--dur-med) var(--ease-out); }
.dir-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.dir-card > .avatar { width: 58px; height: 58px; font-size: 20px; flex-shrink: 0; }
.dir-info { min-width: 0; flex: 1; }
.dir-name { display: flex; align-items: flex-start; gap: 5px; font-weight: 700; color: var(--text-hi); font-size: 15px; line-height: 1.3; }
.dir-name .nm { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dir-name .verified { margin-top: 1px; }
.dir-meta { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.dir-meta span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-md); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-meta svg { width: 14px; height: 14px; color: var(--text-lo); flex-shrink: 0; }
.dir-free-label { margin-top: 6px; font-size: 12.5px; color: var(--text-lo); font-weight: 600; }
.dir-msg { flex-shrink: 0; align-self: center; }
.verified { display: inline-flex; align-items: center; flex-shrink: 0; }
.verified svg { width: 16px; height: 16px; display: block; }
.dir-privacy { text-align: center; color: var(--text-lo); font-size: 13px; margin-top: 28px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.dir-privacy svg { width: 15px; height: 15px; }
.pagenav { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pagenav a, .pagenav .gap { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; color: var(--text-md); }
.pagenav a { border: 1px solid var(--stroke); background: var(--panel); }
.pagenav a:hover { background: var(--panel-2); color: var(--text-hi); }
.pagenav a.active { background: var(--community-green); color: #fff; border-color: var(--community-green); }
.pagenav a.disabled { opacity: .45; pointer-events: none; }
.pagenav a svg { width: 16px; height: 16px; }
.pagenav .prev svg { transform: rotate(180deg); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-sm);
  padding: 11px 18px; font-weight: 700; font-size: 14px; font-family: var(--font-body);
  border: 1px solid transparent; cursor: pointer;
  transition: transform var(--dur-fast) ease, background var(--dur-fast) ease, border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, color var(--dur-fast) ease;
  text-align: center; white-space: nowrap;
  position: relative;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--community-green);
  color: var(--on-green);
  box-shadow: 0 1px 2px rgba(24,119,242,0.25);
}
.btn-primary:hover { background: var(--community-green-dim); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(24,119,242,0.28); }
.btn-outline { background: var(--panel); border-color: var(--stroke-2); color: var(--text-hi); }
.btn-outline:hover { border-color: var(--community-green); color: var(--community-green-dim); background: var(--green-soft); }
.btn-ghost { background: transparent; color: var(--text-md); }
.btn-ghost:hover { color: var(--text-hi); background: var(--panel-2); }
.btn-amber { background: var(--gold); color: #fff; }
.btn-amber:hover { filter: brightness(0.96); transform: translateY(-1px); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-tint); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 13px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }

/* ---- Forms ---- */
label { display: block; font-size: 13px; font-weight: 650; color: var(--text-hi); margin-bottom: 6px; }
.field { margin-bottom: 16px; min-width: 0; }
input, textarea, select {
  width: 100%; max-width: 100%;
  background: var(--bg-soft); border: 1px solid var(--stroke); color: var(--text-hi);
  border-radius: var(--r-md); padding: 12px 14px; font-size: 14px;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
input::placeholder, textarea::placeholder { color: var(--text-lo); }
input:focus, textarea:focus, select:focus { border-color: var(--community-green); outline: none; box-shadow: 0 0 0 3px var(--community-green-tint); }
textarea { resize: vertical; min-height: 90px; }
.help-text { font-size: 12px; color: var(--text-lo); margin-top: 6px; }
.error-text { font-size: 12px; color: var(--danger); margin-top: 6px; }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.badge-member-id { font-family: var(--font-mono); background: var(--panel-2); color: var(--community-green-dim); border: 1px solid var(--stroke); }
.badge-level { background: var(--green-soft); color: var(--community-green-dim); }
.badge-free { background: var(--panel-2); color: var(--text-md); }
.badge-locked { background: var(--gold-soft); color: var(--gold); }
.badge-admin { background: var(--green-soft); color: var(--community-green-dim); }
.badge-verified { background: var(--info-tint); color: var(--info); }
.badge-top { background: var(--gold-soft); color: var(--gold); }
.badge-purple { background: var(--purple-tint); color: var(--purple); }

/* ---- Avatar ---- */
.avatar {
  width: 40px; height: 40px; min-width: 40px; min-height: 40px;
  border-radius: 50%;
  background-color: var(--panel-2);
  background-size: cover; background-position: center;
  border: 1px solid var(--stroke);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-md); font-weight: 700;
  overflow: hidden;
}

/* ---- Alerts ---- */
.alert { border-radius: var(--r-md); padding: 12px 16px; font-size: 13.5px; margin-bottom: 16px; border: 1px solid; }
.alert-error { background: var(--danger-tint); border-color: rgba(239,68,68,0.3); color: #b91c1c; }
.alert-success { background: var(--green-soft); border-color: rgba(24,119,242,0.3); color: var(--community-green-dim); }

/* ---- Locked content teaser ---- */
.locked-panel { position: relative; border-radius: var(--r-lg); padding: 26px 20px; text-align: center; background: var(--gold-soft); border: 1px dashed var(--gold); overflow: hidden; }
.lock-icon { width: 34px; height: 34px; margin: 0 auto 10px; color: var(--gold); position: relative; }
.locked-panel h3 { color: var(--text-hi); }

/* ---- Auth screens ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; position: relative; z-index: 1; }
.auth-card { width: 100%; max-width: 420px; }
.auth-hero { text-align: center; margin-bottom: 26px; }
.auth-hero .brand-mark { width: 46px; height: 46px; font-size: 21px; margin: 0 auto 14px; border-radius: var(--r-sm); }
.auth-hero h1 { font-size: 23px; margin-bottom: 6px; }
.auth-hero p { font-size: 14px; color: var(--text-md); max-width: 340px; margin: 0 auto; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-lo); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--stroke); }
.auth-switch { text-align: center; font-size: 14px; margin-top: 18px; color: var(--text-md); }

/* Split-hero auth (login / register) */
.auth-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-left { padding: 48px 64px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; background: linear-gradient(160deg, #ffffff, var(--green-soft)); }
.auth-left > * { width: 100%; max-width: 440px; }
.auth-left .a-head { font-family: var(--font-display); font-size: 38px; line-height: 1.12; font-weight: 800; color: var(--text-hi); letter-spacing: -0.02em; margin-bottom: 14px; }
.auth-left .a-head .g { color: var(--community-green); }
.auth-left .a-lead { font-size: 15px; color: var(--text-md); max-width: 420px; margin-bottom: 30px; line-height: 1.6; }
.auth-props { display: flex; flex-direction: column; gap: 20px; }
.auth-prop { display: flex; gap: 14px; align-items: flex-start; text-align: left; }
.auth-prop .ic { width: 44px; height: 44px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-prop .ic svg { width: 22px; height: 22px; }
.auth-prop h4 { margin: 0 0 2px; font-size: 15px; color: var(--text-hi); }
.auth-prop p { margin: 0; font-size: 13px; color: var(--text-md); }
.auth-tagline { margin-top: 30px; font-style: italic; color: var(--community-green-dim); font-weight: 600; font-size: 15px; }
.auth-right { display: flex; align-items: center; justify-content: flex-start; padding: 48px 64px; background: var(--bg); }
.auth-right .auth-card { max-width: 400px; width: 100%; }
.auth-form-title { text-align: center; margin-bottom: 4px; }
.auth-form-sub { text-align: center; color: var(--text-md); font-size: 14px; margin-bottom: 20px; }
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-left { padding: 40px 24px 4px; text-align: center; align-items: center; }
  .auth-left .a-head { font-size: 30px; }
  .auth-props, .auth-tagline { display: none; }
  .auth-left { align-items: center; }
  .auth-left > * { max-width: 460px; }
  .auth-right { padding: 24px 20px 40px; justify-content: center; }
}

/* ---- Feed ---- */
.post-card { padding: 18px 20px; }
.post-card.admin-post { border-color: rgba(24,119,242,0.35); background: var(--green-soft); }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-meta { display: flex; flex-direction: column; min-width: 0; }
.post-meta .name { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; font-weight: 700; color: var(--text-hi); font-size: 14.5px; }
.post-meta .sub { font-size: 12.5px; color: var(--text-lo); }
.post-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--text-hi); margin: 4px 0 8px; letter-spacing: -0.01em; }
.post-body { font-family: 'Inter', var(--font-body); font-size: 15.5px; color: var(--text-hi); line-height: 1.62; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-actions { display: flex; gap: 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--stroke); }
.post-action { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-lo); font-weight: 600; background: none; border: none; cursor: pointer; padding: 4px; transition: color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring); }
.post-action svg { width: 18px; height: 18px; }
.post-action.liked { color: var(--community-green); }
.post-action:hover { color: var(--text-hi); }
.post-action:active { transform: scale(0.9); }
.pin-flag { display: inline-flex; align-items: center; gap: 4px; color: var(--community-green-dim); font-size: 11px; font-weight: 700; }
.pin-flag svg { width: 12px; height: 12px; }

/* Post category chip */
.cat-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--panel-2); color: var(--text-md); }

/* Embeds inside posts / lessons */
.embed-frame { position: relative; width: 100%; border-radius: var(--r-md); overflow: hidden; margin-top: 12px; background: var(--panel-2); border: 1px solid var(--stroke); }
.embed-frame.ratio-video { padding-bottom: 56.25%; height: 0; }
.embed-frame.ratio-doc { padding-bottom: 120%; height: 0; }
.embed-frame iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.embed-x { margin-top: 12px; }
.embed-x .twitter-tweet { margin: 0 !important; }

.composer { margin-bottom: 20px; }
.composer-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.composer-tool { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: var(--r-sm); border: 1px solid var(--stroke); background: var(--panel); color: var(--text-md); font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--dur-fast) ease; }
.composer-tool:hover { border-color: var(--community-green); color: var(--community-green-dim); background: var(--green-soft); }
.composer-tool svg { width: 16px; height: 16px; }
.char-count { text-align: right; font-size: 11.5px; color: var(--text-lo); margin-top: -8px; margin-bottom: 12px; }
.char-count.warn { color: var(--danger); }
.comments-list { margin-top: 14px; background: var(--bg); border: 1px solid var(--stroke); border-radius: var(--r-md); padding: 2px 14px; }
.comment { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--stroke); }
.comment:first-child { border-top: none; }
.comment .c-av { width: 28px; height: 28px; min-width: 28px; min-height: 28px; font-size: 12px; flex-shrink: 0; }
.comment .c-body { min-width: 0; font-size: 13.5px; line-height: 1.5; }
.comment .c-name { font-weight: 700; color: var(--text-hi); font-size: 13px; margin-right: 5px; }
.comment .c-text { color: var(--text-md); }

/* Feed filter tabs + New Post row (segmented pill tabs) */
.feed-top { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin-bottom: 22px; }
.feed-tabs { display: flex; gap: 6px; overflow-x: auto; flex: 1; min-width: 0; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 2px 0; }
.feed-tabs::-webkit-scrollbar { display: none; }
.feed-tab { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; color: var(--text-md); white-space: nowrap; transition: background var(--dur-fast) ease, color var(--dur-fast) ease; }
.feed-tab svg { width: 16px; height: 16px; }
.feed-tab:hover { background: var(--panel-2); color: var(--text-hi); }
.feed-tab.active { background: var(--community-green); color: var(--on-green); }
.feed-tab.active svg { color: var(--on-green); }
.feed-top .btn { flex-shrink: 0; }

/* Sidebar footer — user identity + account menu */
.side-foot { margin-top: auto; padding-top: 14px; }
.side-user { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md); transition: background var(--dur-fast) ease; }
.side-user:hover { background: var(--panel-2); }
.side-user > .avatar { width: 40px; height: 40px; }
.side-user-info { min-width: 0; flex: 1; }
.su-name { font-size: 13.5px; font-weight: 700; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-role { display: inline-block; margin-top: 3px; font-size: 10.5px; font-weight: 700; color: var(--community-green-dim); background: var(--green-soft); padding: 2px 9px; border-radius: 999px; }
.su-role.is-free { color: #B45309; background: var(--gold-soft); }
.su-menu-btn { flex-shrink: 0; width: 32px; height: 32px; border: none; background: transparent; color: var(--text-lo); border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background var(--dur-fast) ease, color var(--dur-fast) ease; }
.su-menu-btn:hover { background: var(--stroke); color: var(--text-hi); }
.su-menu-btn svg { width: 18px; height: 18px; }
.su-menu { position: absolute; bottom: calc(100% + 6px); right: 0; left: 0; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--r-md); box-shadow: var(--shadow-3); padding: 6px; display: none; z-index: 60; }
.su-menu.open { display: block; }
.su-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 600; color: var(--text-md); }
.su-menu a:hover { background: var(--panel-2); color: var(--text-hi); }
.su-menu a svg { width: 16px; height: 16px; }

/* ---- Right rail widgets ---- */
.rail-card { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 18px; }
.rail-card + .rail-card { margin-top: 20px; }
.rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rail-head h3 { margin: 0; font-size: 15px; }
.rail-head a { font-size: 12.5px; font-weight: 600; }
.rail-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.rail-row + .rail-row { border-top: 1px solid var(--stroke); }
.rail-row .avatar { width: 34px; height: 34px; font-size: 13px; }
.rail-row .r-name { font-size: 13.5px; font-weight: 600; color: var(--text-hi); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-row .r-meta { margin-left: auto; font-family: var(--font-mono); font-size: 12.5px; color: var(--community-green-dim); font-weight: 700; flex-shrink: 0; }
.rail-rank { width: 22px; text-align: center; font-weight: 800; font-size: 13px; color: var(--text-lo); flex-shrink: 0; }
.rail-rank.top1 { color: #EAB308; } .rail-rank.top2 { color: #9CA3AF; } .rail-rank.top3 { color: #B45309; }
/* Event item */
.event-item { display: flex; gap: 12px; padding: 10px 0; }
.event-item + .event-item { border-top: 1px solid var(--stroke); }
.event-date { width: 44px; flex-shrink: 0; text-align: center; background: var(--green-soft); border-radius: var(--r-sm); padding: 6px 0; }
.event-date .mon { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--community-green-dim); letter-spacing: 0.05em; }
.event-date .day { font-size: 18px; font-weight: 800; color: var(--text-hi); line-height: 1.1; }
.event-info .e-title { font-size: 13.5px; font-weight: 700; color: var(--text-hi); }
.event-info .e-time { font-size: 12px; color: var(--text-lo); }

/* Sidebar group / upgrade card */
.side-card { margin-top: 14px; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--r-md); padding: 14px; }
.side-card h4 { display: flex; align-items: center; gap: 6px; font-size: 13.5px; margin: 0 0 4px; color: var(--text-hi); }
.side-card p { font-size: 12.5px; color: var(--text-md); margin: 0 0 12px; }
.progress { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--community-green); border-radius: 999px; }

/* ---- Classroom ---- */
.module-card { padding: 0; overflow: hidden; }
.module-head { padding: 16px 18px; border-bottom: 1px solid var(--stroke); background: var(--green-soft); }
.module-head h3 { color: var(--text-hi); margin: 0; }
.module-head-row { display: flex; align-items: center; gap: 14px; }
.module-num { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--panel); border: 1px solid rgba(24,119,242,0.25); display: flex; align-items: center; justify-content: center; color: var(--community-green); flex-shrink: 0; }
.module-num svg { width: 22px; height: 22px; }

/* ---- Subject tiles (Classroom) ---- */
.subject-chip { width: 46px; height: 46px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 800; }
.subject-chip svg { width: 24px; height: 24px; }
.subject-green  { background: var(--green-soft); color: var(--community-green-dim); }
.subject-blue   { background: #EFF6FF; color: #2563EB; }
.subject-purple { background: #F5F3FF; color: #7C3AED; }
.subject-amber  { background: var(--gold-soft); color: #B45309; }
.subject-pink   { background: #FDF2F8; color: #DB2777; }
.subject-teal   { background: #F0FDFA; color: #0D9488; }

/* Subject cards (member classroom) */
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-bottom: 20px; }
.subject-card { display: block; text-decoration: none; }
.subject-title { font-weight: 700; color: var(--text-hi); font-size: 16px; }
.subject-desc { margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.subject-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--stroke); padding-top: 14px; }
.subject-foot .small { display: flex; align-items: center; gap: 6px; }
.subject-foot .small svg { width: 15px; height: 15px; }
.ring { position: relative; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: conic-gradient(var(--community-green) calc(var(--p) * 1%), var(--stroke) 0); flex-shrink: 0; }
.ring::before { content: ''; position: absolute; width: 34px; height: 34px; border-radius: 50%; background: var(--panel); }
.ring span { position: relative; font-size: 9.5px; font-weight: 800; color: var(--text-hi); }

/* Lesson accordion + resources */
.lesson-acc { border-top: 1px solid var(--stroke); }
.lesson-acc summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 18px; }
.lesson-acc summary::-webkit-details-marker { display: none; }
.lesson-acc summary:hover { background: var(--panel-2); }
.lesson-acc .lesson-t { flex: 1; min-width: 0; font-weight: 600; color: var(--text-hi); font-size: 14px; }
.lesson-acc summary > svg:last-child { width: 16px; height: 16px; color: var(--text-lo); transition: transform var(--dur-fast) ease; flex-shrink: 0; }
.lesson-acc[open] summary > svg:last-child { transform: rotate(90deg); }
.lesson-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--stroke-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lesson-check.done { background: var(--community-green); border-color: var(--community-green); color: #fff; }
.lesson-check svg { width: 13px; height: 13px; }
.lesson-body { padding: 4px 18px 18px 50px; }
.resource-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); text-decoration: none; transition: background var(--dur-fast) ease; }
.resource-row:hover { background: var(--panel-2); }
.res-ico { width: 34px; height: 34px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--panel-2); color: var(--text-md); }
.res-ico.res-youtube { background: #FEE2E2; color: #DC2626; }
.res-ico svg { width: 17px; height: 17px; }
.resource-row .res-title { flex: 1; min-width: 0; font-weight: 600; color: var(--text-hi); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-row > svg:last-child { width: 16px; height: 16px; color: var(--text-lo); flex-shrink: 0; }

/* ---- Full-screen resource viewer (watch.php) ---- */
.watch-shell { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); z-index: 100; }
.watch-top { height: 58px; flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--stroke); }
.watch-title { font-weight: 700; color: var(--text-hi); font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.watch-body-dark { background: #0b0b0b; }
.doc-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.yt-wrap { width: 100%; max-width: 1100px; margin: 0 auto; background: #000; position: relative; }
.yt-wrap #ytPlayer, .yt-wrap iframe { width: 100%; aspect-ratio: 16 / 9; display: block; }
.yt-shield { position: absolute; top: 0; left: 0; right: 0; bottom: 52px; cursor: pointer; z-index: 2; }
.yt-controls { position: relative; z-index: 3; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #111; }
.yt-btn { background: transparent; border: none; color: #fff; font-size: 15px; cursor: pointer; width: 34px; height: 34px; border-radius: 8px; }
.yt-btn:hover { background: rgba(255,255,255,0.12); }
.yt-time { color: #cbd5e1; font-size: 12px; font-family: var(--font-mono); flex-shrink: 0; }
.yt-seek { flex: 1; min-width: 0; accent-color: var(--community-green); height: 4px; }
.yt-rate { background: #1f2937; color: #fff; border: 1px solid #374151; border-radius: 8px; padding: 5px 8px; font-size: 12px; width: auto; height: auto; }
@media (max-width: 640px) { .yt-shield { bottom: 48px; } .yt-controls { height: 48px; gap: 6px; padding: 0 8px; } .yt-rate { padding: 4px 6px; } }
/* Fullscreen video sizing */
.yt-wrap:fullscreen, .yt-wrap:-webkit-full-screen { max-width: none; width: 100vw; height: 100vh; display: flex; flex-direction: column; justify-content: center; background: #000; }
.yt-wrap:fullscreen #ytPlayer, .yt-wrap:fullscreen iframe { aspect-ratio: auto; width: 100vw; height: calc(100vh - 52px); }
.yt-wrap:-webkit-full-screen #ytPlayer, .yt-wrap:-webkit-full-screen iframe { aspect-ratio: auto; width: 100vw; height: calc(100vh - 52px); }

/* ---- Themed confirm / alert modal ---- */
.app-modal-overlay { position: fixed; inset: 0; background: rgba(17,24,39,0.45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) ease; }
.app-modal-overlay.open { opacity: 1; pointer-events: auto; }
.app-modal { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--r-xl); box-shadow: var(--shadow-3); padding: 24px; max-width: 400px; width: 100%; transform: translateY(8px) scale(.98); transition: transform var(--dur-med) var(--ease-out); }
.app-modal-overlay.open .app-modal { transform: none; }
.app-modal-msg { font-size: 15px; color: var(--text-hi); font-weight: 600; margin-bottom: 20px; line-height: 1.5; }
.app-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---- Membership expiry bar ---- */
.expiry-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-radius: var(--r-md); padding: 12px 16px; margin-bottom: 16px; font-size: 13.5px; line-height: 1.5; }
.expiry-bar svg { width: 17px; height: 17px; vertical-align: -3px; margin-right: 4px; }
.expiry-bar strong { font-weight: 700; }
.expiry-bar.auto { background: var(--info-tint); border: 1px solid rgba(59,130,246,0.3); color: #1E40AF; }
.expiry-bar.warn { background: var(--gold-soft); border: 1px solid rgba(245,158,11,0.4); color: #92400E; }

/* ---- Toast notifications ---- */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 300; display: flex; flex-direction: column; gap: 12px; width: 384px; max-width: calc(100vw - 32px); }
.toast { position: relative; display: flex; align-items: flex-start; gap: 14px; background: var(--panel); border-radius: 16px; box-shadow: 0 14px 34px rgba(15,23,42,0.14), 0 2px 6px rgba(15,23,42,0.06); padding: 16px 42px 18px 16px; overflow: hidden; animation: toastIn .38s var(--ease-out) both; }
.toast-ic { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.toast-ic svg { width: 22px; height: 22px; }
.toast-body { min-width: 0; padding-top: 2px; }
.toast-title { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-weight: 700; font-size: 15.5px; line-height: 1.25; color: var(--text-hi); }
.toast-msg { margin-top: 3px; font-size: 14px; line-height: 1.45; color: var(--text-md); }
.toast-x { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--text-lo); border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; }
.toast-x:hover { background: var(--panel-2); color: var(--text-hi); }
.toast-x svg { width: 15px; height: 15px; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; animation: toastBar 4200ms linear forwards; }

/* per-type accents (icon badge + progress bar) */
.toast-success  .toast-ic { background: rgba(16,185,129,0.12); color: #10B981; }
.toast-success  .toast-bar { background: #10B981; }
.toast-error    .toast-ic { background: rgba(239,68,68,0.12);  color: #EF4444; }
.toast-error    .toast-bar { background: #EF4444; }
.toast-warning  .toast-ic { background: rgba(245,158,11,0.15); color: #F59E0B; }
.toast-warning  .toast-bar { background: #F59E0B; }
.toast-info     .toast-ic { background: #1877F2; color: #fff; }
.toast-info     .toast-bar { background: #1877F2; }
.toast-announcement .toast-ic { background: #1877F2; color: #fff; }
.toast-announcement .toast-bar { background: #1877F2; }
.toast-event    .toast-ic { background: rgba(24,119,242,0.12); color: #1877F2; }
.toast-event    .toast-bar { background: #1877F2; }

.toast.hide { animation: toastOut .3s var(--ease-out) both; }
@keyframes toastIn { from { opacity: 0; transform: translateX(26px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(26px); } }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .toast-bar { animation: none; } .toast, .toast.hide { animation-duration: .01ms; } }
@media (max-width: 480px) { .toast-wrap { left: 12px; right: 12px; width: auto; top: 12px; } }

/* ================= Landing page (premium) ================= */
.lp { background: #fff; color: var(--text-md); overflow-x: hidden; --community-green: #1877F2; --community-green-dim: #1560C7; --green-soft: #EAF2FE; --community-green-tint: rgba(24,119,242,0.10); --community-green-glow: rgba(24,119,242,0.22); }
.lp-logo { height: 30px; width: auto; display: block; }
.lp-container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.lp-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.lp-reveal.in { opacity: 1; transform: none; }

/* Nav (glass) */
.lp-nav { position: sticky; top: 0; z-index: 40; padding: 13px 0; background: rgba(255,255,255,0.7); backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%); border-bottom: 1px solid rgba(17,24,39,0.06); }
.lp-nav .lp-container { display: flex; align-items: center; gap: 20px; justify-content: space-between; }
.lp-brand { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; color: var(--text-hi); text-decoration: none; }
.lp-brand .g { color: var(--community-green); }
.lp-nav-menu { display: flex; gap: 6px; margin: 0 auto; }
.lp-nav-link { font-size: 14.5px; font-weight: 600; color: var(--text-md); text-decoration: none; padding: 8px 14px; border-radius: 999px; transition: background .15s, color .15s; }
.lp-nav-link:hover { background: var(--panel-2); color: var(--text-hi); }
.lp-nav-link.active { color: var(--community-green-dim); background: var(--green-soft); }
.lp-nav-actions { display: flex; gap: 10px; align-items: center; }
@media (max-width: 960px) { .lp-nav-menu { display: none; } }

/* Hero */
.lp-hero { position: relative; padding: 72px 0 44px; overflow: hidden; }
.lp-hero::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(900px 540px at 78% -8%, rgba(24,119,242,0.16), transparent 60%), radial-gradient(700px 520px at 6% 24%, rgba(24,119,242,0.06), transparent 55%); }
.lp-hero .lp-container { position: relative; z-index: 1; }
.lp-hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.lp-badge { display: inline-flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--stroke); box-shadow: var(--shadow-1); color: var(--community-green-dim); font-weight: 600; font-size: 13px; padding: 7px 15px 7px 12px; border-radius: 999px; margin-bottom: 24px; }
.lp-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--community-green); box-shadow: 0 0 0 4px var(--green-soft); }
.lp-hero h1 { font-family: var(--font-display); font-size: 60px; line-height: 1.03; letter-spacing: -0.035em; color: var(--text-hi); margin: 0 0 20px; font-weight: 800; }
.lp-hero h1 .g { background: linear-gradient(120deg, #1877F2, #5AA9FF); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.lp-lead { font-size: 18px; color: var(--text-md); max-width: 460px; margin: 0 0 30px; line-height: 1.6; }
.lp-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.lp .btn-primary { box-shadow: 0 10px 28px rgba(24,119,242,0.28); }
.lp .btn-primary:hover { box-shadow: 0 14px 34px rgba(24,119,242,0.36); }
.lp-social-proof { display: flex; align-items: center; gap: 12px; }
.lp-avatars { display: flex; }
.lp-avatars .avatar { width: 38px; height: 38px; margin-left: -12px; border: 2.5px solid #fff; box-shadow: var(--shadow-1); }
.lp-avatars .avatar:first-child { margin-left: 0; }
.lp-social-proof .txt { font-size: 14px; color: var(--text-md); }
.lp-social-proof .txt b { color: var(--text-hi); }
.lp-stars { color: #F59E0B; font-size: 13px; letter-spacing: 1px; }

/* Hero product window */
.lp-visual { position: relative; }
.hero-window { position: relative; z-index: 1; background: #fff; border: 1px solid var(--stroke); border-radius: 18px; box-shadow: 0 30px 70px rgba(17,24,39,0.16); overflow: hidden; }
.hw-bar { height: 40px; background: #F9FAFB; border-bottom: 1px solid var(--stroke); display: flex; align-items: center; gap: 7px; padding: 0 14px; }
.hw-bar i { width: 11px; height: 11px; border-radius: 50%; background: #E5E7EB; }
.hw-bar i:nth-child(1) { background: #FCA5A5; } .hw-bar i:nth-child(2) { background: #FCD34D; } .hw-bar i:nth-child(3) { background: #86EFAC; }
.hw-body { display: flex; min-height: 300px; }
.hw-side { width: 64px; background: var(--green-soft); border-right: 1px solid var(--stroke); display: flex; flex-direction: column; align-items: center; gap: 13px; padding: 16px 0; }
.hw-side .s-dot { width: 30px; height: 30px; border-radius: 9px; background: #fff; box-shadow: var(--shadow-1); }
.hw-side .s-dot.on { background: var(--community-green); }
.hw-main { flex: 1; padding: 16px; }
.hw-post { border: 1px solid var(--stroke); border-radius: 12px; padding: 14px; box-shadow: var(--shadow-1); }
.hw-ph { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.hw-ph .a { width: 32px; height: 32px; border-radius: 50%; background: var(--community-green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.hw-ph .l1 { height: 9px; width: 110px; background: #E5E7EB; border-radius: 5px; }
.hw-ph .l2 { height: 7px; width: 70px; background: #EEF0F2; border-radius: 5px; margin-top: 5px; }
.hw-title { height: 11px; width: 78%; background: #D1D5DB; border-radius: 6px; margin-bottom: 10px; }
.hw-line { height: 8px; background: #EEF0F2; border-radius: 5px; margin-bottom: 7px; }
.hw-line.w1 { width: 96%; } .hw-line.w2 { width: 88%; } .hw-line.w3 { width: 58%; }
.hw-actions { display: flex; gap: 14px; margin-top: 13px; }
.hw-actions .p { height: 8px; width: 40px; background: #EEF0F2; border-radius: 5px; }
.hero-chip { position: absolute; z-index: 2; background: #fff; border: 1px solid var(--stroke); border-radius: 12px; box-shadow: 0 12px 30px rgba(17,24,39,0.12); padding: 9px 12px; display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; color: var(--text-hi); }
.hero-chip .ci { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; }
.hero-chip .ci svg { width: 15px; height: 15px; }
.hero-chip.c1 { top: -18px; left: -22px; } .hero-chip.c2 { bottom: -16px; right: -18px; } .hero-chip.c3 { top: 44%; right: -30px; }
@media (max-width: 960px) { .lp-hero-grid { grid-template-columns: 1fr; gap: 36px; } .lp-hero h1 { font-size: 42px; } .hero-chip.c1, .hero-chip.c3 { display: none; } }
@media (max-width: 520px) { .lp-hero h1 { font-size: 34px; } .lp-lead { font-size: 16px; } }

/* Stats strip */
.lp-strip { border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); background: #fff; }
.lp-strip .lp-container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 28px; padding: 26px 24px; }
.lp-stat { display: flex; align-items: center; gap: 12px; }
.lp-stat .st-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--green-soft); color: var(--community-green-dim); display: flex; align-items: center; justify-content: center; }
.lp-stat .st-ic svg { width: 21px; height: 21px; }
.lp-stat b { display: block; font-size: 20px; color: var(--text-hi); font-weight: 800; line-height: 1.05; }
.lp-stat span { font-size: 12.5px; color: var(--text-lo); }

/* Sections */
.lp-section { padding: 84px 0; }
.lp-eyebrow-c { display: block; text-align: center; color: var(--community-green-dim); font-weight: 700; font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }
.lp-h2 { font-family: var(--font-display); font-size: 38px; text-align: center; color: var(--text-hi); margin: 0 0 8px; letter-spacing: -0.02em; font-weight: 800; }
.lp-sub { text-align: center; color: var(--text-md); font-size: 16px; max-width: 540px; margin: 0 auto; }

/* Why cards */
.lp-why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin-top: 48px; }
.lp-why { background: #fff; border: 1px solid var(--stroke); border-radius: 20px; padding: 28px 24px; box-shadow: var(--shadow-card); transition: transform .25s var(--ease-out), box-shadow .25s; }
.lp-why:hover { transform: translateY(-5px); box-shadow: 0 20px 44px rgba(17,24,39,0.10); }
.lp-why .w-ic { width: 54px; height: 54px; border-radius: 15px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; color: #fff; }
.lp-why .w-ic svg { width: 26px; height: 26px; }
.lp-why h3 { font-size: 17px; margin-bottom: 7px; }
.lp-why p { font-size: 14px; color: var(--text-md); margin: 0; line-height: 1.55; }

/* Plans */
.lp-plans-wrap { background: var(--bg); }
.lp-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; max-width: 860px; margin: 48px auto 0; align-items: stretch; }
.lp-plan { background: #fff; border: 1.5px solid var(--stroke); border-radius: 24px; padding: 32px 28px; display: flex; flex-direction: column; position: relative; box-shadow: var(--shadow-card); }
.lp-plan.popular { border-color: var(--community-green); box-shadow: 0 24px 60px rgba(24,119,242,0.16); }
.lp-plan-tag { position: absolute; top: 28px; right: 28px; background: var(--community-green); color: #fff; font-size: 11px; font-weight: 800; padding: 6px 13px; border-radius: 999px; }
.lp-plan .p-name { font-weight: 700; color: var(--text-hi); font-size: 19px; margin-bottom: 14px; }
.lp-plan .p-price { font-family: var(--font-display); font-size: 44px; font-weight: 800; color: var(--text-hi); letter-spacing: -0.03em; }
.lp-plan .p-price small { font-size: 16px; font-weight: 600; color: var(--text-lo); }
.lp-plan .p-free-tag { display: inline-block; background: var(--green-soft); color: var(--community-green-dim); font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
.lp-plan .p-feats { list-style: none; padding: 0; margin: 24px 0 26px; display: flex; flex-direction: column; gap: 13px; flex: 1; }
.lp-plan .p-feats li { display: flex; gap: 10px; font-size: 14px; color: var(--text-md); align-items: flex-start; line-height: 1.45; }
.lp-plan .p-feats li svg { width: 18px; height: 18px; color: var(--community-green); flex-shrink: 0; margin-top: 1px; }
.lp-plan .p-feats li.head { font-weight: 700; color: var(--text-hi); }

/* Dark CTA */
.lp-cta { position: relative; overflow: hidden; background: linear-gradient(135deg, #0A2540, #1560C7 55%, #1877F2); border-radius: 28px; padding: 58px 40px; text-align: center; }
.lp-cta::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(620px 320px at 50% -20%, rgba(255,255,255,0.18), transparent 60%); }
.lp-cta h2 { position: relative; font-family: var(--font-display); font-size: 34px; color: #fff; margin: 0 0 10px; letter-spacing: -0.02em; }
.lp-cta p { position: relative; color: rgba(255,255,255,0.85); font-size: 16px; margin: 0 auto 26px; max-width: 520px; }
.lp-cta .btn { position: relative; background: #fff; color: var(--community-green-dim); border: none; box-shadow: 0 12px 30px rgba(0,0,0,0.25); }
.lp-cta .btn:hover { background: #f3f4f6; transform: translateY(-2px); }

/* Footer */
.lp-foot { background: #fff; border-top: 1px solid var(--stroke); padding: 56px 0 28px; margin-top: 84px; }
.lp-foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 36px; }
.lp-foot .fbrand { font-family: var(--font-display); font-weight: 800; font-size: 21px; color: var(--text-hi); margin-bottom: 12px; }
.lp-foot .fbrand .g { color: var(--community-green); }
.lp-foot .fdesc { font-size: 13.5px; color: var(--text-md); max-width: 290px; line-height: 1.6; }
.lp-foot h4 { font-size: 13px; color: var(--text-lo); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.06em; }
.lp-foot-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.lp-foot-links a { font-size: 13.5px; color: var(--text-md); text-decoration: none; }
.lp-foot-links a:hover { color: var(--community-green-dim); }
.lp-social { display: flex; flex-direction: column; gap: 12px; }
.lp-social a { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.lp-social .s-ic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.lp-social .s-ic svg { width: 18px; height: 18px; }
.lp-social .s-name { font-size: 13.5px; font-weight: 600; color: var(--text-hi); }
.lp-social .s-sub { font-size: 12px; color: var(--text-lo); margin-left: auto; }
.lp-copy { text-align: center; color: var(--text-lo); font-size: 13px; margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--stroke); }
@media (max-width: 900px) { .lp-h2 { font-size: 30px; } .lp-section { padding: 60px 0; } }

/* WhatsApp channel band */
.lp-whatsapp { max-width: 760px; margin: 0 auto; background: #fff; border: 1px solid var(--stroke); border-radius: 20px; box-shadow: var(--shadow-card); padding: 22px 26px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.lp-whatsapp .wa-ic { width: 50px; height: 50px; border-radius: 14px; background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lp-whatsapp .wa-ic svg { width: 28px; height: 28px; }
.lp-whatsapp .wa-txt h3 { margin: 0 0 2px; font-size: 17px; color: var(--text-hi); }
.lp-whatsapp .wa-txt p { margin: 0; font-size: 13.5px; color: var(--text-md); }
.lp-whatsapp .btn { margin-left: auto; }
@media (max-width: 560px) { .lp-whatsapp { flex-direction: column; text-align: center; } .lp-whatsapp .btn { margin-left: 0; } }

/* Simple footer */
.lp-foot { padding: 44px 0 28px; margin-top: 64px; }
.lp-foot-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; }
.lp-foot-inner .fdesc { max-width: 440px; font-size: 13.5px; color: var(--text-md); line-height: 1.6; margin: 0; }
.lp-legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.lp-legal-links a { font-size: 13.5px; color: var(--text-md); text-decoration: none; }
.lp-legal-links a:hover { color: var(--community-green-dim); }
.lp-foot-social { display: flex; gap: 12px; }
.lp-foot-social a { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; }
.lp-foot-social a svg { width: 18px; height: 18px; }

/* Legal pages */
.legal-body { color: var(--text-md); font-size: 15px; line-height: 1.7; }
.legal-body h3 { color: var(--text-hi); font-size: 17px; margin: 22px 0 8px; }
.legal-body p { margin: 0 0 14px; }
.legal-body ul { margin: 0 0 14px; padding-left: 20px; }
.legal-body li { margin-bottom: 8px; }
.legal-body a { color: var(--community-green-dim); font-weight: 600; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--stroke); transition: background var(--dur-fast) ease; }
.lesson-row:hover { background: var(--panel-2); }
.lesson-row:last-child { border-bottom: none; }
.lesson-row .idx { color: var(--text-lo); font-family: var(--font-mono); font-size: 12px; width: 20px; flex-shrink: 0; }
.lesson-row .title { flex: 1; min-width: 0; font-size: 14px; color: var(--text-hi); font-weight: 600; overflow-wrap: anywhere; }
.lesson-row svg { width: 16px; height: 16px; color: var(--text-lo); flex-shrink: 0; }
.lesson-row.locked .title { color: var(--text-lo); }
.wizard-steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.wizard-step { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-lo); padding: 6px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--stroke); transition: all var(--dur-fast) ease; }
.wizard-step.done { color: var(--community-green-dim); border-color: rgba(24,119,242,0.35); background: var(--green-soft); }
.wizard-step svg { width: 13px; height: 13px; }

/* ---- Leaderboard ---- */
.rank-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--stroke); transition: background var(--dur-fast) ease; }
.rank-row:hover { background: var(--panel-2); }
.rank-row:last-child { border-bottom: none; }
.rank-num { width: 24px; font-family: var(--font-mono); font-weight: 700; color: var(--text-lo); font-size: 13px; flex-shrink: 0; }
.rank-num.top3 { color: var(--gold); }
.rank-row .avatar { width: 34px; height: 34px; font-size: 13px; }
.rank-row .name { font-size: 14px; font-weight: 700; color: var(--text-hi); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .pts { margin-left: auto; font-family: var(--font-mono); font-size: 13px; color: var(--community-green-dim); font-weight: 700; flex-shrink: 0; }

/* Leaderboard hero + podium */
.lb-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.lb-podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; margin-bottom: 18px; }
.lb-pod { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 20px 10px 16px; text-align: center; position: relative; min-width: 0; }
.lb-pod.p1-raise { padding-top: 28px; border-color: rgba(234,179,8,0.4); }
.lb-pod .rankbadge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #fff; border: 2px solid var(--panel); }
.lb-pod.p1 .rankbadge { background: #EAB308; }
.lb-pod.p2 .rankbadge { background: #9CA3AF; }
.lb-pod.p3 .rankbadge { background: #B45309; }
.lb-pod .avatar { width: 54px; height: 54px; margin: 4px auto 8px; font-size: 18px; }
.lb-pod.p1-raise .avatar { width: 66px; height: 66px; font-size: 22px; }
.lb-pod .pname { font-weight: 700; color: var(--text-hi); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-pod .pscore { font-family: var(--font-mono); color: var(--community-green-dim); font-weight: 700; font-size: 13px; margin-top: 3px; }

/* ---- Section headers ---- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--community-green-dim); font-weight: 750; margin-bottom: 6px; }
.eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--community-green); }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-lo); }
.empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; color: var(--stroke-2); }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.flex { display: flex; flex-wrap: wrap; } .items-center { align-items: center; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.small { font-size: 12.5px; color: var(--text-lo); }

/* ---- Detail rows (admin member detail, etc.) ---- */
.detail-row { display: flex; flex-wrap: wrap; gap: 2px 16px; padding: 11px 0; border-bottom: 1px solid var(--stroke); font-size: 14px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .detail-label { color: var(--text-lo); width: 140px; flex-shrink: 0; }
.detail-row .detail-value { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text-hi); }
@media (max-width: 520px) {
  .detail-row { flex-direction: column; gap: 3px; padding: 12px 0; }
  .detail-row .detail-label { width: auto; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
}

/* ---- Profile header ---- */
.profile-header { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile-header h2 { font-size: 22px; margin: 0; }
.profile-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-stats { display: flex; gap: 28px; border-top: 1px solid var(--stroke); margin-top: 18px; padding-top: 16px; flex-wrap: wrap; }
.pstat .v { font-family: var(--font-mono); font-weight: 700; color: var(--text-hi); font-size: 19px; }
.pstat .l { font-size: 11px; color: var(--text-lo); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

/* ---- Avatar upload widget ---- */
.avatar-upload-wrap { position: relative; width: 88px; height: 88px; margin: 0 auto; }
.avatar-upload-wrap .avatar { width: 88px; height: 88px; min-width: 88px; min-height: 88px; font-size: 28px; cursor: pointer; }
.avatar-upload-btn { position: absolute; bottom: -2px; right: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--community-green); color: var(--on-green); display: flex; align-items: center; justify-content: center; border: 3px solid var(--panel); cursor: pointer; transition: transform var(--dur-fast) var(--ease-spring); }
.avatar-upload-btn:hover { transform: scale(1.1); }
.avatar-upload-btn svg { width: 14px; height: 14px; }

/* ---- Support tickets ---- */
.ticket-row { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-bottom: 1px solid var(--stroke); gap: 10px; flex-wrap: wrap; }
.ticket-row:last-child { border-bottom: none; }
.ticket-status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.status-OPEN { background: var(--gold-soft); color: var(--gold); }
.status-IN_PROGRESS { background: var(--info-tint); color: var(--info); }
.status-RESOLVED { background: var(--green-soft); color: var(--community-green-dim); }
.status-NEW { background: var(--gold-soft); color: var(--gold); }
.status-REVIEWING { background: var(--info-tint); color: var(--info); }
.status-PLANNED { background: var(--green-soft); color: var(--community-green-dim); }
.status-IMPLEMENTED { background: var(--green-soft); color: var(--community-green-dim); }
.status-DECLINED { background: var(--danger-tint); color: var(--danger); }

/* ---- Chat bubbles ---- */
.chat-thread { display: flex; flex-direction: column; gap: 10px; padding: 6px 2px 16px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.bubble-mine { align-self: flex-end; background: var(--community-green); color: var(--on-green); border-bottom-right-radius: 4px; }
.bubble-theirs { align-self: flex-start; background: var(--panel-2); color: var(--text-hi); border: 1px solid var(--stroke); border-bottom-left-radius: 4px; }
.bubble-time { font-size: 10.5px; opacity: 0.7; margin-top: 3px; }
.conversation-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--stroke); transition: background var(--dur-fast) ease; }
.conversation-row:hover { background: var(--panel-2); }
.conversation-row:last-child { border-bottom: none; }
.conversation-row .preview { font-size: 13px; color: var(--text-lo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---- Groups ---- */
.group-card { display: flex; align-items: center; gap: 14px; }
.group-icon { width: 46px; height: 46px; min-width: 46px; border-radius: var(--r-sm); background: var(--green-soft); color: var(--community-green-dim); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.group-icon svg { width: 22px; height: 22px; }

/* ---- Suggestions ---- */
.suggestion-card { border-left: 3px solid var(--community-green); }

/* ---- Plan cards ---- */
.plan-badge-best { background: var(--community-green); color: var(--on-green); font-size: 10.5px; padding: 2px 8px; border-radius: 999px; margin-left: 6px; white-space: nowrap; }

/* Pricing */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-bottom: 26px; align-items: stretch; }
.plan-card { position: relative; background: var(--panel); border: 1.5px solid var(--stroke); border-radius: var(--r-xl); padding: 26px 22px; display: flex; flex-direction: column; box-shadow: var(--shadow-card); }
.plan-card.popular { border-color: var(--community-green); box-shadow: 0 14px 44px rgba(24,119,242,0.14); }
.plan-tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--community-green); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .02em; padding: 4px 14px; border-radius: 999px; white-space: nowrap; }
.plan-tag.gold { background: var(--gold); }
.plan-name { font-weight: 700; color: var(--text-hi); font-size: 15px; }
.plan-price { font-family: var(--font-display); font-size: 34px; font-weight: 800; color: var(--text-hi); letter-spacing: -0.02em; margin-top: 8px; line-height: 1.1; }
.plan-price small { font-size: 15px; font-weight: 600; color: var(--text-lo); }
.plan-per { font-size: 13px; color: var(--text-md); margin-top: 4px; }
.plan-save { display: inline-block; margin-top: 10px; background: var(--gold-soft); color: #B45309; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.plan-feats { list-style: none; padding: 0; margin: 18px 0 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.plan-feats li { display: flex; gap: 9px; font-size: 13.5px; color: var(--text-md); align-items: flex-start; }
.plan-feats li svg { width: 17px; height: 17px; color: var(--community-green); flex-shrink: 0; margin-top: 1px; }
.plan-cta { margin-top: auto; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.compare-col h3 { display: flex; align-items: center; gap: 8px; }
.compare-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 10px; }
.compare-list li { display: flex; gap: 9px; font-size: 13.5px; color: var(--text-md); align-items: flex-start; }
.compare-list li svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.compare-list.free li svg { color: var(--text-lo); }
.compare-list.paid li svg { color: var(--community-green); }

/* ---- Tables (admin) — contained scroll, never breaks page layout ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-md); border: 1px solid var(--stroke); }
table { border-collapse: collapse; width: 100%; min-width: 640px; }
td, th { overflow-wrap: normal; word-break: normal; padding: 12px 14px; text-align: left; white-space: nowrap; }
td { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
th { color: var(--text-lo); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--stroke); background: var(--panel-2); }
td { border-bottom: 1px solid var(--stroke); font-size: 14px; }
tbody tr { transition: background var(--dur-fast) ease; }
tbody tr:hover { background: var(--panel-2); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   AIBA — public marketing site (aiba.bankpediaa.net)
   Reuses the shared design tokens above. Prefixed .aiba-*.
   ============================================================ */
body.aiba { background: var(--bg); color: var(--text-md); font-family: var(--font-body); }
.aiba-main { display: block; }
.aiba-wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.aiba-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ---- Nav ---- */
.aiba-nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.9); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--stroke); }
.aiba-nav-inner { max-width: 1080px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.aiba-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.aiba-brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--community-green); color: #fff; display: grid; place-items: center; font-size: 20px; box-shadow: var(--shadow-1); }
.aiba-brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.aiba-brand-txt strong { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--text-hi); letter-spacing: -0.01em; }
.aiba-brand-txt small { font-size: 10.5px; color: var(--text-lo); font-weight: 500; }
.aiba-nav-links { display: flex; align-items: center; gap: 4px; }
.aiba-nav-links > a:not(.btn) { padding: 8px 14px; border-radius: var(--r-sm); font-size: 14.5px; font-weight: 600; color: var(--text-md); text-decoration: none; transition: background var(--dur-fast) ease, color var(--dur-fast) ease; }
.aiba-nav-links > a:not(.btn):hover { background: var(--panel-2); color: var(--text-hi); }
.aiba-nav-links > a:not(.btn).active { color: var(--community-green); }
.aiba-nav-cta { margin-left: 8px; color: var(--on-green); }
.aiba-nav-toggle { display: none; background: none; border: 0; font-size: 24px; color: var(--text-hi); cursor: pointer; padding: 6px; }

/* ---- Hero ---- */
.aiba-hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--green-soft) 0%, var(--bg) 100%); border-bottom: 1px solid var(--stroke); }
.aiba-hero-inner { max-width: 900px; margin: 0 auto; padding: 72px 20px 64px; text-align: center; }
.aiba-eyebrow { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: var(--r-pill); background: #fff; border: 1px solid var(--stroke); font-size: 12.5px; font-weight: 600; color: var(--community-green-dim); margin-bottom: 22px; box-shadow: var(--shadow-1); }
.aiba-hero h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 6vw, 52px); line-height: 1.08; letter-spacing: -0.02em; color: var(--text-hi); margin: 0 0 18px; }
.aiba-hero h1 .g { color: var(--community-green); }
.aiba-hero p.lead { font-size: clamp(15px, 2.4vw, 19px); line-height: 1.6; color: var(--text-md); max-width: 640px; margin: 0 auto 30px; }
.aiba-hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.aiba-hero-note { margin-top: 26px; font-size: 12.5px; color: var(--text-lo); }

/* ---- Generic section ---- */
.aiba-section { padding: 60px 0; }
.aiba-section.alt { background: var(--panel-2); border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); }
.aiba-section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.aiba-section-head h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(24px, 4vw, 34px); letter-spacing: -0.02em; color: var(--text-hi); margin: 0 0 12px; }
.aiba-section-head p { font-size: 15.5px; line-height: 1.6; color: var(--text-md); margin: 0; }

/* ---- Feature/step cards ---- */
.aiba-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.aiba-card { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--r-lg); padding: 26px 22px; box-shadow: var(--shadow-1); transition: box-shadow var(--dur-med) ease, transform var(--dur-med) ease; }
.aiba-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.aiba-card .ic-badge { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--community-green-tint); color: var(--community-green); margin-bottom: 16px; }
.aiba-card h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--text-hi); margin: 0 0 8px; }
.aiba-card p { font-size: 14px; line-height: 1.6; color: var(--text-md); margin: 0; }
.aiba-card .step-no { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--community-green); }

/* ---- Content prose (Objective / Vision / Privacy) ---- */
.aiba-prose { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--r-lg); padding: 34px 32px; box-shadow: var(--shadow-1); }
.aiba-prose h2 { font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--text-hi); margin: 0 0 8px; }
.aiba-prose h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--text-hi); margin: 26px 0 8px; }
.aiba-prose p, .aiba-prose li { font-size: 15px; line-height: 1.72; color: var(--text-md); }
.aiba-prose ul { padding-left: 20px; }
.aiba-page-head { text-align: center; padding: 48px 20px 8px; }
.aiba-page-head h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(26px, 5vw, 40px); letter-spacing: -0.02em; color: var(--text-hi); margin: 0 0 10px; }
.aiba-page-head p { color: var(--text-md); font-size: 15.5px; max-width: 620px; margin: 0 auto; }

/* Placeholder block (founder fills later) */
.aiba-placeholder { border: 1.5px dashed var(--stroke-2); border-radius: var(--r-md); background: repeating-linear-gradient(45deg, var(--panel-2), var(--panel-2) 10px, transparent 10px, transparent 20px); padding: 28px; text-align: center; color: var(--text-lo); font-size: 14px; }
.aiba-placeholder strong { display: block; color: var(--text-md); font-size: 15px; margin-bottom: 6px; }

/* ---- Forms ---- */
.aiba-form-card { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--r-lg); padding: 30px 28px; box-shadow: var(--shadow-2); }
.aiba-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.aiba-form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-hi); margin-bottom: 6px; }
.field .req { color: var(--danger); }
.field input, .field select, .field textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--stroke-2); border-radius: var(--r-sm); font-family: var(--font-body); font-size: 14.5px; color: var(--text-hi); background: var(--bg-soft); transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--community-green); box-shadow: var(--shadow-glow); }
.field .hint { font-size: 12px; color: var(--text-lo); margin-top: 5px; }
.consent-row { display: flex; gap: 12px; align-items: flex-start; padding: 16px; background: var(--green-soft); border: 1px solid var(--community-green-tint); border-radius: var(--r-md); }
.consent-row input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--community-green); }
.consent-row label { font-size: 13px; line-height: 1.55; color: var(--text-md); font-weight: 500; }

/* Upload dropzone */
.aiba-drop { border: 1.5px dashed var(--stroke-2); border-radius: var(--r-md); padding: 30px; text-align: center; cursor: pointer; transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease; background: var(--bg-soft); }
.aiba-drop:hover { border-color: var(--community-green); background: var(--green-soft); }
.aiba-drop .up-ic { font-size: 34px; color: var(--community-green); }
.aiba-drop strong { display: block; color: var(--text-hi); margin: 10px 0 4px; }
.aiba-drop span { font-size: 12.5px; color: var(--text-lo); }
.aiba-drop input[type=file] { display: none; }
.aiba-file-name { margin-top: 12px; font-size: 13px; color: var(--community-green-dim); font-weight: 600; }

/* Confirmation screen */
.aiba-confirm { text-align: center; max-width: 560px; margin: 0 auto; }
.aiba-confirm .tick { width: 76px; height: 76px; border-radius: 50%; background: var(--community-green-tint); color: var(--community-green); display: grid; place-items: center; font-size: 40px; margin: 0 auto 20px; }
.aiba-refid { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--community-green-dim); background: var(--green-soft); border: 1px dashed var(--community-green); border-radius: var(--r-md); padding: 14px 20px; display: inline-block; margin: 6px 0 20px; letter-spacing: 0.02em; }
.aiba-fee-note { background: var(--gold-soft); border: 1px solid var(--gold-tint); border-radius: var(--r-md); padding: 16px 18px; font-size: 14px; line-height: 1.6; color: var(--text-md); }

/* Legal/trust callout */
.aiba-callout { display: flex; gap: 12px; align-items: flex-start; background: var(--info-tint); border: 1px solid rgba(59,130,246,0.2); border-radius: var(--r-md); padding: 16px 18px; font-size: 13.5px; line-height: 1.6; color: var(--text-md); }
.aiba-callout .ic { color: var(--info); font-size: 20px; flex-shrink: 0; }

/* Steps progress */
.aiba-steps { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 auto 30px; max-width: 460px; }
.aiba-steps .st { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-lo); }
.aiba-steps .st .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--text-lo); font-family: var(--font-mono); font-size: 12px; border: 1px solid var(--stroke-2); }
.aiba-steps .st.active .dot { background: var(--community-green); color: #fff; border-color: var(--community-green); }
.aiba-steps .st.active { color: var(--text-hi); }
.aiba-steps .bar { flex: 1; height: 2px; background: var(--stroke-2); max-width: 40px; }

/* Test/demo watermark for receipts */
.aiba-demo-badge { display: inline-block; background: var(--danger-tint); color: var(--danger); border: 1px solid var(--danger); border-radius: var(--r-xs); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 10px; }

/* ---- Footer ---- */
.aiba-foot { background: var(--text-hi); color: rgba(255,255,255,0.72); padding: 48px 0 0; }
.aiba-foot-inner { max-width: 1080px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; }
.aiba-foot .aiba-brand-txt strong { color: #fff; }
.aiba-foot .aiba-brand-txt small { color: rgba(255,255,255,0.55); }
.aiba-foot-note { margin: 14px 0 10px; font-size: 13.5px; color: rgba(255,255,255,0.7); }
.aiba-foot-disclaimer { font-size: 12px; line-height: 1.6; color: rgba(255,255,255,0.5); }
.aiba-foot-col h4 { font-family: var(--font-display); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.5); margin: 0 0 14px; }
.aiba-foot-col a { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.75); text-decoration: none; font-size: 14px; padding: 5px 0; transition: color var(--dur-fast) ease; }
.aiba-foot-col a:hover { color: #fff; }
.aiba-foot-base { max-width: 1080px; margin: 36px auto 0; padding: 18px 20px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: rgba(255,255,255,0.5); }
.aiba-foot-base a { color: rgba(255,255,255,0.8); }

/* ---- Floating contact buttons ---- */
.aiba-float { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 12px; }
.aiba-float-btn { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 26px; box-shadow: var(--shadow-3); text-decoration: none; transition: transform var(--dur-fast) ease; }
.aiba-float-btn:hover { transform: scale(1.06); }
.aiba-float-btn.wa { background: #25D366; }
.aiba-float-btn.call { background: var(--community-green); }

/* ---- Responsive ---- */
@media (max-width: 760px) {
  .aiba-nav-toggle { display: block; }
  .aiba-nav-links { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: #fff; border-bottom: 1px solid var(--stroke); padding: 10px 16px 16px; gap: 2px; box-shadow: var(--shadow-2); display: none; }
  .aiba-nav-links.open { display: flex; }
  .aiba-nav-cta { margin: 8px 0 0; text-align: center; }
  .aiba-form-grid { grid-template-columns: 1fr; }
  .aiba-foot-inner { grid-template-columns: 1fr; gap: 26px; }
}
