/* ============================================================
   HopeConnect — public design system
   Mobile-first app shell · navy / white / soft gray / gold
   ============================================================ */

:root {
  --navy: #0D1B3D;
  --navy-800: #16295C;
  --royal: #1E3A8A;
  --royal-600: #2547A8;
  --gold: #F59E0B;
  --gold-600: #D97706;
  --green: #10B981;
  --red: #EF4444;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --ink: #111827;
  --muted: #64748B;
  --line: #E2E8F0;
  --line-soft: #EEF2F7;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(13, 27, 61, .06);
  --shadow-md: 0 2px 6px rgba(13, 27, 61, .05), 0 10px 24px rgba(13, 27, 61, .07);
  --shadow-lg: 0 4px 12px rgba(13, 27, 61, .08), 0 20px 44px rgba(13, 27, 61, .12);

  --tabbar-h: 64px;
  --appbar-h: 60px;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--royal); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; font-weight: 700; color: var(--navy); }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid rgba(245, 158, 11, .55); outline-offset: 2px; border-radius: 6px; }
button { font-family: inherit; }
.icon { flex-shrink: 0; vertical-align: -3px; }

.text-muted { color: var(--muted); }
.text-small { font-size: 13px; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.app-main {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 28px);
}
.container { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 16px; }
.section { padding: 20px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 22px 0 12px;
}
.section-head h2 { font-size: 18px; margin: 0; letter-spacing: -.01em; }
.section-head .see-all { font-size: 13px; font-weight: 600; color: var(--royal); display: inline-flex; align-items: center; gap: 2px; }

/* ---------- Top app bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.appbar-inner {
  max-width: 560px; margin: 0 auto; min-height: var(--appbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; color: var(--navy); font-size: 15.5px; letter-spacing: -.01em; }
.brand svg { flex-shrink: 0; }
.brand small { display: block; font-size: 10px; font-weight: 600; color: var(--gold-600); letter-spacing: .08em; text-transform: uppercase; }
.appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.appbar-nav { display: none; }
/* Narrow phones: drop the decorative sub-label and tighten so the top bar never
   overflows (the brand + language + Sign in + Join used to clip on ~360px screens). */
@media (max-width: 420px) {
  .appbar-inner { padding: 0 12px; gap: 8px; }
  .appbar-actions { gap: 4px; }
  .appbar-actions .btn { white-space: nowrap; padding-left: 12px; padding-right: 12px; }
  .brand { font-size: 16px; }
  .brand small { display: none; }
  .lang-menu summary .lang-code { display: none; }
}
.iconbtn {
  position: relative;
  width: 40px; height: 40px; border-radius: 12px; border: none;
  background: transparent; color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s;
}
.iconbtn:hover { background: var(--line-soft); }
.iconbtn .dot {
  position: absolute; top: 8px; right: 8px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--gold); border: 2px solid #fff;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--royal); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-gold { background: linear-gradient(135deg, var(--gold), var(--gold-600)); }

/* ---------- Bottom tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar-inner {
  max-width: 560px; margin: 0 auto; height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted);
  position: relative; transition: color .15s;
}
.tab:hover { color: var(--royal); }
.tab.active { color: var(--navy); }
.tab.active::after {
  content: ''; position: absolute; top: 0; width: 28px; height: 3px;
  border-radius: 0 0 4px 4px; background: var(--gold);
}
.tab .dot {
  position: absolute; top: 10px; right: calc(50% - 16px);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); border: 2px solid #fff;
}
.tab-give {
  margin-top: -22px; width: 54px; height: 54px; align-self: center; justify-self: center;
  border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-600));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(245, 158, 11, .45);
  border: 4px solid var(--bg); transition: transform .15s;
}
.tab-give:hover { transform: translateY(-2px); color: #fff; }
.tab-give-wrap { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; font-size: 10.5px; font-weight: 600; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--r-md);
  font-size: 14.5px; font-weight: 700; font-family: inherit;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s, box-shadow .15s, background .15s;
  text-decoration: none; line-height: 1.2;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--royal); color: #fff; box-shadow: 0 4px 14px rgba(30, 58, 138, .28); }
.btn-primary:hover { background: var(--royal-600); color: #fff; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-600)); color: #fff; box-shadow: 0 4px 14px rgba(245, 158, 11, .35); }
.btn-gold:hover { filter: brightness(1.05); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--navy); }
.btn-outline:hover { border-color: var(--royal); color: var(--royal); }
.btn-ghost { background: transparent; color: var(--royal); }
.btn-ghost:hover { background: rgba(30, 58, 138, .07); }
.btn-danger { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 15px 26px; font-size: 16px; border-radius: 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 18px;
}
.card + .card { margin-top: 12px; }
.card-lift { box-shadow: var(--shadow-md); border: none; }

/* ---------- Chips & badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--line-soft); color: var(--navy);
  white-space: nowrap;
}
.chip-cat { background: #EEF2FB; color: var(--royal); }
.chip-link { transition: background .15s, color .15s; }
.chip-link:hover { background: var(--royal); color: #fff; }
.chip.active { background: var(--navy); color: #fff; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .01em;
  white-space: nowrap;
}
.badge-green { background: #ECFDF5; color: #047857; }
.badge-gold { background: #FFFBEB; color: #B45309; }
.badge-blue { background: #EFF6FF; color: var(--royal); }
.badge-red { background: #FEF2F2; color: #B91C1C; }
.badge-gray { background: var(--line-soft); color: var(--muted); }
.badge-verified { background: #ECFDF5; color: #047857; }

/* ---------- Progress (the hope arc) ---------- */
.progress {
  height: 8px; border-radius: 999px; background: var(--line-soft);
  overflow: hidden; margin: 10px 0 8px;
}
.progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-600));
  min-width: 6px;
  transition: width .6s cubic-bezier(.22, 1, .36, 1);
}
.progress-navy .progress-fill { background: linear-gradient(90deg, var(--royal), var(--navy-800)); }

/* ---------- Case cards ---------- */
.case-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.case-card {
  background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: transform .18s, box-shadow .18s;
}
.case-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.case-card-media { aspect-ratio: 16 / 9; background: var(--line-soft); position: relative; }
.case-card-media img { width: 100%; height: 100%; object-fit: cover; }
.media-fallback {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 140% at 85% 10%, hsl(var(--fh, 210) 55% 88%) 0%, transparent 55%),
    linear-gradient(135deg, #16295C 0%, #0D1B3D 70%);
}
.media-fallback .media-emoji { font-size: 44px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }
.case-card-body { padding: 14px 16px 16px; }
.case-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.case-card-title { font-size: 15.5px; margin: 0 0 4px; letter-spacing: -.01em; }
.case-card-title a { color: var(--navy); }
.case-card-meta {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted); margin: 0;
}
.dot-sep { margin: 0 2px; color: var(--line); }
.case-card-amounts { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; }
.case-card-amounts strong { font-size: 14.5px; color: var(--navy); }

/* Horizontal scroller (urgent cases, categories) */
.hscroll {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px 12px;
  margin: 0 -16px; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex-shrink: 0; }
.hscroll .case-card { width: 290px; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row .chip { flex-shrink: 0; padding: 8px 14px; font-size: 13px; }

/* ---------- Search ---------- */
.searchbar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 14px;
  box-shadow: var(--shadow-sm); color: var(--muted);
}
.searchbar input {
  border: none; outline: none; flex: 1; font-size: 14.5px;
  font-family: inherit; background: transparent; color: var(--ink); min-width: 0;
}

/* ---------- Hero (home) ---------- */
.hero-card {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl); padding: 26px 22px;
  background:
    radial-gradient(130% 160% at 100% 0%, rgba(245, 158, 11, .28) 0%, transparent 45%),
    linear-gradient(140deg, var(--royal) 0%, var(--navy) 65%);
  color: #fff; box-shadow: var(--shadow-lg);
}
.hero-card h1, .hero-card h2 { color: #fff; font-family: var(--font-display); font-weight: 600; letter-spacing: 0; }
.hero-card p { color: rgba(255, 255, 255, .82); }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 10px;
}
.hero-arc {
  position: absolute; right: -70px; top: -70px; width: 230px; height: 230px;
  border-radius: 50%; border: 34px solid rgba(245, 158, 11, .16);
  pointer-events: none;
}

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow-sm);
}
.stat-tile .stat-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 8px;
}
.stat-value { font-size: 20px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.tint-blue { background: #EFF6FF; color: var(--royal); }
.tint-gold { background: #FFFBEB; color: var(--gold-600); }
.tint-green { background: #ECFDF5; color: #047857; }
.tint-navy { background: #EDF0F7; color: var(--navy); }
.tint-red { background: #FEF2F2; color: #B91C1C; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { outline: none; border-color: var(--royal); box-shadow: 0 0 0 4px rgba(30, 58, 138, .1); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

/* ---------- Custom select (JS-enhanced native <select>) ---------- */
.custom-select { position: relative; }
/* Keep the native <select> in the DOM (form submit + required validation) but hidden. */
.cs-native { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cs-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; font-family: inherit; font-size: 15px; text-align: left; cursor: pointer;
  background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s;
}
.cs-trigger:hover { border-color: #CBD5E1; }
.custom-select.open > .cs-trigger,
.cs-trigger:focus-visible { outline: none; border-color: var(--royal); box-shadow: 0 0 0 4px rgba(30, 58, 138, .1); }
.custom-select.cs-invalid > .cs-trigger { border-color: #DC2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, .1); }
.cs-trigger .cs-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-trigger .cs-caret { flex-shrink: 0; color: var(--muted); transition: transform .2s; }
.custom-select.open > .cs-trigger .cs-caret { transform: rotate(180deg); }

.cs-menu {
  position: absolute; z-index: 60; left: 0; top: calc(100% + 6px);
  min-width: 100%; width: max-content; max-width: min(86vw, 340px);
  margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); max-height: min(320px, 60vh); overflow-y: auto;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  -webkit-overflow-scrolling: touch;
}
.custom-select.cs-right > .cs-menu { left: auto; right: 0; }
.custom-select.open > .cs-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.custom-select.cs-up > .cs-menu { top: auto; bottom: calc(100% + 6px); transform: translateY(6px); }
.custom-select.cs-up.open > .cs-menu { transform: translateY(0); }

.cs-option {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--r-sm);
  font-size: 14.5px; color: var(--ink); cursor: pointer; line-height: 1.35; user-select: none;
  white-space: nowrap;
}
.cs-option.cs-active { background: var(--line-soft); }
.cs-option[aria-selected="true"] { color: var(--royal); font-weight: 600; }
.cs-option .cs-check { margin-left: auto; flex-shrink: 0; color: var(--royal); opacity: 0; }
.cs-option[aria-selected="true"] .cs-check { opacity: 1; }
@media (min-width: 920px) { .cs-option { padding: 9px 11px; } }
.form-error { font-size: 13px; color: #B91C1C; margin-top: 5px; }
.form-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.form-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--royal); }
.input-group { position: relative; }
.input-group .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-group .form-control { padding-left: 42px; }

/* Amount chips (donation) */
.amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.amount-chip {
  padding: 14px 8px; text-align: center; border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 15px; color: var(--navy); cursor: pointer;
  transition: all .15s;
}
.amount-chip:hover { border-color: var(--gold); }
.amount-chip.selected { border-color: var(--gold); background: #FFFBEB; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }

/* Segmented control */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--line-soft); border-radius: var(--r-md); padding: 4px; }
.segmented .seg {
  padding: 10px; text-align: center; font-size: 13.5px; font-weight: 700;
  border-radius: 10px; color: var(--muted); cursor: pointer; border: none; background: transparent;
  transition: all .15s;
}
.segmented .seg.active { background: var(--surface); color: var(--navy); box-shadow: var(--shadow-sm); }

/* Payment method radio cards */
.method-list { display: flex; flex-direction: column; gap: 10px; }
.method-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer; transition: all .15s;
}
.method-card:hover { border-color: var(--royal); }
.method-card.selected { border-color: var(--royal); background: #F7F9FE; box-shadow: 0 0 0 3px rgba(30, 58, 138, .1); }
.method-card input { accent-color: var(--royal); width: 18px; height: 18px; }
.method-icon { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.method-title { font-weight: 700; font-size: 14.5px; color: var(--navy); }
.method-sub { font-size: 12.5px; color: var(--muted); }
.method-detail {
  border: 1.5px dashed var(--line); border-radius: var(--r-md);
  background: #FBFCFE; padding: 16px; margin-top: 10px; font-size: 14px;
}
.method-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.method-detail dt { color: var(--muted); font-size: 13px; }
.method-detail dd { margin: 0; font-weight: 600; color: var(--navy); }
.qr-placeholder {
  width: 170px; height: 170px; margin: 10px auto;
  border: 2px dashed var(--line); border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--muted); font-size: 12px; background: #fff;
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line-soft); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .tab-btn {
  padding: 11px 14px; font-size: 14px; font-weight: 600; color: var(--muted);
  border: none; background: none; cursor: pointer; white-space: nowrap;
  border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; transition: color .15s;
}
.tabs .tab-btn:hover { color: var(--navy); }
.tabs .tab-btn.active { color: var(--navy); border-bottom-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .25s ease; }

/* Pill filter tabs (inbox) */
.pill-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.pill-tabs::-webkit-scrollbar { display: none; }
.pill-tabs .pill {
  padding: 8px 15px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap; cursor: pointer;
}
.pill-tabs .pill.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Case detail ---------- */
.case-hero { position: relative; margin: -16px -16px 0; }
.case-hero .carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4 / 3; background: var(--navy); }
.case-hero .carousel::-webkit-scrollbar { display: none; }
.case-hero .carousel > * { flex: 0 0 100%; scroll-snap-align: center; }
.case-hero .carousel img { width: 100%; height: 100%; object-fit: cover; }
.case-hero .media-fallback { aspect-ratio: auto; height: 100%; width: 100%; display: flex; }
.case-hero-back {
  position: absolute; top: 14px; left: 14px; z-index: 5;
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255, 255, 255, .92); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}
.case-hero-actions { position: absolute; top: 14px; right: 14px; z-index: 5; display: flex; gap: 8px; }
.case-hero-actions .iconbtn { background: rgba(255, 255, 255, .92); box-shadow: var(--shadow-md); }
.case-hero-actions .iconbtn.saved { color: var(--gold-600); }
.carousel-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.carousel-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.5); }
.carousel-dots span.active { background: #fff; width: 18px; border-radius: 4px; }

.case-sheet {
  position: relative; z-index: 4; margin-top: -22px;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 22px 18px 10px; box-shadow: 0 -8px 30px rgba(13, 27, 61, .08);
}
.case-title { font-size: 21px; letter-spacing: -.015em; margin-bottom: 8px; }
.org-row {
  display: flex; align-items: center; gap: 11px;
  padding: 12px; border: 1px solid var(--line-soft); border-radius: var(--r-md);
  background: #FBFCFE; margin: 14px 0;
}
.org-row .org-name { font-weight: 700; font-size: 14px; color: var(--navy); }
.org-row .org-sub { font-size: 12px; color: var(--muted); }
.meta-list { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--muted); margin: 10px 0; }
.meta-list span { display: inline-flex; align-items: center; gap: 5px; }

.raise-panel { padding: 16px; border-radius: var(--r-md); background: #FBFCFE; border: 1px solid var(--line-soft); margin: 14px 0; }
/* Case-detail two-column: mobile stacks with the donate card on top */
.detail-cols { display: flex; flex-direction: column; }
.detail-side { order: -1; }
.detail-actions { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; }
.raise-amounts { display: flex; justify-content: space-between; align-items: baseline; }
.raise-amounts .big { font-size: 24px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; }
.raise-sub { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* Sticky donate bar */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: var(--tabbar-h); z-index: 45;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0));
  background: linear-gradient(to top, rgba(248, 250, 252, .97) 70%, transparent);
  pointer-events: none;
}
.sticky-cta-inner { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; pointer-events: auto; }
.sticky-cta .btn { flex: 1; }

/* Needs list */
.need-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px;
}
.need-row:last-child { border-bottom: none; }
.need-row .need-amount { font-weight: 700; color: var(--navy); white-space: nowrap; }
.need-row.fulfilled { color: var(--muted); }
.need-row.fulfilled .need-check { color: var(--green); }

/* Timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 4px; }
.timeline-item::before {
  content: ''; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--gold); border: 3px solid #FFFBEB;
}
.timeline-item .tl-date { font-size: 12px; color: var(--muted); font-weight: 600; }
.timeline-item .tl-title { font-weight: 700; font-size: 14.5px; color: var(--navy); margin: 2px 0 4px; }
.timeline-item .tl-body { font-size: 14px; color: #374151; margin: 0; }
.timeline-item img { border-radius: var(--r-sm); margin-top: 8px; }

/* Documents */
.doc-row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid var(--line-soft); border-radius: var(--r-md);
  margin-bottom: 8px; background: var(--surface); font-size: 14px;
}
.doc-row .doc-icon { width: 38px; height: 38px; border-radius: 10px; background: #EFF6FF; color: var(--royal); display: flex; align-items: center; justify-content: center; }

/* ---------- Messages ---------- */
.conv-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); margin-bottom: 8px; transition: box-shadow .15s;
}
.conv-item:hover { box-shadow: var(--shadow-md); }
.conv-body { flex: 1; min-width: 0; }
.conv-title { font-weight: 700; font-size: 14px; color: var(--navy); display: flex; justify-content: space-between; gap: 8px; }
.conv-title time { font-size: 11.5px; color: var(--muted); font-weight: 500; flex-shrink: 0; }
.conv-preview { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.conv-item.unread .conv-preview { color: var(--ink); font-weight: 600; }
.conv-unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }

.chat-screen { display: flex; flex-direction: column; min-height: calc(100vh - var(--appbar-h) - var(--tabbar-h) - 40px); }
.chat-messages { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 8px 0 16px; }
.msg { max-width: 82%; padding: 10px 14px; font-size: 14.5px; line-height: 1.45; position: relative; }
.msg-in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px 16px 16px 5px; box-shadow: var(--shadow-sm); }
.msg-out { align-self: flex-end; background: var(--royal); color: #fff; border-radius: 16px 16px 5px 16px; }
.msg-out a { color: #fff; text-decoration: underline; }
.msg-sys { align-self: center; max-width: 92%; background: #FFFBEB; border: 1px solid #FDE68A; color: #78350F; border-radius: 14px; font-size: 13.5px; text-align: center; }
.msg-time { display: block; font-size: 10.5px; opacity: .65; margin-top: 3px; }
.msg img { border-radius: 10px; margin-top: 6px; max-height: 240px; }
.msg-sender { font-size: 11px; font-weight: 700; color: var(--gold-600); margin-bottom: 2px; }
.chat-day { align-self: center; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--line-soft); padding: 4px 12px; border-radius: 999px; margin: 10px 0 6px; }

.chat-composer {
  position: fixed; left: 0; right: 0; bottom: var(--tabbar-h); z-index: 45;
  background: var(--surface); border-top: 1px solid var(--line-soft);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0));
}
.chat-composer-inner { max-width: 560px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; }
.chat-composer textarea {
  flex: 1; border: 1.5px solid var(--line); border-radius: 20px;
  padding: 10px 16px; font-size: 14.5px; font-family: inherit; resize: none;
  max-height: 110px; min-height: 42px; line-height: 1.4; outline: none;
}
.chat-composer textarea:focus { border-color: var(--royal); }
.composer-send {
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--royal); color: #fff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s;
}
.composer-send:hover { background: var(--royal-600); }

/* ---------- Lists / menu ---------- */
.menu-list { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.menu-item {
  display: flex; align-items: center; gap: 13px; padding: 15px 16px;
  border-bottom: 1px solid var(--line-soft); color: var(--ink); font-size: 14.5px; font-weight: 600;
  transition: background .12s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: #FBFCFE; }
.menu-item .mi-icon {
  width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: #EDF0F7; color: var(--navy); flex-shrink: 0;
}
.menu-item .chev { margin-left: auto; color: var(--muted); }
.menu-item.danger { color: #B91C1C; }
.menu-item.danger .mi-icon { background: #FEF2F2; color: #B91C1C; }

/* ---------- Badges & certificates ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge-tile {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: 14px 8px; text-align: center; box-shadow: var(--shadow-sm);
}
.badge-tile .b-emoji { font-size: 30px; line-height: 1; display: block; margin-bottom: 6px; }
.badge-tile .b-name { font-size: 11.5px; font-weight: 700; color: var(--navy); line-height: 1.25; }
.badge-tile .b-level { font-size: 10.5px; color: var(--gold-600); font-weight: 700; margin-top: 3px; }
.badge-tile.locked { opacity: .45; filter: grayscale(1); }
.level-stars { color: var(--gold); letter-spacing: 1px; }

.cert-card {
  border: 1px solid var(--line-soft); border-radius: var(--r-lg); background: var(--surface);
  padding: 16px; display: flex; gap: 14px; align-items: center; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.cert-thumb {
  width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7); border: 1px solid #FDE68A;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}

/* ---------- Flash & toast ---------- */
.flash-stack { max-width: 560px; margin: 12px auto 0; padding: 0 16px; }
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 15px; border-radius: var(--r-md); font-size: 14px; font-weight: 500;
  margin-bottom: 8px; animation: fadeUp .3s ease;
}
.flash-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.flash-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.flash-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.toast {
  position: fixed; bottom: calc(var(--tabbar-h) + 16px); left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 100;
  animation: fadeUp .25s ease; max-width: 90vw; text-align: center;
}

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state .empty-icon {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--line-soft); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.empty-state h2, .empty-state h3 { font-size: 17px; }
.empty-state p { font-size: 14px; color: var(--muted); max-width: 300px; margin: 0 auto 16px; }

/* ---------- Auth screens ---------- */
.auth-wrap { max-width: 420px; margin: 0 auto; padding: 28px 0 10px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; text-align: center; }
.auth-card { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-md); padding: 26px 22px; border: 1px solid var(--line-soft); }
.auth-alt { text-align: center; font-size: 14px; margin-top: 18px; color: var(--muted); }
.role-select { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card {
  padding: 14px 10px; border: 1.5px solid var(--line); border-radius: var(--r-md);
  text-align: center; cursor: pointer; transition: all .15s; background: var(--surface);
}
.role-card .r-icon { width: 38px; height: 38px; margin: 0 auto 6px; border-radius: 10px; background: #EDF0F7; color: var(--navy); display: flex; align-items: center; justify-content: center; }
.role-card .r-name { font-weight: 700; font-size: 13.5px; color: var(--navy); }
.role-card .r-sub { font-size: 11.5px; color: var(--muted); }
.role-card.selected { border-color: var(--royal); background: #F7F9FE; box-shadow: 0 0 0 3px rgba(30, 58, 138, .1); }

/* ---------- Landing ---------- */
.landing-hero {
  position: relative; overflow: hidden; margin: -16px -16px 0; padding: 32px 22px 40px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(245, 158, 11, .22) 0%, transparent 50%),
    radial-gradient(100% 100% at 0% 100%, rgba(30, 58, 138, .5) 0%, transparent 55%),
    linear-gradient(155deg, var(--navy-800) 0%, var(--navy) 75%);
  color: #fff; text-align: center;
}
.landing-hero .hero-arc { right: -90px; top: -90px; width: 300px; height: 300px; }
.landing-hero h1 {
  font-family: var(--font-display); font-weight: 600; color: #fff;
  font-size: clamp(28px, 6.6vw, 44px); line-height: 1.15; letter-spacing: -.01em; margin: 10px 0 10px;
}
.landing-hero h1 em { font-style: italic; color: var(--gold); }
.landing-hero .lead { font-size: 15px; color: rgba(255, 255, 255, .85); max-width: 430px; margin: 0 auto 18px; }
.landing-cta { display: flex; flex-direction: column; gap: 10px; max-width: 340px; margin: 0 auto; }
.landing-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft);
  border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-soft);
  margin: -34px 0 8px; position: relative; z-index: 5; box-shadow: var(--shadow-md);
}
.landing-stats .ls-cell { background: var(--surface); padding: 16px 12px; text-align: center; }
.landing-stats .ls-num { font-size: 21px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; }
.landing-stats .ls-num span { color: var(--gold-600); }
.landing-stats .ls-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.feature-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 16px 14px; box-shadow: var(--shadow-sm); }
.feature-card .f-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.feature-card h3 { font-size: 14px; margin-bottom: 3px; }
.feature-card p { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.45; }
.trust-rail { display: flex; flex-direction: column; gap: 16px; padding: 18px; }
.trust-item { display: flex; gap: 12px; align-items: flex-start; }
.trust-item .f-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.trust-item strong { display: block; font-size: 14px; color: var(--navy); margin-bottom: 2px; }
.trust-item p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

.step-row { display: flex; gap: 14px; padding: 12px 0; }
.step-num {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--navy); color: var(--gold); font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.step-row h3 { font-size: 14.5px; margin-bottom: 2px; }
.step-row p { font-size: 13.5px; color: var(--muted); margin: 0; }

.partner-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.partner-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 700; color: var(--navy);
}

.cta-band {
  border-radius: var(--r-xl); padding: 28px 22px; text-align: center; color: #fff;
  background: radial-gradient(120% 150% at 80% 0%, rgba(245,158,11,.3) 0%, transparent 50%), linear-gradient(140deg, var(--royal), var(--navy));
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.cta-band p { color: rgba(255,255,255,.82); font-size: 14px; }

/* ---------- Site footer (desktop) ---------- */
.site-footer { display: none; }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.animate-in { animation: fadeUp .35s ease both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   Desktop ≥ 920px — shell widens, tab bar becomes top nav
   ============================================================ */
@media (min-width: 920px) {
  body { font-size: 15.5px; }
  .app-main, .container, .appbar-inner, .tabbar-inner, .sticky-cta-inner, .chat-composer-inner, .flash-stack { max-width: 1280px; }
  .app-main { padding: 24px 32px 60px; }
  .container, .appbar-inner { padding-left: 32px; padding-right: 32px; }
  .tabbar { display: none; }
  :root { --tabbar-h: 0px; }
  .appbar-nav { display: flex; gap: 2px; margin-left: 20px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .appbar-nav::-webkit-scrollbar { display: none; }
  .appbar-nav a {
    padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted);
    display: inline-flex; align-items: center; gap: 7px; transition: all .15s;
    white-space: nowrap; flex-shrink: 0;
  }
  .appbar-nav a:hover { color: var(--navy); background: var(--line-soft); }
  .appbar-nav a.active { color: var(--navy); background: #FFFBEB; }
  .brand { font-size: 17px; }

  .case-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .case-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .landing-stats { grid-template-columns: repeat(4, 1fr); margin-top: -40px; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .badge-grid { grid-template-columns: repeat(6, 1fr); }
  .hscroll { margin: 0 -32px; padding-left: 32px; padding-right: 32px; }
  .chip-row { margin: 0 -32px; padding-left: 32px; padding-right: 32px; }
  .hscroll .case-card { width: 320px; }
  .hero-card { padding: 42px 40px; }
  .landing-hero { margin: -24px -32px 0; padding: 90px 32px 96px; }
  .landing-cta { flex-direction: row; max-width: 560px; }
  .landing-cta .btn { flex: 1; }
  .case-hero { margin: -24px -32px 0; border-radius: 0 0 24px 24px; overflow: hidden; }
  .case-hero .carousel { aspect-ratio: 21 / 9; }
  .case-sheet { margin: -26px auto 0; border-radius: 24px; max-width: 1120px; padding: 34px 40px 22px; }
  .detail-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; }
  .detail-main { min-width: 0; }
  .detail-side {
    order: 0; position: sticky; top: calc(var(--appbar-h) + 20px);
    background: #fff; border: 1px solid var(--line-soft); border-radius: 18px;
    padding: 6px 18px 18px; box-shadow: 0 6px 24px rgba(13, 27, 61, .06);
  }
  .detail-side .raise-panel { border: none; background: transparent; padding: 12px 2px 0; margin: 4px 0; }

  /* Landing "How it works": 2x2 grid fills the width instead of a narrow list */
  .steps-card { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 44px; padding: 24px 30px; }
  .step-row { padding: 14px 0; }

  /* Single-column forms/reading stay a comfortable width, not stretched to 1280 */
  .form-narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
  .legal-doc { max-width: 780px; margin-left: auto; margin-right: auto; }

  /* Donate page: form on the left, sticky trust/summary rail on the right */
  .donate-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; }
  .donate-side { position: sticky; top: calc(var(--appbar-h) + 20px); display: flex; flex-direction: column; gap: 14px; }

  /* Volunteer missions: two columns so descriptions keep a readable line length */
  .vol-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  .sticky-cta { display: none; }
  .auth-wrap { padding-top: 60px; }
  .two-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: start; }

  .site-footer {
    display: block; background: var(--navy); color: rgba(255, 255, 255, .75);
    padding: 40px 0 30px; margin-top: 40px; font-size: 13.5px;
  }
  .site-footer .container { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
  .site-footer h4 { color: #fff; font-size: 14px; margin-bottom: 10px; }
  .site-footer a { color: rgba(255, 255, 255, .75); display: block; padding: 3px 0; }
  .site-footer a:hover { color: var(--gold); }
  .footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 26px; padding-top: 18px; font-size: 12.5px; color: rgba(255,255,255,.5); }
}

@media (min-width: 920px) {
  .chat-composer { position: sticky; bottom: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); }
}

/* ---------- Print (certificates, reports) ---------- */
@media print {
  .appbar, .tabbar, .sticky-cta, .chat-composer, .no-print, .site-footer, .flash-stack { display: none !important; }
  body { background: #fff; }
  .app-main { padding: 0; max-width: none; }
}

/* ============ i18n: language switcher + script-aware fonts ============ */
.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 10px; border-radius: 999px; color: var(--navy); font-weight: 600; font-size: 12.5px;
  border: 1px solid var(--line-soft, #e5e7eb); background: #fff;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu[open] summary { border-color: var(--gold-600, #b45309); }
.lang-menu .lang-code { letter-spacing: .04em; }
.lang-menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 150px;
  background: #fff; border: 1px solid var(--line-soft, #e5e7eb); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(13, 27, 61, .14); padding: 6px; display: grid;
}
.lang-menu-list a {
  padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--navy);
}
.lang-menu-list a:hover { background: #f3f4f6; text-decoration: none; }
.lang-menu-list a.active { background: #f5efe2; color: var(--gold-600, #b45309); font-weight: 700; }

/* Thai / Burmese get dedicated fonts (loaded in header.php only for that locale). */
html[lang="th"] body { font-family: 'Noto Sans Thai', 'Inter', system-ui, sans-serif; }
html[lang="my"] body { font-family: 'Noto Sans Myanmar', 'Inter', system-ui, sans-serif; line-height: 1.75; }
html[lang="th"] h1, html[lang="th"] h2, html[lang="th"] h3,
html[lang="my"] h1, html[lang="my"] h2, html[lang="my"] h3 { font-family: inherit; }

/* ============================================================
   Script-aware typography — Thai / Myanmar / Chinese
   ============================================================ */
:root:lang(th) {
  --font-body: 'Noto Sans Thai', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Noto Sans Thai', Georgia, serif;
}
:root:lang(my) {
  --font-body: 'Noto Sans Myanmar', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Noto Sans Myanmar', Georgia, serif;
}
:root:lang(zh) {
  --font-body: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-display: 'Songti SC', Georgia, serif;
}

/* Myanmar stacks marks above and below the baseline — give lines room. */
:lang(my) body { line-height: 1.85; }
:lang(my) h1, :lang(my) h2, :lang(my) h3, :lang(my) h4 { line-height: 1.5; }
:lang(my) .appbar-nav a { font-size: 13px; }

/* Navigation labels must never wrap into stacked lines. */
.brand small { white-space: nowrap; }
.tab span, .tab-give-wrap span {
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 3px; line-height: 1.4;
}
.lang-menu-list a { line-height: 1.7; white-space: nowrap; }

/* Flag icons in the language switcher */
.lang-flag { font-size: 17px; line-height: 1; display: inline-block; }
.lang-menu-list .lang-flag { margin-right: 8px; font-size: 16px; }
