:root {
  color-scheme: light;
  --teal: #2ec4b6;
  --teal-dark: #148f87;
  --coral: #ff6b6b;
  --ice: #f8fffe;
  --slate: #1a1a2e;
  --text: #1e293b;
  --muted: #64748b;
  --line: rgba(30, 41, 59, 0.1);
  --card: rgba(255, 255, 255, 0.9);
  --shadow-teal: 0 18px 45px rgba(46, 196, 182, 0.18);
  --shadow-coral: 0 16px 34px rgba(255, 107, 107, 0.28);
  --radius-lg: 24px;
  --radius-md: 18px;
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ice);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(46, 196, 182, 0.14), transparent 30rem),
    linear-gradient(180deg, #f8fffe 0%, #ffffff 48%, #eefbf8 100%);
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(128px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(248, 255, 254, 0.82);
  border-bottom: 1px solid rgba(46, 196, 182, 0.12);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--slate);
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--teal), #5adfcb);
  border-radius: 15px;
  box-shadow: var(--shadow-teal);
}

.icon-button,
.secondary-button,
.primary-cta {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.icon-button,
.secondary-button {
  color: var(--teal-dark);
  background: white;
  border: 1px solid rgba(46, 196, 182, 0.22);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.admin-access {
  color: var(--slate);
}

.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 22px;
  color: white;
  background: var(--coral);
  box-shadow: var(--shadow-coral);
}

.primary-cta:disabled {
  cursor: wait;
  opacity: 0.62;
  box-shadow: none;
}

.secondary-button {
  padding: 0 18px;
}

main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px clamp(16px, 4vw, 40px) 34px;
}

.view {
  display: none;
}

.view-active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: clamp(20px, 4vw, 42px);
  align-items: start;
  min-height: calc(100vh - 330px);
}

.hero-copy {
  padding-top: clamp(16px, 5vh, 52px);
}

.hero-copy h1,
.section-header h1 {
  margin: 10px 0 14px;
  color: var(--slate);
  font-size: clamp(2.35rem, 8vw, 4.35rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy p,
.section-header p,
.donation-panel p,
.certificate p,
.transparency-flow p {
  color: var(--muted);
  line-height: 1.65;
}

.eyebrow,
.section-kicker,
.ad-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: rgba(46, 196, 182, 0.13);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-visual {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  max-height: 660px;
  border-radius: 32px;
  background: #dff9f5;
  box-shadow: var(--shadow-teal);
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.impact-strip,
.stats-grid,
.project-grid,
.transparency-flow {
  display: grid;
  gap: 14px;
}

.impact-strip {
  grid-template-columns: repeat(3, 1fr);
  margin: 20px 0 16px;
}

.impact-strip article,
.stat-card,
.project-card,
.donation-panel,
.certificate,
.transparency-flow article {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 14px 38px rgba(46, 196, 182, 0.08);
  backdrop-filter: blur(12px);
}

.impact-strip article {
  padding: 18px;
  border-radius: 20px;
}

.impact-strip strong,
.stat-card strong {
  display: block;
  color: var(--coral);
  font-size: clamp(1.45rem, 6vw, 2.35rem);
  font-weight: 800;
}

.impact-strip span,
.stat-card span,
.impact-preview span,
.project-card p,
.timeline {
  color: var(--muted);
}

.donation-panel,
.certificate,
.install-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius-lg);
}

.donation-panel h2,
.certificate h2,
.install-nudge h2,
.transparency-flow h2 {
  margin: 8px 0 6px;
  color: var(--slate);
}

.install-nudge {
  margin: 18px 0 16px;
  border: 1px solid rgba(255, 107, 107, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 107, 107, 0.11), rgba(46, 196, 182, 0.13)),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 38px rgba(255, 107, 107, 0.1);
}

.install-nudge p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.install-actions,
.admin-actions,
.notification-status,
.notification-types {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.install-actions {
  justify-content: flex-end;
}

.impact-preview {
  display: flex;
  min-width: 190px;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: 20px;
  background: rgba(255, 107, 107, 0.1);
}

.impact-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: white;
  background: var(--coral);
  border-radius: 16px;
}

.section-header {
  max-width: 760px;
  padding: 18px 0 16px;
}

.section-header h1 {
  font-size: clamp(2.1rem, 8vw, 4rem);
}

.project-grid {
  grid-template-columns: repeat(3, 1fr);
}

.project-card {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
}

.project-card.selected {
  border-color: rgba(255, 107, 107, 0.55);
  box-shadow: 0 18px 42px rgba(255, 107, 107, 0.13);
}

.project-media {
  display: grid;
  min-height: 92px;
  place-items: center;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, var(--teal), var(--coral));
  font-size: 2rem;
}

.project-card h2 {
  margin: 0;
  color: var(--slate);
}

.meter {
  overflow: hidden;
  height: 10px;
  margin-top: auto;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.08);
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.stats-grid {
  grid-template-columns: repeat(3, 1fr);
}

.stat-card {
  padding: 22px;
  border-radius: var(--radius-lg);
}

.certificate {
  margin: 16px 0;
}

.timeline {
  display: grid;
  gap: 10px;
  padding: 0;
}

.timeline-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.transparency-flow {
  grid-template-columns: repeat(3, 1fr);
}

.transparency-flow article {
  padding: 20px;
  border-radius: var(--radius-lg);
}

.transparency-flow span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: white;
  background: var(--teal);
  border-radius: 18px;
}

.partner-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.partner-list span {
  padding: 10px 13px;
  border-radius: 999px;
  color: var(--slate);
  background: white;
  border: 1px solid var(--line);
  font-weight: 800;
}

.admin-view {
  padding-bottom: 20px;
}

.admin-heading {
  max-width: 900px;
}

.admin-tabs {
  position: sticky;
  top: 72px;
  z-index: 12;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 14px;
  background: linear-gradient(180deg, rgba(248, 255, 254, 0.96), rgba(248, 255, 254, 0.82));
  backdrop-filter: blur(14px);
}

.admin-tab {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(46, 196, 182, 0.2);
  border-radius: 999px;
  color: var(--teal-dark);
  background: white;
  cursor: pointer;
  font-weight: 800;
}

.admin-tab-active {
  color: white;
  background: var(--teal);
}

.admin-panel {
  display: none;
  gap: 16px;
}

.admin-panel-active {
  display: grid;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.admin-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 38px rgba(46, 196, 182, 0.08);
}

.admin-card h2 {
  margin: 0;
  color: var(--slate);
}

.admin-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-form label {
  display: grid;
  gap: 8px;
  color: var(--slate);
  font-weight: 800;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid rgba(30, 41, 59, 0.14);
  border-radius: 14px;
  color: var(--text);
  background: white;
  font: inherit;
}

.admin-form textarea {
  resize: vertical;
}

.toggle-row {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
}

.toggle-row input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--teal);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.status-list,
.permission-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-list span,
.status-pill,
.permission-item,
.notification-status span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: rgba(46, 196, 182, 0.12);
  font-weight: 800;
}

.notification-types {
  align-items: center;
}

.permission-item input {
  accent-color: var(--teal);
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.admin-list-item strong,
.admin-list-item span {
  display: block;
}

.admin-list-item span {
  color: var(--muted);
  font-size: 0.92rem;
}

.project-showcase {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  margin: 16px 0;
}

.embedded-media {
  display: grid;
  overflow: hidden;
  min-height: 220px;
  place-items: center;
  border: 1px dashed rgba(46, 196, 182, 0.38);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(46, 196, 182, 0.07);
  text-align: center;
}

.embedded-media img,
.embedded-media iframe {
  width: 100%;
  height: 100%;
  min-height: 260px;
  border: 0;
  object-fit: cover;
}

.bottom-nav {
  position: fixed;
  right: clamp(12px, 3vw, 24px);
  bottom: calc(58px + env(safe-area-inset-bottom));
  left: clamp(12px, 3vw, 24px);
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-width: 680px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid rgba(46, 196, 182, 0.18);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 50px rgba(26, 26, 46, 0.13);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: grid;
  min-width: 0;
  min-height: 58px;
  place-items: center;
  border: 0;
  border-radius: 18px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.nav-item small {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-active {
  color: white;
  background: var(--teal);
}

.admin-mode .bottom-nav {
  display: none;
}

.admin-mode .app-shell {
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

.sponsor-banner {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 35;
  display: flex;
  min-height: calc(50px + env(safe-area-inset-bottom));
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  color: white;
  background: #1a1a2e;
  text-align: center;
}

.ad-slot-banner {
  display: flex;
  width: min(760px, 100%);
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.sponsor-banner .ad-label {
  flex: 0 0 auto;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.ad-dialog {
  width: min(460px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: transparent;
}

.ad-dialog::backdrop {
  background: rgba(26, 26, 46, 0.54);
  backdrop-filter: blur(8px);
}

.ad-screen {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 28px;
  color: var(--text);
  background: white;
}

.ad-screen h2 {
  margin: 0;
  color: var(--slate);
  font-size: 1.7rem;
  line-height: 1.06;
}

.ad-screen p {
  margin: 0;
  color: var(--muted);
}

.ad-creative {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 18px;
  border-radius: 22px;
  color: white;
  background:
    linear-gradient(135deg, rgba(46, 196, 182, 0.94), rgba(255, 107, 107, 0.88)),
    #2ec4b6;
  text-align: center;
}

.ad-slot {
  position: relative;
}

.ad-slot::after {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 4px 7px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(26, 26, 46, 0.22);
  content: attr(data-ad-provider);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ad-slot-banner::after {
  right: 0;
  bottom: auto;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
}

.ad-creative span {
  font-size: 3rem;
}

.progress-shell {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.1);
}

#adProgress {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 0.25s ease;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    padding-top: 0;
  }

  .hero-visual {
    order: 0;
    aspect-ratio: 16 / 11;
    max-height: 230px;
    border-radius: 24px;
  }

  .impact-strip,
  .project-grid,
  .stats-grid,
  .transparency-flow,
  .admin-metrics,
  .project-showcase {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 861px) {
  .bottom-nav {
    right: clamp(24px, 5vw, 64px);
    left: auto;
    width: min(560px, calc(100vw - 380px));
  }
}

@media (max-width: 560px) {
  .topbar {
    padding-top: calc(10px + env(safe-area-inset-top));
  }

  .install-button span:last-child {
    display: none;
  }

  .admin-access span:last-child {
    display: none;
  }

  .hero-copy h1 {
    font-size: clamp(2.1rem, 11vw, 2.85rem);
  }

  .donation-panel,
  .certificate,
  .install-nudge {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions,
  .hero-actions > *,
  .install-actions,
  .install-actions > * {
    width: 100%;
  }

  .bottom-nav {
    right: 8px;
    left: 8px;
    border-radius: 22px;
  }

  .nav-item {
    min-height: 56px;
  }

  .nav-item small {
    font-size: 0.72rem;
  }

  .sponsor-banner {
    font-size: 0.82rem;
  }

  .ad-slot-banner {
    align-items: center;
    justify-content: flex-start;
    text-align: left;
  }

  .ad-slot-banner::after {
    display: none;
  }

  .admin-tabs {
    top: 64px;
  }

  .admin-list-item {
    align-items: stretch;
    flex-direction: column;
  }
}
