/* =============================================================================
   AIBP RETREAT CONNECT — style.css
   AIBP ASEAN Innovation Retreat 2026 · Singapore
   Fonts: Crimson Pro (display) + Lato (body)
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;600;700&family=Lato:wght@300;400;700&display=swap');

/* ── CSS Custom Properties ─────────────────────────────────────────────────── */
:root {
  /* Brand colours */
  --red:         #B42024;
  --dark:        #3C3838;
  --white:       #FFFFFF;
  --grey-light:  #F5F5F5;
  --grey-mid:    #E0E0E0;
  --grey-muted:  #9E9E9E;

  /* ASEAN accents */
  --asean-id:  #4B64AE;
  --asean-my:  #EE963A;
  --asean-ph:  #854C9D;
  --asean-th:  #834924;
  --asean-vn:  #F37346;
  --asean-sg:  #B42024;

  /* Gradients */
  --header-gradient: linear-gradient(135deg, #B42024 0%, #3C3838 100%);

  /* Typography */
  --font-display: 'Crimson Pro', Georgia, serif;
  --font-body:    'Lato', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing / shape */
  --radius:       16px;
  --radius-sm:    12px;
  --radius-xs:    8px;
  --shadow:       0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg:    0 8px 32px rgba(0, 0, 0, 0.14);

  /* Layout */
  --header-h:    56px;
  --nav-h:       68px;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/*
 * FIX: CSS ID rules (#screen-login, #app-shell) have higher specificity than
 * the browser's built-in [hidden] { display: none } rule. Without this override,
 * setting element.hidden = true has no visual effect — the element stays visible.
 */
[hidden] { display: none !important; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  background: var(--grey-light);
  color: var(--dark);
  font-size: 15px;
  line-height: 1.6;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); outline: none; }
a { color: inherit; text-decoration: none; }

/* ── Login Screen ──────────────────────────────────────────────────────────── */
#screen-login {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--grey-light);
  z-index: 10;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--white);
  border-radius: 24px;
  padding: 44px 32px 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1;
  letter-spacing: 0.01em;
}
.login-logo .dot { color: var(--red); }

/* ── Logo image (replaces text logo) ──────────────────────────────────────── */
.logo-img {
  display: block;
  object-fit: contain;
}

/* Login card: larger, centred, no filter (logo on white card) */
.logo-img--login {
  height: 60px;
  margin: 0 auto 8px;
}

/* App header: smaller + invert to white on the dark gradient */
.logo-img--header {
  height: 32px;
  filter: brightness(0) invert(1);
}

.login-tagline {
  font-size: 11px;
  font-weight: 400;
  color: var(--grey-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
  margin-bottom: 32px;
}

.login-event {
  font-size: 13px;
  color: var(--grey-muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

.login-instruction {
  font-size: 13px;
  color: var(--grey-muted);
  margin-bottom: 16px;
}

/* PIN boxes */
.pin-inputs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}
.pin-box {
  width: 58px;
  height: 64px;
  border: 2px solid var(--grey-mid);
  border-radius: var(--radius-xs);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  color: var(--dark);
  background: var(--grey-light);
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
}
.pin-box:focus  { border-color: var(--dark); background: var(--white); }
.pin-box.error  { border-color: var(--red); }

#login-error {
  color: var(--red);
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 12px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  background: var(--red);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 15px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  transition: opacity 0.15s;
}
.btn-primary:active   { opacity: 0.82; }
.btn-primary:disabled { opacity: 0.45; cursor: default; }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: var(--white);
  color: var(--dark);
  border: 1.5px solid var(--grey-mid);
  border-radius: var(--radius-sm);
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background 0.15s;
}
.btn-secondary:active { background: var(--grey-light); }

/* ── App Shell ─────────────────────────────────────────────────────────────── */
#app-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
}

/* Header */
#app-header {
  flex-shrink: 0;
  height: var(--header-h);
  background: var(--header-gradient);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 50;
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.header-logo {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.01em;
  line-height: 1;
}
.header-logo .dot { color: var(--red); }

.header-logo-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.bell-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  font-size: 18px;
  color: var(--white);
  transition: background 0.15s;
}
.bell-btn:active { background: rgba(255,255,255,0.22); }

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  background: var(--red);
  border: 2px solid var(--white);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}
.notif-badge.hidden { display: none; }

/* Main scroll area */
#app-main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--grey-light);
}

/* Screens */
.screen { display: none; min-height: 100%; }
.screen.active { display: block; }

/* Bottom Nav */
#bottom-nav {
  flex-shrink: 0;
  height: var(--nav-h);
  background: var(--white);
  border-top: 1px solid var(--grey-mid);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 50;
}
.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--grey-muted);
  padding: 8px 4px;
  transition: color 0.15s;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-tab .nav-icon { font-size: 20px; line-height: 1; }
.nav-tab.active   { color: var(--red); }

/* ── Home Screen ───────────────────────────────────────────────────────────── */
.home-content { padding: 16px 16px 24px; }

/* Profile hero card */
.profile-hero {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}
.profile-hero__top {
  background: var(--header-gradient);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-hero__photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
}
.profile-hero__info { flex: 1; min-width: 0; }
.profile-hero__name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 3px;
}
.profile-hero__role {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  line-height: 1.4;
}
.profile-hero__org {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

.profile-hero__bottom {
  background: var(--white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.profile-hero__pts {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.profile-hero__pts-num {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}
.profile-hero__pts-label {
  font-size: 12px;
  color: var(--grey-muted);
  font-weight: 400;
}
.profile-hero__rank {
  background: var(--grey-light);
  border-radius: var(--radius-xs);
  padding: 8px 14px;
  text-align: center;
}
.profile-hero__rank-num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1;
}
.profile-hero__rank-label {
  font-size: 10px;
  color: var(--grey-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Progress card */
.progress-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.progress-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
}
.progress-card__count { color: var(--red); }
.progress-bar {
  height: 8px;
  background: var(--grey-light);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--red);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--grey-muted);
  margin-bottom: 10px;
  margin-top: 4px;
}

/* Mission cards */
.mission-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 16px 20px;
  margin-bottom: 10px;
  border-left: 4px solid var(--red);
  display: flex;
  gap: 14px;
  transition: transform 0.12s;
}
.mission-card:active   { transform: scale(0.99); }
.mission-card.done     { border-left-color: #43A047; opacity: 0.85; }

.mission-card__num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--red);
  color: var(--white);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.mission-card.done .mission-card__num { background: #43A047; }

.mission-card__body { flex: 1; min-width: 0; }
.mission-card__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 4px;
}
.mission-card__desc {
  font-size: 13px;
  color: var(--grey-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}
.mission-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.pts-badge {
  background: var(--red);
  color: var(--white);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.done-badge {
  background: #E8F5E9;
  color: #2E7D32;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
}

.mission-cta {
  background: var(--red);
  color: var(--white);
  border-radius: var(--radius-xs);
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: opacity 0.15s;
}
.mission-cta:active { opacity: 0.82; }

/* Bonus cards */
.bonus-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.bonus-card__icon { font-size: 22px; flex-shrink: 0; }
.bonus-card__info { flex: 1; min-width: 0; }
.bonus-card__title { font-size: 14px; font-weight: 700; color: var(--dark); }
.bonus-card__desc  { font-size: 12px; color: var(--grey-muted); margin-top: 2px; }
.bonus-card__pts   { font-size: 13px; font-weight: 700; color: var(--red); flex-shrink: 0; }
.bonus-card.done .bonus-card__pts { color: #43A047; }

/* ── Agenda Screen ─────────────────────────────────────────────────────────── */
.agenda-header {
  background: var(--white);
  padding: 16px 16px 0;
  border-bottom: 1px solid var(--grey-mid);
  position: sticky;
  top: 0;
  z-index: 10;
}
.day-tabs {
  display: flex;
  gap: 8px;
  padding-bottom: 0;
}
.day-tab {
  flex: 1;
  padding: 10px 8px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--grey-light);
  color: var(--grey-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
}
.day-tab.active {
  background: var(--white);
  color: var(--red);
  border-bottom-color: var(--red);
}
.day-tab__num { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.day-tab__date { display: block; font-size: 13px; font-weight: 700; margin-top: 2px; }

.agenda-content { padding: 16px 16px 24px; }

.session-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  gap: 14px;
}
.session-card.social {
  background: #FFF8F0;
  border-left: 4px solid var(--asean-my);
}
.session-card.optional {
  background: var(--grey-light);
  opacity: 0.9;
  border-left: 4px solid var(--grey-mid);
}

.session-card__time {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  min-width: 72px;
  padding-top: 2px;
  line-height: 1.4;
}
.session-card.optional .session-card__time { color: var(--grey-muted); }
.session-card.social .session-card__time   { color: var(--asean-my); }

.session-card__main { flex: 1; min-width: 0; }
.session-card__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.25;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.session-card__desc {
  font-size: 12px;
  color: var(--grey-muted);
  line-height: 1.5;
  margin-bottom: 6px;
}
.session-card__location {
  font-size: 11px;
  color: var(--grey-muted);
  font-style: italic;
}

.track-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  vertical-align: middle;
  flex-shrink: 0;
}
.track-badge.a { background: #EBF5FF; color: #1565C0; }
.track-badge.b { background: #F3E8FF; color: #6B21A8; }

/* ── People Screen ─────────────────────────────────────────────────────────── */
.people-header {
  padding: 16px 16px 12px;
  background: var(--white);
  border-bottom: 1px solid var(--grey-mid);
  position: sticky;
  top: 0;
  z-index: 10;
}
.search-input {
  width: 100%;
  background: var(--grey-light);
  border: 1.5px solid var(--grey-mid);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 15px;
  color: var(--dark);
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--dark); background: var(--white); }

.people-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 16px 24px;
}

.person-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 12px 14px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.person-card:active { transform: scale(0.97); box-shadow: none; }

.person-card__photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 10px;
  border: 2px solid var(--grey-light);
  background-color: var(--grey-mid);
}
.person-card__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
  margin-bottom: 3px;
}
.person-card__org {
  font-size: 11px;
  color: var(--grey-muted);
  margin-bottom: 5px;
  line-height: 1.3;
}
.person-card__flag { font-size: 18px; }

.company-logo {
  height: 32px;
  max-width: 100px;
  object-fit: contain;
  margin-top: 4px;
  display: block;
}

/* ── Gallery Screen ────────────────────────────────────────────────────────── */
.gallery-header {
  padding: 16px 16px 12px;
  background: var(--white);
  border-bottom: 1px solid var(--grey-mid);
}
.gallery-header__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 12px 24px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--grey-mid);
  aspect-ratio: 1 / 1;
  cursor: pointer;
}
.gallery-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.gallery-item:active .gallery-item__img { transform: scale(0.98); }
.gallery-item__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  padding: 20px 8px 8px;
  color: var(--white);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
}

/* ── Leaderboard Screen ────────────────────────────────────────────────────── */
.lb-header {
  background: var(--white);
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--grey-mid);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lb-header__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
}
.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #2E7D32;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4CAF50;
  animation: pulse 1.6s ease-in-out infinite;
}

/* Podium */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 20px 16px 0;
  background: var(--white);
}
.podium-item {
  flex: 1;
  max-width: 110px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.podium-photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 4px;
  border: 3px solid var(--grey-mid);
}
.podium-item--1st .podium-photo { width: 68px; height: 68px; border-color: #FFD700; }
.podium-item--2nd .podium-photo { border-color: #C0C0C0; }
.podium-item--3rd .podium-photo { border-color: #CD7F32; }
.podium-medal { font-size: 18px; margin-bottom: 2px; }
.podium-name  { font-size: 11px; font-weight: 700; color: var(--dark); line-height: 1.2; }
.podium-pts   { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--red); margin-top: 2px; }
.podium-block {
  width: 100%;
  border-radius: 6px 6px 0 0;
  margin-top: 8px;
}
.podium-block--1st { background: #FFD700; height: 48px; }
.podium-block--2nd { background: #C0C0C0; height: 32px; }
.podium-block--3rd { background: #CD7F32; height: 22px; }

/* Leaderboard list */
.lb-list { padding: 12px 16px 24px; background: var(--grey-light); }
.lb-row {
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.lb-row.me {
  background: #FFF5F5;
  border-left: 4px solid var(--red);
}
.lb-rank {
  font-size: 14px;
  font-weight: 700;
  color: var(--grey-muted);
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.lb-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.lb-info { flex: 1; min-width: 0; }
.lb-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-org { font-size: 11px; color: var(--grey-muted); }
.lb-pts {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--red);
  flex-shrink: 0;
}
.lb-loading { padding: 40px; text-align: center; color: var(--grey-muted); font-size: 14px; }

/* ── Empty States ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-state__icon  { font-size: 48px; margin-bottom: 12px; }
.empty-state__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}
.empty-state__text  { font-size: 14px; color: var(--grey-muted); line-height: 1.5; }

/* ── Mission Modal (bottom sheet) ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(60, 56, 56, 0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mission-modal {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  z-index: 201;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -6px 32px rgba(0,0,0,0.18);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mission-modal.open { transform: translateX(-50%) translateY(0); }

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--grey-mid);
  border-radius: 2px;
  margin: 12px auto 0;
}
.modal-inner {
  padding: 20px 20px 36px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grey-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--grey-muted);
  transition: background 0.15s;
}
.modal-close:active { background: var(--grey-mid); }

.modal-num {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  margin-bottom: 4px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 8px;
}
.modal-desc {
  font-size: 14px;
  color: var(--grey-muted);
  line-height: 1.55;
  margin-bottom: 20px;
}

.modal-input {
  width: 100%;
  border: 1.5px solid var(--grey-mid);
  border-radius: var(--radius-xs);
  padding: 14px;
  font-size: 15px;
  color: var(--dark);
  background: var(--grey-light);
  margin-bottom: 16px;
  transition: border-color 0.15s, background 0.15s;
}
.modal-input:focus { border-color: var(--dark); background: var(--white); }

.modal-textarea {
  width: 100%;
  border: 1.5px solid var(--grey-mid);
  border-radius: var(--radius-xs);
  padding: 14px;
  font-size: 15px;
  color: var(--dark);
  background: var(--grey-light);
  resize: none;
  line-height: 1.55;
  margin-bottom: 6px;
  transition: border-color 0.15s, background 0.15s;
}
.modal-textarea:focus { border-color: var(--dark); background: var(--white); }
.char-count { text-align: right; font-size: 11px; color: var(--grey-muted); margin-bottom: 16px; }

/* Photo upload */
.photo-upload-zone {
  border: 2px dashed var(--grey-mid);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  margin-bottom: 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.photo-upload-zone:hover { border-color: var(--dark); background: var(--grey-light); }
.photo-upload-zone__icon { font-size: 48px; margin-bottom: 8px; }
.photo-upload-zone__text { font-size: 14px; color: var(--grey-muted); line-height: 1.4; }

.photo-preview {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.photo-preview.hidden { display: none; }

/* MCQ */
.mcq-question {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.35;
  margin-bottom: 16px;
}
.mcq-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.mcq-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--grey-mid);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.mcq-option:has(input:checked) {
  border-color: var(--red);
  background: #FFF5F5;
}
.mcq-option input[type="radio"] { width: 16px; height: 16px; accent-color: var(--red); flex-shrink: 0; }
.mcq-option__label { font-size: 14px; color: var(--dark); font-weight: 400; }

/* ── Profile Modal (full-screen overlay) ───────────────────────────────────── */
#modal-profile {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-width: 480px;
  margin: 0 auto;
}
#modal-profile.hidden { display: none; }

.modal-profile-overlay {
  position: absolute;
  inset: 0;
  background: rgba(60,56,56,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.modal-profile-sheet {
  position: relative;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 40px;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
}
.modal-profile-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grey-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--grey-muted);
}

.modal-profile__photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 14px;
  border: 3px solid var(--white);
  box-shadow: var(--shadow);
  display: block;
}
.modal-profile__name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}
.modal-profile__title {
  font-size: 14px;
  color: var(--grey-muted);
  margin-bottom: 2px;
}
.modal-profile__org {
  font-size: 15px;
  color: var(--dark);
  font-weight: 700;
  margin-bottom: 20px;
}
.modal-profile__actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.connected-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #E8F5E9;
  color: #2E7D32;
  border-radius: var(--radius-xs);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
}
.connected-badge.info {
  background: #E3F2FD;
  color: #1565C0;
}

/* ── Notification Panel (slide up) ────────────────────────────────────────── */
#panel-notifications {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-width: 480px;
  margin: 0 auto;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
#panel-notifications.open {
  pointer-events: auto;
  opacity: 1;
}

.notif-overlay {
  position: absolute;
  inset: 0;
  background: rgba(60,56,56,0.45);
}
.notif-sheet {
  position: relative;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  max-height: 70vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}
#panel-notifications.open .notif-sheet { transform: translateY(0); }

.notif-sheet__handle {
  width: 40px;
  height: 4px;
  background: var(--grey-mid);
  border-radius: 2px;
  margin: 12px auto 0;
}
.notif-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--grey-mid);
}
.notif-sheet__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
}
.notif-sheet__close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grey-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--grey-muted);
}

.notif-list { padding: 8px 0 24px; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--grey-light);
}
.notif-item__icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.notif-item__body { flex: 1; }
.notif-item__text { font-size: 14px; color: var(--dark); line-height: 1.45; }
.notif-item__time { font-size: 11px; color: var(--grey-muted); margin-top: 3px; }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark);
  color: var(--white);
  padding: 12px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
  z-index: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100% - 48px);
  text-align: center;
  white-space: normal;
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.8); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-10px); }
  40%       { transform: translateX(10px); }
  60%       { transform: translateX(-8px); }
  80%       { transform: translateX(8px); }
}
.shake { animation: shake 0.45s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.2s ease; }

/* ── Responsive — tablet / desktop centering ───────────────────────────────── */
@media (min-width: 480px) {
  #screen-login { background: #e8e4e0; }
  .login-card   { padding: 52px 44px 48px; }
  .people-grid  { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
