/* ============================================================
   Njangi Famille — Design System
   Premium offline-first prototype (UNICEF x MINPROFF)
   ============================================================ */

:root {
  /* Brand palette */
  --cyan: #1cabe2;          /* UNICEF cyan */
  --cyan-dark: #0b6f96;
  --navy: #0c2340;
  --gold: #f4b740;
  --coral: #ef5a4c;
  --green: #2fa36b;
  --purple: #6a5acd;

  /* Semantic */
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --ink: #14233b;
  --ink-soft: #52627a;
  --ink-faint: #8a97ab;
  --line: #e6ebf2;
  --danger: #e5484d;
  --danger-bg: #fdecec;
  --success: #2fa36b;
  --success-bg: #e7f6ee;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(12, 35, 64, .06), 0 1px 3px rgba(12, 35, 64, .08);
  --shadow-md: 0 6px 18px rgba(12, 35, 64, .10);
  --shadow-lg: 0 18px 45px rgba(12, 35, 64, .22);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 26px;

  --grad-brand: linear-gradient(135deg, #1cabe2 0%, #2f6fd8 100%);
  --grad-warm: linear-gradient(135deg, #f7b733 0%, #ef5a4c 100%);
  --grad-green: linear-gradient(135deg, #34d399 0%, #2fa36b 100%);
  --grad-purple: linear-gradient(135deg, #8b7bf0 0%, #6a5acd 100%);

  --font: "Segoe UI", Roboto, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --app-w: 430px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 15% -10%, #d7ecfb 0%, transparent 55%),
    radial-gradient(1000px 700px at 110% 10%, #ffe9c9 0%, transparent 45%),
    var(--bg);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ============================================================
   Device frame (presentation-friendly on desktop)
   ============================================================ */
.device {
  position: relative;
  width: min(100vw, var(--app-w));
  height: 100dvh;
  max-height: 100dvh;
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 480px) {
  body { padding: 22px; }
  .device {
    height: min(92dvh, 900px);
    border-radius: 42px;
    border: 12px solid #0c2340;
    outline: 2px solid #24344f;
  }
  .device::before {
    content: "";
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 140px; height: 26px;
    background: #0c2340;
    border-radius: 0 0 16px 16px;
    z-index: 60;
  }
}

/* ============================================================
   Splash screen
   ============================================================ */
.splash {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: var(--grad-brand);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity .6s ease, visibility .6s ease;
}
.splash.hidden { opacity: 0; visibility: hidden; }
.splash .logo-badge {
  width: 108px; height: 108px;
  border-radius: 30px;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
  animation: pop .8s cubic-bezier(.2,.9,.3,1.4) both;
}
.splash .logo-badge svg { width: 64px; height: 64px; }
.splash h1 { margin: 6px 0 0; font-size: 28px; letter-spacing: .3px; animation: rise .7s .15s both; }
.splash p { margin: 0; opacity: .9; font-size: 14px; animation: rise .7s .28s both; }
.splash .dots { display: flex; gap: 7px; margin-top: 10px; animation: rise .7s .4s both; }
.splash .dots i { width: 9px; height: 9px; border-radius: 50%; background: #fff; opacity: .55; animation: blink 1.2s infinite; }
.splash .dots i:nth-child(2){ animation-delay: .2s; }
.splash .dots i:nth-child(3){ animation-delay: .4s; }

@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes blink { 0%,100%{ opacity:.3; transform: translateY(0);} 50%{ opacity:1; transform: translateY(-4px);} }

/* ============================================================
   App layout
   ============================================================ */
.app-header {
  flex: 0 0 auto;
  padding: 16px 18px 12px;
  background: var(--grad-brand);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  z-index: 20;
}
.app-header .brand-mark { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.app-header .brand-mark svg { width: 24px; height: 24px; }
.app-header .titles { line-height: 1.1; }
.app-header .titles b { font-size: 17px; }
.app-header .titles span { display: block; font-size: 11px; opacity: .85; margin-top: 2px; letter-spacing: .2px; }
.app-header .header-pill {
  margin-left: auto;
  font-size: 11px;
  background: rgba(255,255,255,.18);
  padding: 6px 10px;
  border-radius: 999px;
  display: flex; align-items: center; gap: 6px;
}
.app-header .header-pill i { width: 7px; height: 7px; border-radius: 50%; background: #7CFFB2; box-shadow: 0 0 0 3px rgba(124,255,178,.25); }
.app-header .header-settings {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border: none; border-radius: 12px;
  background: rgba(255,255,255,.18);
  color: #fff;
  display: grid; place-items: center;
}
.app-header .header-settings:active { background: rgba(255,255,255,.28); }
.app-header .header-settings [data-lucide],
.app-header .header-settings svg { width: 20px; height: 20px; }

.app-main {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 18px 16px 96px;
  -webkit-overflow-scrolling: touch;
  animation: viewIn .35s ease both;
}
.view::-webkit-scrollbar { width: 0; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: translateY(0);} }

.view-title { margin: 4px 2px 14px; font-size: 22px; font-weight: 800; letter-spacing: -.2px; }
.view-subtitle { color: var(--ink-soft); font-size: 13px; margin: -8px 2px 16px; }

/* ============================================================
   Bottom navigation
   ============================================================ */
.bottom-nav {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 72px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 40;
}
.nav-btn {
  flex: 1;
  border: none; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  color: var(--ink-faint);
  font-size: 11px; font-weight: 600;
  transition: color .2s;
  padding-top: 6px;
}
.nav-btn svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.nav-btn.active { color: var(--cyan); }
.nav-btn.active svg { transform: translateY(-1px); }
.nav-btn .nav-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); opacity: 0; margin-top: 1px; transition: opacity .2s; }
.nav-btn.active .nav-dot { opacity: 1; }

/* ============================================================
   Cards & generic UI
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.card-hero {
  background: var(--grad-brand);
  color: #fff; border: none;
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.card-hero::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.card-hero .eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; opacity: .85; }
.card-hero h2 { margin: 6px 0 2px; font-size: 22px; }
.card-hero p { margin: 0; opacity: .92; font-size: 13px; }

.section-label { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 10px; }
.section-label h3 { margin: 0; font-size: 15px; font-weight: 800; }
.section-label a { font-size: 12px; color: var(--cyan-dark); text-decoration: none; font-weight: 700; }

.btn {
  border: none; border-radius: 12px;
  padding: 13px 16px;
  font-size: 15px; font-weight: 700;
  background: var(--grad-brand); color: #fff;
  box-shadow: 0 8px 18px rgba(28,171,226,.32);
  transition: transform .12s ease, box-shadow .2s, filter .2s;
  width: 100%;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn.secondary { background: var(--surface); color: var(--cyan-dark); box-shadow: none; border: 1.5px solid var(--line); }
.btn.warm { background: var(--grad-warm); box-shadow: 0 8px 18px rgba(239,90,76,.3); }
.btn.ghost { background: rgba(255,255,255,.14); color: #fff; box-shadow: none; }
.btn:disabled { opacity: .5; }
.btn-row { display: flex; gap: 10px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 15px; background: var(--surface-2); color: var(--ink);
  transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--cyan); background: #fff; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 13px; border-radius: 999px;
  background: var(--surface-2); border: 1.5px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  transition: all .15s;
}
.chip.selected { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 9px; }

.pill { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.pill.green { background: var(--success-bg); color: var(--success); }
.pill.gold { background: #fff3d6; color: #b7860b; }
.pill.cyan { background: #e2f4fc; color: var(--cyan-dark); }

/* ============================================================
   Onboarding wizard
   ============================================================ */
.wizard { display: flex; flex-direction: column; min-height: 100%; }
.wizard-progress { display: flex; gap: 8px; margin-bottom: 20px; }
.wizard-progress i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); transition: background .3s; }
.wizard-progress i.done { background: var(--cyan); }
.wizard-step { animation: viewIn .3s ease both; }
.wizard-illus { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; font-size: 42px; margin: 6px 0 14px; }
.wizard h2 { font-size: 22px; margin: 0 0 6px; }
.wizard .hint { color: var(--ink-soft); font-size: 13px; margin: 0 0 20px; }
.age-display { font-size: 44px; font-weight: 800; text-align: center; color: var(--cyan-dark); margin: 8px 0; }
.age-display small { font-size: 15px; color: var(--ink-soft); font-weight: 600; }
input[type=range] { width: 100%; accent-color: var(--cyan); height: 30px; }

/* ============================================================
   Dashboard / milestones
   ============================================================ */
.profile-row { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 52px; height: 52px; border-radius: 16px;
  background: rgba(255,255,255,.22);
  display: grid; place-items: center; font-size: 22px; font-weight: 800;
  flex: 0 0 auto;
}
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 10px; text-align: center; box-shadow: var(--shadow-sm);
}
.stat b { display: block; font-size: 20px; color: var(--cyan-dark); }
.stat span { font-size: 11px; color: var(--ink-soft); }

.timeline { position: relative; margin-left: 6px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.milestone { position: relative; padding: 6px 0 16px; }
.milestone::before {
  content: ""; position: absolute; left: -22px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--line);
}
.milestone.done::before { background: var(--success); border-color: var(--success); }
.milestone.current::before { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 5px rgba(244,183,64,.2); }
.milestone h4 { margin: 0 0 3px; font-size: 14px; }
.milestone p { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.milestone .age-tag { font-size: 11px; color: var(--ink-faint); font-weight: 700; }

.tip-card { display: flex; gap: 12px; align-items: flex-start; }
.tip-card .tip-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--grad-warm); display: grid; place-items: center; font-size: 22px; flex: 0 0 auto; }

.njangi-card { background: var(--grad-green); color: #fff; border: none; }
.njangi-card h3 { margin: 0 0 4px; font-size: 16px; }
.njangi-card p { margin: 0 0 12px; font-size: 13px; opacity: .95; }
.avatars-stack { display: flex; }
.avatars-stack span {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.25); border: 2px solid #2fa36b; font-size: 13px; font-weight: 700;
  margin-left: -8px;
}
.avatars-stack span:first-child { margin-left: 0; }

/* ============================================================
   Toast / SMS notification
   ============================================================ */
.toast-layer { position: absolute; top: 10px; left: 12px; right: 12px; z-index: 80; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  background: #fff; border-radius: 16px; padding: 12px 14px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  display: flex; gap: 12px; align-items: flex-start;
  animation: toastIn .4s cubic-bezier(.2,.9,.3,1.3) both;
  pointer-events: auto;
}
.toast .t-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; flex: 0 0 auto; background: var(--grad-brand); color: #fff; }
.toast.sms .t-icon { background: var(--grad-green); }
.toast .t-body b { font-size: 13px; display: block; }
.toast .t-body p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.toast .t-time { margin-left: auto; font-size: 10px; color: var(--ink-faint); }
@keyframes toastIn { from { transform: translateY(-24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============================================================
   Chat (WhatsApp-like)
   ============================================================ */
.chat-wrap { display: flex; flex-direction: column; height: 100%; }
.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.chat-head .bot-ava { width: 42px; height: 42px; border-radius: 50%; background: var(--grad-brand); display: grid; place-items: center; font-size: 22px; color: #fff; }
.chat-head b { font-size: 15px; }
.chat-head small { display: block; font-size: 11px; color: var(--success); font-weight: 600; }
.chat-head .lang-pill { margin-left: auto; font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); padding: 5px 9px; border-radius: 999px; color: var(--ink-soft); font-weight: 700; }

.chat-scroll {
  flex: 1 1 auto; overflow-y: auto; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 8px;
  background:
    radial-gradient(circle at 20% 10%, rgba(28,171,226,.05), transparent 40%),
    var(--surface-2);
}
.chat-scroll::-webkit-scrollbar { width: 0; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.4; position: relative; animation: msgIn .25s ease both; }
@keyframes msgIn { from { opacity:0; transform: translateY(6px);} to {opacity:1; transform: translateY(0);} }
.msg .time { display: block; font-size: 10px; opacity: .6; margin-top: 4px; text-align: right; }
.msg.user { align-self: flex-end; background: var(--grad-brand); color: #fff; border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: #fff; color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.bot.alert { background: var(--danger-bg); border-color: #f6c4c6; color: #7a1418; }
.msg.bot.alert b { color: var(--danger); }

.typing { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 16px; border-bottom-left-radius: 5px; padding: 12px 14px; display: none; }
.typing.show { display: flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); animation: blink 1.1s infinite; }
.typing i:nth-child(2){ animation-delay: .18s; }
.typing i:nth-child(3){ animation-delay: .36s; }

.quick-replies { display: flex; gap: 8px; overflow-x: auto; padding: 8px 14px; flex: 0 0 auto; background: var(--surface); border-top: 1px solid var(--line); }
.quick-replies::-webkit-scrollbar { height: 0; }
.quick-replies .qr { white-space: nowrap; }

.chat-input-area { display: flex; gap: 8px; padding: 10px 12px; background: var(--surface); border-top: 1px solid var(--line); flex: 0 0 auto; }
.chat-input-area input { flex: 1; border: 1.5px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 12px 16px; font-size: 14px; }
.chat-input-area input:focus { outline: none; border-color: var(--cyan); }
.chat-input-area .send-btn { width: 46px; height: 46px; border-radius: 50%; border: none; background: var(--grad-brand); color: #fff; display: grid; place-items: center; flex: 0 0 auto; box-shadow: 0 6px 14px rgba(28,171,226,.35); }
.chat-input-area .send-btn svg { width: 20px; height: 20px; }

/* ============================================================
   Hub (Netflix-like)
   ============================================================ */
.carousel { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; }
.carousel::-webkit-scrollbar { height: 0; }
.content-card {
  flex: 0 0 auto; width: 150px; scroll-snap-align: start;
  background: var(--surface); border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .15s;
}
.content-card:active { transform: scale(.97); }
.content-card .thumb { height: 110px; display: grid; place-items: center; font-size: 38px; color: #fff; position: relative; overflow: hidden; }
.content-card .thumb-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1; display: block;
}
.content-card .thumb .dur,
.content-card .thumb .off-badge { z-index: 2; }
.player .art { overflow: hidden; }
.player .art-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.content-card .thumb .dur { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 6px; font-weight: 700; }
.content-card .thumb .off-badge { position: absolute; top: 6px; left: 6px; background: var(--success); color:#fff; font-size:10px; padding:2px 6px; border-radius:6px; font-weight:700; display:none; }
.content-card.offline .thumb .off-badge { display: block; }
.content-card .meta { padding: 9px 10px 11px; }
.content-card .meta .cat { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--cyan-dark); }
.content-card .meta h4 { margin: 3px 0 0; font-size: 13px; line-height: 1.25; }

.grad-1 { background: var(--grad-brand); }
.grad-2 { background: var(--grad-warm); }
.grad-3 { background: var(--grad-green); }
.grad-4 { background: linear-gradient(135deg,#8b7bf0,#6a5acd); }
.grad-5 { background: linear-gradient(135deg,#f78ca0,#f9748f); }
.grad-6 { background: linear-gradient(135deg,#43cea2,#185a9d); }

/* Audio player (bottom sheet) */
.sheet-backdrop { position: absolute; inset: 0; background: rgba(12,35,64,.45); z-index: 70; opacity: 0; visibility: hidden; transition: opacity .3s; }
.sheet-backdrop.show { opacity: 1; visibility: visible; }
.player {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 75;
  background: var(--surface); border-radius: 26px 26px 0 0;
  padding: 10px 20px 26px; box-shadow: var(--shadow-lg);
  transform: translateY(110%); transition: transform .35s cubic-bezier(.2,.9,.3,1);
}
.player.show { transform: translateY(0); }
.player .grabber { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 16px; }
.player .art { width: 120px; height: 120px; border-radius: 22px; margin: 0 auto 16px; display: grid; place-items: center; font-size: 54px; color: #fff; }
.player .art.spin { animation: spin 6s linear infinite; border-radius: 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
.player h3 { text-align: center; margin: 0 0 2px; font-size: 18px; }
.player .p-cat { text-align: center; color: var(--ink-soft); font-size: 12px; margin: 0 0 16px; }
.player .progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 6px; }
.player .progress .bar { height: 100%; width: 0; background: var(--grad-brand); border-radius: 3px; }
.player .times { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-soft); margin-bottom: 14px; }
.player .controls { display: flex; align-items: center; justify-content: center; gap: 26px; }
.player .controls button { border: none; background: none; color: var(--ink); display: grid; place-items: center; }
.player .controls svg { width: 26px; height: 26px; }
.player .controls .play { width: 62px; height: 62px; border-radius: 50%; background: var(--grad-brand); color: #fff; box-shadow: 0 10px 22px rgba(28,171,226,.4); }
.player .controls .play svg { width: 28px; height: 28px; }
.player .vol-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--ink-soft); }
.player .vol-row span { font-size: 16px; }
.player .vol-row input { flex: 1; accent-color: var(--cyan); }
.player .progress { cursor: pointer; }
.demo-strip {
  display: flex; align-items: center; gap: 8px;
  background: #fff8e6; border: 1px solid #f4d48a; color: #8a6408;
  border-radius: 12px; padding: 10px 12px; font-size: 12px; font-weight: 600;
  margin-bottom: 14px;
}
.demo-strip b { color: #6b4e00; }

/* ============================================================
   Simulators
   ============================================================ */
.tabs { display: flex; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); padding: 5px; border-radius: 14px; margin-bottom: 16px; }
.tabs button { flex: 1; border: none; background: none; padding: 10px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.tabs button.active { background: #fff; color: var(--cyan-dark); box-shadow: var(--shadow-sm); }

.sim-panel { display: none; }
.sim-panel.active { display: block; animation: viewIn .3s ease both; }

/* USSD phone */
.ussd-phone {
  background: #10151b; border-radius: 22px; padding: 16px;
  box-shadow: var(--shadow-md); border: 1px solid #232c36;
}
.ussd-screen {
  background: #041b04; color: #35ff6a; font-family: "Courier New", monospace;
  border-radius: 10px; padding: 14px; min-height: 168px;
  font-size: 14px; line-height: 1.7; white-space: pre-wrap;
  box-shadow: inset 0 0 22px rgba(53,255,106,.12);
  border: 1px solid #0c3a12;
}
.ussd-screen .blink-cursor::after { content: "_"; animation: blink 1s steps(1) infinite; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.keypad button {
  background: #1c2530; color: #fff; border: 1px solid #2b3644;
  border-radius: 12px; padding: 14px 0; font-size: 18px; font-weight: 700;
}
.keypad button:active { background: #26313e; }
.keypad button small { display: block; font-size: 9px; color: #8fa0b3; font-weight: 500; letter-spacing: 1px; }
.keypad .kp-call { background: var(--success); border-color: var(--success); }
.keypad .kp-back { background: var(--coral); border-color: var(--coral); }

/* IVR call */
.ivr-call {
  background: linear-gradient(160deg,#0c2340,#123a63);
  border-radius: 22px; padding: 24px 20px; color: #fff; text-align: center;
}
.ivr-avatar { width: 90px; height: 90px; border-radius: 50%; background: rgba(255,255,255,.15); display: grid; place-items: center; font-size: 42px; margin: 4px auto 12px; position: relative; }
.ivr-avatar.ringing::before, .ivr-avatar.ringing::after { content:""; position:absolute; inset:0; border-radius:50%; border:2px solid rgba(255,255,255,.4); animation: ring 1.8s infinite; }
.ivr-avatar.ringing::after { animation-delay: .9s; }
@keyframes ring { from { transform: scale(1); opacity:.7;} to { transform: scale(1.7); opacity:0;} }
.ivr-call h3 { margin: 0 0 2px; font-size: 19px; }
.ivr-call .status { font-size: 12px; opacity: .8; margin-bottom: 14px; }
.ivr-transcript { background: rgba(255,255,255,.1); border-radius: 14px; padding: 14px; font-size: 13px; min-height: 66px; line-height: 1.5; margin-bottom: 16px; text-align: left; }
.ivr-transcript b { color: var(--gold); }
.ivr-keys { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.ivr-keys button { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); color: #fff; border-radius: 12px; padding: 14px 0; font-size: 16px; font-weight: 700; }
.ivr-keys button:active { background: rgba(255,255,255,.26); }

.info-note { font-size: 12px; color: var(--ink-soft); background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 12px; margin-top: 14px; line-height: 1.5; }
.info-note b { color: var(--ink); }

.empty { text-align: center; color: var(--ink-soft); padding: 40px 20px; }
.empty .em { font-size: 46px; }

/* Accessibility helpers */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Logo + Lucide */
.splash .logo-badge img,
.app-header .brand-mark img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: inherit; display: block;
}
.app-header .brand-mark { overflow: hidden; padding: 0; }
.splash .logo-badge { overflow: hidden; padding: 0; }

[data-lucide] { width: 1.15em; height: 1.15em; stroke: currentColor; flex-shrink: 0; }
.nav-btn [data-lucide] { width: 23px; height: 23px; }
.nav-btn svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.btn [data-lucide], .chip [data-lucide], .demo-strip [data-lucide],
.section-label [data-lucide], .njangi-card h3 [data-lucide] {
  width: 18px; height: 18px; vertical-align: -3px; display: inline-block;
}
.illus-ico { width: 42px !important; height: 42px !important; color: #fff; }
.tip-lucide { width: 22px !important; height: 22px !important; color: #fff; }
.bot-ava [data-lucide] { width: 22px; height: 22px; color: #fff; }
.t-icon [data-lucide] { width: 20px; height: 20px; color: #fff; }
.ico-sm { width: 15px !important; height: 15px !important; }
.ico-xs { width: 12px !important; height: 12px !important; }
.thumb-fallback { position: relative; z-index: 1; display: grid; place-items: center; }
.thumb-fallback [data-lucide] { width: 36px; height: 36px; color: #fff; }
.player .controls [data-lucide] { width: 26px; height: 26px; }
.player .controls .play [data-lucide] { width: 28px; height: 28px; color: #fff; }
.player .vol-row [data-lucide] { width: 18px; height: 18px; color: var(--ink-soft); }
.ivr-avatar [data-lucide] { width: 42px; height: 42px; color: #fff; }
.tabs button [data-lucide] { width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; display: inline-block; }
.content-card .thumb-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1; display: block;
}
.player .art-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* ============================================================
   Settings sheet
   ============================================================ */
.settings-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 80;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 10px 16px 28px;
  max-height: min(78%, 640px);
  overflow-y: auto;
  transform: translateY(110%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -12px 40px rgba(12,35,64,.18);
}
.settings-sheet.show { transform: translateY(0); }
.settings-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.settings-head h2 {
  margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px;
}
.settings-head h2 [data-lucide], .settings-head h2 svg { width: 20px; height: 20px; color: var(--cyan); }
.settings-close {
  width: 36px; height: 36px; border: none; border-radius: 10px;
  background: var(--surface-2); color: var(--ink); display: grid; place-items: center;
}
.settings-close svg { width: 18px; height: 18px; }
.settings-block {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-top: 12px;
}
.settings-block h3 {
  margin: 0 0 10px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--ink-soft); font-weight: 700;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row span { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.settings-row b { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.settings-row b.ok { color: var(--success); }
.settings-hint {
  margin: 0 0 12px; font-size: 13px; line-height: 1.45; color: var(--ink-soft);
}
.settings-action {
  width: 100%; margin-top: 8px; justify-content: center;
  display: inline-flex; align-items: center; gap: 8px;
}
.settings-action.btn.ghost {
  background: transparent; color: var(--coral);
  border: 1px dashed rgba(239,90,76,.45);
  box-shadow: none;
}
.settings-demo { border-color: rgba(28,171,226,.35); background: linear-gradient(180deg, #f3faff, #f6f8fb); }

/* ============================================================
   Guided demo overlay (hand + tips)
   ============================================================ */
.demo-overlay {
  position: absolute; inset: 0;
  z-index: 95;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.demo-overlay.active { opacity: 1; visibility: visible; }
.demo-tip {
  position: absolute;
  width: min(220px, calc(100% - 24px));
  background: #0c2340;
  color: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 12px 28px rgba(12,35,64,.35);
  z-index: 2;
  transform: translateY(6px) scale(.96);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
}
.demo-tip.show { opacity: 1; transform: none; }
.demo-tip-title {
  font-size: 11px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: #7dd3fc; margin-bottom: 4px;
}
.demo-tip p { margin: 0; font-size: 13px; line-height: 1.4; }
.demo-tip::after {
  content: ""; position: absolute; left: 18px; bottom: -6px;
  width: 12px; height: 12px; background: #0c2340;
  transform: rotate(45deg); border-radius: 2px;
}
.demo-hand {
  position: absolute; left: 0; top: 0;
  width: 44px; height: 44px;
  transform: translate(-80px, -80px);
  transition: transform .7s cubic-bezier(.22,.9,.28,1);
  z-index: 3;
  filter: drop-shadow(0 8px 14px rgba(12,35,64,.35));
  opacity: 0;
}
.demo-hand.visible { opacity: 1; }
.demo-hand.press > i,
.demo-hand.press > svg { transform: rotate(-18deg) scale(.86); }
.demo-hand.scroll { animation: demoScrollNudge .5s ease infinite alternate; }
@keyframes demoScrollNudge {
  from { margin-top: 0; }
  to { margin-top: 8px; }
}
.demo-hand [data-lucide], .demo-hand svg {
  width: 40px; height: 40px;
  color: #fff;
  stroke: #0c2340;
  fill: #f4b740;
  stroke-width: 1.5;
  transform: rotate(-18deg);
}
.demo-ripple {
  position: absolute; left: 6px; top: 6px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(28,171,226,.9);
  opacity: 0; pointer-events: none;
}
.demo-ripple.go { animation: demoRipple .55s ease-out; }
@keyframes demoRipple {
  from { transform: scale(.4); opacity: .9; }
  to { transform: scale(2.4); opacity: 0; }
}
.demo-stop {
  position: absolute;
  top: 14px;
  right: 14px;
  transform: none;
  pointer-events: auto;
  z-index: 4;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(255,255,255,.4);
  border-radius: 12px;
  padding: 0;
  background: rgba(12,35,64,.55);
  color: #fff;
  font-weight: 700;
  font-size: 0;
  box-shadow: none;
  backdrop-filter: blur(8px);
}
.demo-stop:active { background: #ef5a4c; border-color: #ef5a4c; }
.demo-stop [data-lucide], .demo-stop svg { width: 16px; height: 16px; }
body.demo-running .bottom-nav { pointer-events: none; }
body.demo-running .header-settings { visibility: hidden; }

