:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --text: #17212b;
  --muted: #5b6b7a;
  --border: #dde3e9;
  --primary: #0a7d4f;
  --primary-soft: #e2f3ea;
  --accent: #f5a623;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.06);
  --radius: 14px;
}

html[data-theme="dark"] {
  --bg: #0e141b;
  --surface: #18212b;
  --surface-2: #1f2a36;
  --text: #e8eef3;
  --muted: #94a6b5;
  --border: #2a3844;
  --primary: #2ecc85;
  --primary-soft: #12301f;
  --accent: #f5a623;
  --danger: #ff6b61;
  --danger-soft: #2a1512;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-size-adjust: 100%;
}
.container { width: min(100% - 2rem, 1080px); margin-inline: auto; }
.container.narrow { max-width: 720px; }
h1 { font-size: 1.6rem; margin: 1.2rem 0 .5rem; }
h2 { font-size: 1.15rem; }
.muted { color: var(--muted); font-size: .92rem; }
a { color: var(--primary); }
button { font-family: inherit; }

/* ---------- header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.25rem; }
.brand-text span { color: var(--primary); }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px;
  background: var(--primary); color: #fff; border-radius: 10px; font-weight: 800;
}
.theme-toggle {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 999px; padding: .45rem .7rem; cursor: pointer; font-size: 1rem;
}
html[data-theme="dark"] .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: none; }

.main-nav { display: flex; gap: .4rem; padding-bottom: .6rem; overflow-x: auto; }
.nav-link {
  border: 1px solid transparent; background: none; color: var(--muted);
  padding: .45rem .8rem; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: .92rem; white-space: nowrap;
}
.nav-link.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.badge { background: var(--accent); color: #000; border-radius: 999px; padding: 0 .45rem; font-size: .75rem; }

/* ---------- warning banner ---------- */
.warning-banner {
  background: var(--danger-soft); color: var(--danger);
  border-bottom: 1px solid var(--danger);
  padding: .6rem 1rem; font-size: .85rem; text-align: center; font-weight: 500;
}
.warning-banner a { color: inherit; font-weight: 700; }

/* ---------- hero + search ---------- */
.hero { text-align: center; padding: 1.6rem 0 .4rem; }
.hero h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); margin: 0 0 .4rem; }
.hero .accent { color: var(--primary); }
.hero-sub { color: var(--muted); max-width: 560px; margin: 0 auto; font-size: .95rem; }

.search-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem; margin: 1.2rem 0;
}
.search-row { display: flex; flex-direction: column; gap: .6rem; }
.search-row input, .search-row select, .upload-card input {
  width: 100%; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--text); font-size: 1rem;
}
.search-row input:focus, .search-row select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.chip-row { display: flex; gap: .45rem; overflow-x: auto; padding: .7rem 0 .2rem; }
.chip {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 999px; padding: .4rem .85rem; font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.results-meta { color: var(--muted); font-size: .85rem; margin-top: .5rem; }

.section-title { margin: 1.8rem 0 .8rem; font-size: 1.2rem; }

/* ---------- job cards ---------- */
.job-grid { display: grid; grid-template-columns: 1fr; gap: .8rem; margin-bottom: 2rem; }
.job-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow); cursor: pointer; position: relative;
  transition: transform .12s ease, border-color .12s ease;
  display: flex; flex-direction: column; gap: .35rem;
}
.job-card:active { transform: scale(.985); }
.job-card:hover { border-color: var(--primary); }
.job-card.featured { border-color: var(--accent); background: linear-gradient(0deg, var(--surface), var(--surface)); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.job-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.job-title { font-size: 1.02rem; font-weight: 700; margin: 0; }
.company { color: var(--primary); font-weight: 600; font-size: .9rem; }
.save-btn {
  background: none; border: none; font-size: 1.25rem; cursor: pointer; line-height: 1; padding: .15rem;
}
.job-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .15rem; }
.tag {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  font-size: .74rem; font-weight: 600; padding: .18rem .55rem; border-radius: 999px;
}
.tag.cat-Casual { background: #fff7e0; color: #8a6100; border-color: #eeddab; }
.tag.cat-Corporate { background: #e7f0ff; color: #1d4fa1; border-color: #c3d7f7; }
.tag.cat-Government { background: #eafbea; color: #176b1c; border-color: #bfe6bf; }
.tag.cat-NGO { background: #f6ecff; color: #6b2fa0; border-color: #ddc2f2; }
.tag.cat-Internship { background: #e6fbfa; color: #0b6d68; border-color: #b5ecea; }
html[data-theme="dark"] .tag { filter: brightness(.85); color: var(--text); }
.featured-badge {
  position: absolute; top: -9px; right: 12px; background: var(--accent); color: #000;
  font-size: .68rem; font-weight: 800; padding: .15rem .55rem; border-radius: 999px;
}
.salary { font-weight: 700; color: var(--primary); font-size: .9rem; }
.posted { color: var(--muted); font-size: .78rem; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-emoji { font-size: 2.4rem; margin: 0; }

/* ---------- featured strip ---------- */
.featured-strip { margin-top: 1rem; }

/* ---------- affiliate ---------- */
.affiliate-grid { display: grid; grid-template-columns: 1fr; gap: .8rem; }
.affiliate-card {
  display: flex; gap: .8rem; align-items: center; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .9rem 1rem; box-shadow: var(--shadow);
}
.affiliate-card .emoji { font-size: 1.6rem; }
.affiliate-card strong { display: block; font-size: .95rem; }
.affiliate-card .muted { font-size: .8rem; }

/* ---------- social ---------- */
.social-cards { display: grid; grid-template-columns: 1fr; gap: .8rem; margin-bottom: 2.5rem; }
.social-card {
  display: flex; flex-direction: column; gap: .15rem; text-decoration: none; color: var(--text);
  border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); border: 1px solid var(--border);
  background: var(--surface);
}
.social-card.whatsapp { border-left: 5px solid #25d366; }
.social-card.facebook { border-left: 5px solid #1877f2; }

/* ---------- uploads / profile ---------- */
.upload-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.1rem; margin: 1rem 0;
}
.upload-card h2 { margin-top: 0; }
.upload-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.photo-preview { width: 96px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.upload-controls { display: flex; gap: .6rem; flex-wrap: wrap; }
.resume-info { font-size: .92rem; }
.hint { color: var(--muted); font-size: .8rem; margin-bottom: 0; }
.upload-card input[type="text"], .upload-card input[type="tel"] { margin-bottom: .6rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border-radius: 10px; padding: .7rem 1.2rem; font-weight: 700;
  font-size: .92rem; cursor: pointer; text-decoration: none; text-align: center; border: 1px solid transparent;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.secondary { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.btn.ghost { background: none; color: var(--muted); border-color: var(--border); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); margin: 1.5rem 0 3rem; }
.file-label { cursor: pointer; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--surface); color: var(--text); width: min(100%, 680px);
  max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0;
  padding: 1.4rem 1.2rem 2rem; position: relative; animation: slideUp .18s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-close {
  position: sticky; top: 0; float: right; border: none; background: var(--surface-2); color: var(--text);
  width: 34px; height: 34px; border-radius: 999px; cursor: pointer; font-size: .95rem;
}
.modal h2 { margin: .2rem 0 .1rem; padding-right: 2.5rem; font-size: 1.3rem; }
.modal .company { font-size: 1rem; }
.modal .job-meta { margin: .7rem 0 1rem; }
.modal-desc { white-space: pre-line; font-size: .95rem; }
.modal-actions { display: flex; gap: .7rem; margin-top: 1.4rem; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; min-width: 140px; }
.pay-warning {
  background: var(--danger-soft); color: var(--danger); border-radius: 10px;
  padding: .7rem .9rem; font-size: .82rem; font-weight: 600; margin-top: 1rem;
}
.source-note { color: var(--muted); font-size: .78rem; margin-top: 1rem; }

/* ---------- pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1.2rem 0; }
.price-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.2rem; position: relative; display: flex; flex-direction: column; gap: .6rem;
}
.price-card.featured-price { border: 2px solid var(--accent); }
.price-card .ribbon {
  position: absolute; top: -10px; left: 14px; background: var(--accent); color: #000;
  font-size: .68rem; font-weight: 800; padding: .15rem .6rem; border-radius: 999px;
}
.price-card h3 { margin: 0; }
.price { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin: 0; }
.price-card ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: .88rem; }
.price-card .btn { margin-top: auto; }
.trust-note {
  background: var(--primary-soft); color: var(--primary); border-radius: 10px;
  padding: .8rem 1rem; font-size: .88rem; font-weight: 600; margin-bottom: 2.5rem;
}

/* ---------- float + footer ---------- */
.whatsapp-float {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  width: 54px; height: 54px; border-radius: 999px; background: #25d366;
  display: grid; place-items: center; font-size: 1.5rem; text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 1.4rem 0 5rem; font-size: .85rem; }

/* ---------- deadlines, closed jobs, share, forms ---------- */
.job-card.closed { opacity: .55; }
.job-card.closed .job-title { text-decoration: line-through; }
.closed-tag { background: #fdecea !important; color: #b3261e !important; border-color: #b3261e !important; }
.urgent-tag { background: #fff0d6 !important; color: #9a5b00 !important; border-color: #f5a623 !important; }
html[data-theme="dark"] .closed-tag { filter: none; }
.share-row { display: flex; gap: .6rem; margin-top: .7rem; flex-wrap: wrap; }
.share-row .btn { flex: 1; min-width: 150px; padding: .55rem .8rem; font-size: .85rem; }
.hero-cta { margin-top: .9rem; }
.employer-form-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.2rem; margin: 1.2rem 0;
}
.employer-form-card h2 { margin-top: 0; }
.employer-form-card input, .employer-form-card select, .employer-form-card textarea {
  width: 100%; padding: .8rem 1rem; margin-bottom: .7rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 1rem;
  font-family: inherit;
}
.employer-form-card textarea { resize: vertical; }
.btn.mpesa { background: #3fae49; color: #fff; border-color: #3fae49; font-weight: 600; }
.btn.mpesa:disabled { opacity: .6; }
.pay-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .75rem; }
.pay-status {
  margin-top: .6rem; padding: .7rem .9rem; border-radius: 10px; font-size: .92rem;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.pay-status.success { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.pay-status.error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.form-actions .btn { flex: 1; min-width: 160px; }
.legal-page { max-width: 760px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.legal-page h1 { margin-top: 0; }
.legal-page h2 { margin-top: 1.4rem; font-size: 1.05rem; }
.legal-page p, .legal-page li { font-size: .95rem; }
.legal-top { display: inline-block; margin-bottom: 1rem; }

/* ---------- stats, alerts, tracking, company filter ---------- */
.stats-bar { color: var(--muted); font-size: .85rem; margin: .8rem 0 0; }
.alert-row { display: flex; gap: .6rem; align-items: center; margin-top: .7rem; flex-wrap: wrap; }
.alert-btn.alert-on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.alert-banner {
  background: var(--primary-soft); border: 1px solid var(--primary); color: var(--primary);
  border-radius: var(--radius); padding: .8rem 1rem; margin: 1rem 0; font-size: .92rem;
  display: flex; gap: .7rem; align-items: center; flex-wrap: wrap;
}
.company-pill {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: .45rem .9rem; margin: 0 0 1rem; font-size: .9rem;
  display: inline-flex; gap: .5rem; align-items: center;
}
.pill-x { border: none; background: var(--surface-2); color: var(--text); width: 22px; height: 22px; border-radius: 999px; cursor: pointer; font-size: .7rem; }
.card-actions { display: flex; gap: .2rem; }
.new-badge {
  position: absolute; top: -9px; left: 12px; background: var(--primary); color: #fff;
  font-size: .68rem; font-weight: 800; padding: .15rem .55rem; border-radius: 999px;
}
button.company-link { background: none; border: none; padding: 0; cursor: pointer; font: inherit; color: var(--primary); text-align: left; width: fit-content; }
button.company-link:hover { text-decoration: underline; }
.status-tag { font-weight: 700; }
.status-applied { background: var(--primary-soft) !important; color: var(--primary) !important; border-color: var(--primary) !important; }
.status-interviewing { background: #fff0d6 !important; color: #9a5b00 !important; border-color: var(--accent) !important; }
.track-row { display: flex; gap: .5rem; align-items: center; margin-top: .8rem; flex-wrap: wrap; }
.track-btn.track-on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.similar-title { margin-top: 1.6rem; font-size: 1.05rem; }
.similar-grid { grid-template-columns: 1fr !important; }
mark { background: #ffe89a; color: inherit; border-radius: 3px; padding: 0 1px; }
html[data-theme="dark"] mark { background: #6b5410; color: var(--text); }
.cv-cta { margin: 1rem 0; }
.ef-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.ef-row select, .ef-row input { flex: 1; min-width: 140px; padding: .8rem 1rem; margin-bottom: .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 1rem; font-family: inherit; }
.ef-row .btn { flex: 0 0 auto; margin-bottom: .7rem; }
#trackResult { padding: .7rem .9rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: .92rem; }

/* ---------- small screens up ---------- */
@media (min-width: 600px) {
  .search-row { flex-direction: row; }
  .search-row input { flex: 1; }
  .job-grid { grid-template-columns: repeat(2, 1fr); }
  .affiliate-grid { grid-template-columns: repeat(2, 1fr); }
  .social-cards { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 18px; padding-bottom: 1.6rem; }
  .site-footer { padding-bottom: 1.6rem; }
}
@media (min-width: 900px) {
  .job-grid { grid-template-columns: repeat(3, 1fr); }
  .affiliate-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- install button ---------- */
.install-btn { margin-top: .6rem; }

/* ---------- closing soon strip ---------- */
.closing-soon { margin: 1rem 0 .4rem; }
.closing-title { font-size: 1rem; margin: 0 0 .5rem; }
.closing-strip {
  display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .4rem;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.closing-chip {
  flex: 0 0 auto; width: 240px; text-align: left; display: flex; flex-direction: column; gap: .25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .7rem .9rem; cursor: pointer; color: var(--text); font: inherit;
}
.closing-chip strong { font-size: .88rem; line-height: 1.3; }
.closing-chip span { font-size: .75rem; color: var(--muted); }
.closing-chip em { font-size: .78rem; color: var(--danger); font-style: normal; font-weight: 600; }
