/* =========================================================
   The Sales Adda — App styles
   ========================================================= */
:root {
  --p: #6d28d9;          /* primary purple */
  --p-600: #5b21b6;
  --p-50: #f3efff;
  --p-100: #e7defe;
  --ink: #111322;
  --text: #374151;
  --muted: #8a90a2;
  --line: #eceef4;
  --bg: #f7f7fb;
  --white: #fff;
  --green: #16a34a;
  --red: #ef4444;
  --orange: #f59e0b;
  --blue: #3b82f6;
  --pink: #ec4899;
  --teal: #0d9488;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #0b0d16; color: var(--text); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; letter-spacing: -0.01em; }
[data-lucide], svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex: none; }

/* ---------- Device frame (desktop) ---------- */
.stage { height: 100%; display: flex; align-items: center; justify-content: center; gap: 60px; padding: 20px;
  background: radial-gradient(circle at 70% 30%, rgba(109, 40, 217, .35), transparent 50%), radial-gradient(circle at 20% 80%, rgba(23, 87, 255, .25), transparent 50%), #05060c; }
.stage-info { color: #c9cfdc; max-width: 340px; }
.stage-info h1 { color: #fff; font-size: 36px; font-weight: 800; letter-spacing: -0.03em; margin: 18px 0 12px; }
.stage-info p { color: #aab2c3; margin-bottom: 22px; font-size: 15px; }
.stage-info a { display: inline-flex; gap: 8px; align-items: center; color: #fff; border: 1px solid rgba(255,255,255,.3); padding: 10px 18px; border-radius: 10px; font-weight: 600; }
.stage-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; line-height: 1.02; }
.stage-logo svg { width: 46px; height: 46px; }
.device {
  width: 400px; height: min(860px, calc(100vh - 40px)); border-radius: 48px; padding: 12px;
  background: linear-gradient(145deg, #3a3d45, #121318 40%, #2a2c33);
  box-shadow: 0 0 0 1.5px #55585f inset, 0 40px 100px rgba(0,0,0,.6); position: relative; flex: none;
}
.app {
  width: 100%; height: 100%; border-radius: 38px; overflow: hidden; background: var(--bg);
  position: relative; display: flex; flex-direction: column; isolation: isolate;
}
@media (max-width: 900px) {
  .stage-info { display: none; }
}
@media (max-width: 500px) {
  body { background: var(--bg); }
  .stage { padding: 0; background: var(--bg); display: block; }
  .device { width: 100%; height: 100%; border-radius: 0; padding: 0; box-shadow: none; background: none; }
  .app { border-radius: 0; }
}

/* ---------- Screens ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); animation: screenIn .22s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.screen.tab-screen { animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.status { height: 40px; flex: none; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 26px 4px; font-size: 13px; font-weight: 600; color: var(--ink); }
.status .sig { display: flex; gap: 5px; align-items: center; }
.status .sig svg { width: 15px; height: 15px; }
.dark .status { color: #fff; }
@media (max-width: 500px) { .status { display: none; } }

.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 18px 12px; flex: none; min-height: 52px; }
.topbar h1 { font-size: 21px; font-weight: 700; flex: 1; }
.topbar h1.center { text-align: center; font-size: 17px; }
.topbar .sub { font-size: 12.5px; color: var(--muted); font-weight: 400; display: block; letter-spacing: 0; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--ink); position: relative; flex: none; }
.icon-btn:active { background: rgba(0,0,0,.05); }
.icon-btn .badge-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }
.dark .icon-btn { color: #fff; }
.content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 18px 24px; scrollbar-width: none; }
.content::-webkit-scrollbar { display: none; }

/* ---------- Bottom tab bar ---------- */
.tabbar { flex: none; display: flex; justify-content: space-around; background: #fff; border-top: 1px solid var(--line); padding: 8px 6px calc(10px + var(--safe-b)); position: relative; z-index: 5; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--muted); font-weight: 500; padding: 2px 8px; min-width: 56px; }
.tabbar a svg { width: 21px; height: 21px; }
.tabbar a.on { color: var(--p); font-weight: 600; }

/* ---------- Common UI ---------- */
.card { background: #fff; border-radius: var(--radius); padding: 14px; border: 1px solid var(--line); }
.section-h { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 10px; }
.section-h h3 { font-size: 15px; font-weight: 700; }
.section-h a, .link { color: var(--p); font-size: 12.5px; font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 12px; font-weight: 600; font-size: 14.5px; transition: transform .1s, background .15s; }
.btn:active { transform: scale(.98); }
.btn-p { background: var(--p); color: #fff; box-shadow: 0 8px 20px rgba(109,40,217,.28); }
.btn-p:hover { background: var(--p-600); }
.btn-soft { background: var(--p-50); color: var(--p); }
.btn-line { border: 1.5px solid var(--line); background: #fff; color: var(--ink); }
.btn-danger { color: var(--red); background: #fef2f2; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.pill { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 7px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; white-space: nowrap; color: var(--text); }
.chip.on { background: var(--p); color: #fff; border-color: var(--p); }
.seg { display: flex; gap: 6px; background: transparent; margin-bottom: 14px; }
.seg button { flex: 1; padding: 8px 6px; border-radius: 20px; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--p-50); color: var(--p); font-weight: 600; border: 1px solid var(--p-100); }
.search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; margin-bottom: 14px; }
.search svg { color: var(--muted); width: 17px; height: 17px; }
.search input { flex: 1; border: 0; outline: none; padding: 12px 0; background: transparent; font-size: 14px; min-width: 0; }
.list { display: grid; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; width: 100%; text-align: left; }
.row:active { background: #fafaff; }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev { color: #c3c7d3; width: 18px; height: 18px; }
.sq { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none; }
.sq svg { width: 20px; height: 20px; }
.sq.soft { background: var(--p-50); color: var(--p); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex: none; background: linear-gradient(135deg, #8b5cf6, #5b21b6); }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; }
.bar { height: 6px; background: #ebe9f3; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--p); border-radius: 6px; transition: width .4s; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: #c9cbe0; margin: 0 auto 10px; display: block; }
.fab { position: absolute; right: 18px; bottom: 86px; width: 54px; height: 54px; border-radius: 18px; background: var(--p); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(109,40,217,.4); z-index: 6; }
.fab svg { width: 24px; height: 24px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field label em { color: var(--red); font-style: normal; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 12px 13px; font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--p); box-shadow: 0 0 0 3px rgba(109,40,217,.12); }
.field textarea { min-height: 84px; resize: vertical; }
.field .phone-in { display: flex; gap: 8px; }
.field .phone-in span { border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 12px; font-size: 14px; }
.field.invalid input, .field.invalid select { border-color: var(--red); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sticky-foot { flex: none; padding: 12px 18px calc(14px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line); }

/* ---------- Splash & Onboarding ---------- */
.splash { background: #000; color: #fff; align-items: center; justify-content: center; text-align: center; }
.splash svg.logo-big { width: 92px; height: 92px; margin-bottom: 16px; }
.splash h1 { color: #fff; font-size: 32px; font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; }
.splash p { color: #aab2c3; margin-top: 14px; font-size: 14px; }
.splash .loader { width: 46px; height: 4px; border-radius: 4px; background: #24242c; margin-top: 50px; overflow: hidden; }
.splash .loader i { display: block; height: 100%; width: 40%; background: var(--p); border-radius: 4px; animation: load 1s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.onb { background: #fff; }
.onb .skip { position: absolute; top: 48px; right: 22px; color: var(--muted); font-size: 13.5px; font-weight: 500; z-index: 2; }
.onb-slides { flex: 1; display: flex; overflow: hidden; }
.onb-slide { min-width: 100%; padding: 70px 28px 10px; display: flex; flex-direction: column; transition: transform .35s ease; }
.onb-slide h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.onb-slide p { color: var(--muted); margin-top: 10px; font-size: 14.5px; }
.onb-art { flex: 1; display: grid; place-items: center; }
.onb-art .circle { width: 230px; height: 230px; border-radius: 50%; background: var(--p-50); display: grid; place-items: center; position: relative; }
.onb-art .circle > svg { width: 96px; height: 96px; color: var(--p); stroke-width: 1.4; }
.onb-art .floater { position: absolute; background: #fff; border-radius: 12px; padding: 8px 12px; box-shadow: 0 10px 24px rgba(17,19,34,.1); font-size: 12px; font-weight: 600; color: var(--ink); display: flex; gap: 6px; align-items: center; animation: bob 4s ease-in-out infinite; }
.onb-art .floater svg { width: 15px; height: 15px; color: var(--p); }
@keyframes bob { 50% { transform: translateY(-6px); } }
.onb-foot { padding: 0 28px 34px; }
.onb-dots { display: flex; gap: 6px; justify-content: center; margin: 22px 0 0; }
.onb-dots i { width: 7px; height: 7px; border-radius: 4px; background: #dcdcea; transition: all .25s; }
.onb-dots i.on { width: 22px; background: var(--p); }
.onb-foot .alt { text-align: center; margin-top: 14px; color: var(--muted); font-size: 13.5px; }
.onb-foot .alt b { color: var(--p); }
.plan-pick { display: grid; gap: 10px; }
.plan-pick label { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.plan-pick input { accent-color: var(--p); width: 18px; height: 18px; }
.plan-pick label:has(input:checked) { border-color: var(--p); background: var(--p-50); }
.plan-pick b { color: var(--ink); display: block; font-size: 14px; }
.plan-pick small { color: var(--muted); font-size: 12px; }
.plan-pick .price { margin-left: auto; font-weight: 700; color: var(--ink); }

/* ---------- Home ---------- */
.hello { display: flex; align-items: center; gap: 10px; padding: 10px 18px 6px; flex: none; }
.hello .t { flex: 1; }
.hello small { color: var(--muted); font-size: 13px; display: block; }
.hello h1 { font-size: 21px; font-weight: 700; }
.goals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.goal { border-radius: 14px; padding: 12px 8px; text-align: center; position: relative; }
.goal b { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; }
.goal small { font-size: 12px; font-weight: 500; color: var(--text); }
.goal .plus { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 7px; background: rgba(255,255,255,.8); display: grid; place-items: center; }
.goal .plus svg { width: 13px; height: 13px; }
.goal .of { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.g-green { background: #e8f8ee; } .g-green b { color: var(--green); }
.g-orange { background: #fff4e3; } .g-orange b { color: #e07b00; }
.g-purple { background: var(--p-50); } .g-purple b { color: var(--p); }
.continue { display: flex; align-items: center; gap: 12px; }
.continue .thumb { width: 52px; height: 52px; border-radius: 12px; background: linear-gradient(135deg, #8b5cf6, #5b21b6); display: grid; place-items: center; color: #fff; flex: none; }
.continue .thumb svg { width: 24px; height: 24px; }
.continue .t { flex: 1; min-width: 0; }
.continue b { color: var(--ink); font-size: 14px; display: block; }
.continue small { color: var(--muted); font-size: 12px; }
.play { width: 40px; height: 40px; border-radius: 50%; background: var(--p); color: #fff; display: grid; place-items: center; flex: none; }
.play svg { width: 16px; height: 16px; fill: #fff; }
.challenge-card { background: linear-gradient(135deg, #f3efff, #fff); }
.challenge-card p { font-size: 13.5px; color: var(--ink); margin: 4px 0 12px; }
.live { display: flex; gap: 12px; align-items: center; }
.live .t { flex: 1; min-width: 0; }
.live b { color: var(--ink); display: block; font-size: 14px; }
.live small { color: var(--muted); font-size: 12px; display: block; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--ink); text-align: center; }
.quick .sq { width: 48px; height: 48px; border-radius: 15px; }

/* ---------- Learn / Course ---------- */
.course-hero { background: linear-gradient(160deg, #7c3aed, #5b21b6); color: #fff; padding: 0 18px 22px; flex: none; position: relative; overflow: hidden; }
.course-hero::after { content: ""; position: absolute; right: -40px; top: -20px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); }
.course-hero .topbar { padding: 6px 0 0; }
.course-hero .topbar .icon-btn { color: #fff; }
.course-hero .art { display: grid; place-items: center; padding: 14px 0 10px; }
.course-hero .art .play-big { width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--p); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.course-hero .art .play-big svg { width: 26px; height: 26px; fill: var(--p); }
.course-hero h2 { color: #fff; font-size: 21px; position: relative; z-index: 1; }
.course-hero .meta { font-size: 12.5px; opacity: .85; margin: 4px 0 12px; position: relative; z-index: 1; }
.course-hero .bar { background: rgba(255,255,255,.25); }
.course-hero .bar i { background: #fff; }
.lesson { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.lesson .num { width: 34px; height: 34px; border-radius: 10px; background: var(--p-50); color: var(--p); display: grid; place-items: center; flex: none; }
.lesson .t { flex: 1; }
.lesson b { color: var(--ink); font-weight: 600; font-size: 14px; display: block; }
.lesson small { color: var(--muted); font-size: 12px; }
.lesson.done .state { color: var(--green); }
.lesson.current { background: var(--p-50); border-radius: 12px; border-bottom-color: transparent; padding-left: 10px; padding-right: 10px; }
.lesson.locked { opacity: .55; }
.course-tools { display: flex; justify-content: space-around; border-top: 1px solid var(--line); background: #fff; padding: 10px 6px calc(12px + var(--safe-b)); flex: none; }
.course-tools button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--p); font-weight: 500; }
.course-tools button svg { width: 20px; height: 20px; }

/* ---------- Clients / CRM ---------- */
.add-client { width: 100%; margin-bottom: 14px; }
.client-head { text-align: center; padding: 6px 0 16px; }
.client-head .sq { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 10px; }
.client-head .sq svg { width: 30px; height: 30px; }
.client-head h2 { font-size: 20px; }
.stage-select { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 600; position: relative; }
.stage-select select { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.contact-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.contact-actions a, .contact-actions button { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--ink); }
.contact-actions .ci { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; }
.kv { display: grid; gap: 12px; }
.kv div { display: flex; gap: 12px; align-items: center; font-size: 13.5px; color: var(--ink); }
.kv svg { color: var(--muted); width: 17px; height: 17px; }
.timeline { display: grid; gap: 10px; }
.timeline div { display: flex; gap: 12px; font-size: 13px; }
.timeline time { color: var(--muted); width: 56px; flex: none; font-size: 12px; }
.doc { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink); }
.doc:last-child { border-bottom: 0; }
.doc svg:first-child { color: var(--red); }
.doc span { flex: 1; }
.stage-row { display: flex; align-items: center; justify-content: space-between; border-radius: 14px; padding: 14px 16px; width: 100%; text-align: left; border: 1px solid transparent; }
.stage-row b { display: block; color: var(--ink); font-size: 14.5px; }
.stage-row small { color: var(--text); font-size: 12.5px; }
.stage-row .amt { font-size: 12px; font-weight: 600; margin-right: 8px; }
.stage-row .end { display: flex; align-items: center; }

/* ---------- Calendar ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; margin-bottom: 14px; }
.week button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; border-radius: 14px; font-size: 11.5px; color: var(--muted); position: relative; }
.week button b { font-size: 15px; color: var(--ink); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.week button.on b { background: var(--p); color: #fff; }
.week button.has::after { content: ""; position: absolute; bottom: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--p); }
.day-h { font-size: 13.5px; font-weight: 700; color: var(--ink); margin: 16px 0 10px; }
.event { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; width: 100%; text-align: left; }
.event time { font-size: 12px; color: var(--muted); width: 62px; flex: none; padding-top: 2px; }
.event .t { flex: 1; min-width: 0; }
.event b { color: var(--ink); font-size: 14px; display: block; }
.event small { color: var(--muted); font-size: 12px; display: block; }
.event .ci { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }

/* ---------- Dashboard ---------- */
.dash-hero { background: linear-gradient(160deg, #2e1065, #4c1d95 60%, #5b21b6); color: #fff; padding-bottom: 18px; flex: none; }
.dash-hero .topbar h1 { color: #fff; }
.dash-hero select { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 10px; padding: 7px 10px; font-size: 12.5px; outline: none; }
.dash-hero select option { color: var(--ink); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 18px; }
.kpi { background: #fff; color: var(--ink); border-radius: 14px; padding: 12px; }
.kpi small { color: var(--muted); font-size: 12px; display: block; }
.kpi b { font-size: 21px; font-weight: 800; display: block; letter-spacing: -0.02em; }
.kpi .up { color: var(--green); font-size: 11.5px; font-weight: 600; }
.mini-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.mini-kpis .card small { color: var(--muted); font-size: 12px; display: block; }
.mini-kpis .card b { font-size: 19px; color: var(--ink); }
.chart { width: 100%; height: 150px; display: block; }
.chart .grid line { stroke: #eef0f5; }
.chart text { font-size: 10px; fill: var(--muted); }
.top-client { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink); }
.top-client:last-child { border-bottom: 0; }
.top-client b { font-weight: 600; }

/* ---------- Community ---------- */
.composer { display: flex; gap: 10px; align-items: center; }
.composer button { flex: 1; text-align: left; background: var(--bg); border-radius: 20px; padding: 10px 14px; color: var(--muted); font-size: 13.5px; }
.post { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.post-h { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.post-h .t { flex: 1; }
.post-h b { display: block; color: var(--ink); font-size: 14px; line-height: 1.2; }
.post-h small { color: var(--muted); font-size: 12px; }
.post p { color: var(--ink); font-size: 14px; white-space: pre-wrap; }
.post .tag { margin-top: 8px; }
.post-img { margin-top: 10px; border-radius: 12px; height: 150px; background: linear-gradient(135deg, #ddd6fe, #c4b5fd 50%, #a78bfa); display: grid; place-items: center; color: #fff; }
.post-img svg { width: 56px; height: 56px; stroke-width: 1.4; }
.post-acts { display: flex; gap: 18px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.post-acts button { display: inline-flex; gap: 6px; align-items: center; }
.post-acts button.on { color: var(--red); }
.post-acts button.on svg { fill: var(--red); }
.post-acts .sp { margin-left: auto; }
.comments { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.comment { display: flex; gap: 8px; font-size: 13px; }
.comment div { background: var(--bg); border-radius: 12px; padding: 7px 10px; flex: 1; }
.comment b { color: var(--ink); font-size: 12.5px; display: block; }
.comment-in { display: flex; gap: 8px; }
.comment-in input { flex: 1; border: 1px solid var(--line); border-radius: 20px; padding: 8px 12px; outline: none; font-size: 13px; min-width: 0; }

/* ---------- AI Coach ---------- */
.coach { background: linear-gradient(180deg, #1e1b4b 0%, #110f2e 50%, #0b0a1f 100%); color: #fff; }
.coach .topbar h1 { color: #fff; font-size: 17px; display: flex; gap: 8px; align-items: center; }
.coach .topbar h1 svg { color: #c4b5fd; }
.coach .content { padding-bottom: 10px; }
.coach-hi { font-size: 22px; font-weight: 700; color: #fff; margin: 10px 0 18px; line-height: 1.3; }
.prompts { display: grid; gap: 10px; }
.prompts button { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 13px 14px; text-align: left; color: #eceaff; font-size: 13.5px; }
.prompts button:hover { background: rgba(255,255,255,.11); }
.prompts button svg:first-child { color: #c4b5fd; }
.prompts button span { flex: 1; }
.prompts button svg:last-child { opacity: .5; width: 16px; height: 16px; }
.msgs { display: grid; gap: 12px; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }
.msg.me { justify-self: end; background: var(--p); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { justify-self: start; background: rgba(255,255,255,.09); color: #eceaff; border-bottom-left-radius: 4px; }
.msg.ai .copy { display: inline-flex; gap: 5px; align-items: center; margin-top: 8px; font-size: 12px; color: #c4b5fd; }
.msg.ai .copy svg { width: 14px; height: 14px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #c4b5fd; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.ask { flex: none; display: flex; gap: 8px; align-items: center; padding: 10px 14px calc(14px + var(--safe-b)); }
.ask input { flex: 1; min-width: 0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 24px; padding: 12px 16px; color: #fff; outline: none; font-size: 14px; }
.ask input::placeholder { color: #a5a3c7; }
.ask button { width: 44px; height: 44px; border-radius: 50%; background: var(--p); color: #fff; display: grid; place-items: center; flex: none; }

/* ---------- Challenges / Events / Certificates ---------- */
.ch { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.ch-h { display: flex; gap: 12px; align-items: flex-start; }
.ch-h .t { flex: 1; }
.ch-h b { display: block; color: var(--ink); font-size: 14.5px; }
.ch-h small { color: var(--muted); font-size: 12.5px; }
.ch .trophy { font-size: 24px; line-height: 1; }
.ch-p { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: 12px; color: var(--muted); }
.ch-p .bar { flex: 1; }
.ch-p .bar i { background: var(--orange); }
.ch-acts { display: flex; gap: 8px; margin-top: 12px; }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge-grid div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 8px; text-align: center; font-size: 12px; color: var(--ink); font-weight: 600; }
.badge-grid div span { font-size: 30px; display: block; margin-bottom: 4px; }
.badge-grid div.locked { opacity: .4; filter: grayscale(1); }
.ev { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; gap: 12px; }
.ev .t { flex: 1; }
.ev b { display: block; color: var(--ink); font-size: 14.5px; line-height: 1.3; }
.ev small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.ev .when { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text); margin: 8px 0 10px; }
.ev .when svg { width: 14px; height: 14px; color: var(--muted); }
.ev .ic { width: 42px; height: 42px; border-radius: 50%; background: var(--p); color: #fff; display: grid; place-items: center; flex: none; }
.cert-banner { background: linear-gradient(135deg, #fff7e6, #fdeccc); border-radius: var(--radius); padding: 18px; text-align: center; margin-top: 16px; }
.cert-banner p { color: var(--ink); font-size: 13.5px; font-weight: 500; margin-bottom: 8px; }
.cert-banner span { font-size: 56px; }

/* ---------- Notifications ---------- */
.noti { display: flex; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.noti .ci { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.noti .t { flex: 1; min-width: 0; }
.noti b { color: var(--ink); font-size: 14px; display: block; }
.noti small { color: var(--muted); font-size: 12.5px; display: block; }
.noti time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.noti.unread b::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--p); margin-left: 6px; vertical-align: middle; }

/* ---------- Profile / Settings ---------- */
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.profile-head h2 { font-size: 20px; }
.profile-head small { color: var(--muted); font-size: 12.5px; display: block; }
.profile-head .bar { margin-top: 8px; width: 160px; }
.p-stats { display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 0; text-align: center; margin-bottom: 16px; }
.p-stats div + div { border-left: 1px solid var(--line); }
.p-stats b { display: block; font-size: 20px; color: var(--ink); }
.p-stats small { color: var(--muted); font-size: 12px; }
.menu { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; font-size: 14px; color: var(--ink); }
.menu > :last-child { border-bottom: 0; }
.menu svg:first-child { color: var(--p); }
.menu span { flex: 1; }
.menu .val { color: var(--muted); font-size: 12.5px; flex: none; }
.menu .chev { color: #c3c7d3; }
.upgrade { margin-top: 16px; background: linear-gradient(135deg, #7c3aed, #4c1d95); color: #fff; border-radius: 16px; padding: 16px; display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; }
.upgrade .ci { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.upgrade b { display: block; font-size: 15px; }
.upgrade small { opacity: .8; font-size: 12.5px; }
.upgrade .t { flex: 1; }
.menu .toggle-sw, .toggle-sw { width: 42px; height: 24px; border-radius: 20px; background: #d6d8e1; position: relative; transition: background .2s; flex: none; }
.toggle-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle-sw.on { background: var(--p); }
.toggle-sw.on::after { transform: translateX(18px); }
.logout { color: var(--red) !important; justify-content: center; font-weight: 600; }

/* ---------- Sheet / modal / toast ---------- */
.overlay { position: absolute; inset: 0; background: rgba(10, 10, 25, .45); z-index: 40; display: flex; align-items: flex-end; animation: fadeIn .2s ease; }
.sheet { background: #fff; width: 100%; border-radius: 24px 24px 0 0; padding: 10px 18px calc(22px + var(--safe-b)); max-height: 88%; overflow-y: auto; animation: up .25s ease; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: #dcdde6; margin: 0 auto 14px; }
.sheet h3 { font-size: 18px; margin-bottom: 14px; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.cert { border: 6px double #c9a227; border-radius: 12px; padding: 22px 16px; text-align: center; background: linear-gradient(180deg, #fffdf6, #fff7e0); margin-bottom: 14px; }
.cert small { letter-spacing: .14em; text-transform: uppercase; font-size: 10.5px; color: #8a6d0b; font-weight: 700; }
.cert h4 { font-family: Georgia, serif; font-size: 24px; margin: 10px 0 4px; color: var(--ink); }
.cert p { font-size: 12.5px; color: var(--text); }
.cert .course { font-weight: 700; color: var(--p); font-size: 16px; margin: 6px 0; }
.toast { position: absolute; left: 50%; bottom: 96px; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 13px; z-index: 60; transition: all .25s ease; pointer-events: none; max-width: 86%; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
