:root {
  --green: #1f6b3a;
  --green-mid: #2a7d45;
  --green-dark: #16532c;
  --green-soft: #e7f5ec;
  --green-pill: #c8e6d0;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f3f4f6;
  --card: #ffffff;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: "Outfit", "DM Sans", system-ui, sans-serif;
  background:
    radial-gradient(ellipse 70% 40% at 0% 0%, rgba(30, 122, 69, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 35% at 100% 0%, rgba(13, 148, 136, 0.1), transparent 50%),
    #e5e7eb;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

a { text-decoration: none; color: inherit; }

/* —— Brand logo —— */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.brand-logo img {
  display: block;
  height: 48px;
  width: 48px;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  background: #14532d;
  flex-shrink: 0;
}
.brand-logo.lg img {
  height: 56px;
  width: 56px;
  border-radius: 14px;
}
.brand-logo.sm img {
  height: 36px;
  width: 36px;
  border-radius: 9px;
}
.brand-logo .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-logo .brand-text strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-logo .brand-text span {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.85;
}
.shell-header .brand-logo {
  margin-bottom: 12px;
}
.shell-header .brand-logo img {
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}
.shell-header .brand-logo .brand-text strong,
.shell-header .brand-logo .brand-text span {
  color: #fff;
}

.app {
  max-width: 430px;
  min-height: 100%;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
  padding-bottom: calc(72px + var(--safe-bottom));
}

.app.no-nav { padding-bottom: var(--safe-bottom); }

.shell-header {
  background: linear-gradient(145deg, #1e7a45 0%, #145c32 48%, #0f766e 100%);
  color: #fff;
  padding: 20px 20px 28px;
  border-radius: 0 0 28px 28px;
  position: relative;
  overflow: hidden;
}

.shell-header::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -40px;
  top: -50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.greeting {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 16px 0;
}

.trust-item {
  background: #fff;
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  animation: riseIn 0.5s ease both;
}
.trust-item:nth-child(2) { animation-delay: 0.08s; }
.trust-item:nth-child(3) { animation-delay: 0.16s; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.trust-item strong {
  display: block;
  font-size: 1rem;
  color: var(--green-dark);
  font-weight: 800;
}
.trust-item span {
  font-size: 0.68rem;
  color: var(--muted);
}

.feature-card {
  transition: transform 0.2s ease, box-shadow 0.2s;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(22, 83, 44, 0.32);
}

.list-item {
  transition: background 0.15s, transform 0.15s;
}
.list-item:active { transform: scale(0.985); }

.btn-main {
  background: linear-gradient(135deg, var(--green-mid), #0f766e);
  box-shadow: 0 8px 18px rgba(31, 107, 58, 0.25);
}

.shell-header .top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.shell-header h1 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.shell-header .subtitle {
  margin-top: 6px;
  font-size: 0.88rem;
  opacity: 0.88;
  line-height: 1.45;
  max-width: 92%;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.pill.light {
  background: var(--green-pill);
  color: var(--green-dark);
}

.pill.white {
  background: #fff;
  color: var(--green-dark);
}

.pill.dark {
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
}

.section {
  padding: 18px 16px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  padding: 0 4px;
}

.section-head h2 {
  font-size: 1rem;
  font-weight: 700;
}

.section-head .count {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Feature card */
.feature-card {
  display: block;
  background: linear-gradient(145deg, var(--green-mid), var(--green-dark));
  color: #fff;
  border-radius: 18px;
  padding: 20px;
  margin: -8px 16px 0;
  box-shadow: 0 10px 28px rgba(22, 83, 44, 0.28);
  position: relative;
}

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 0.88rem;
  opacity: 0.9;
  line-height: 1.45;
  margin-bottom: 14px;
  max-width: 85%;
}

.feature-card .badge-icon {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

/* List card */
.list-card {
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}

.list-item:last-child { border-bottom: none; }
.list-item:active { background: #f9fafb; }

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.avatar.hl { background: #dcfce7; color: #166534; }
.avatar.pl { background: #fee2e2; color: #991b1b; }
.avatar.bl { background: #ffedd5; color: #9a3412; }
.avatar.ed { background: #dbeafe; color: #1e40af; }
.avatar.cl { background: #e0e7ff; color: #3730a3; }
.avatar.mg { background: #e0f2fe; color: #075985; }
.avatar.al { background: #ccfbf1; color: #0f766e; }
.avatar.fd { background: #d1fae5; color: #065f46; }
.avatar.rd { background: #ffedd5; color: #c2410c; }

.list-item .meta { flex: 1; min-width: 0; }
.list-item .meta strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}
.list-item .meta span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.35;
}

.chev {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--green);
}

.chev svg { width: 16px; height: 16px; }

/* Toolkit grid */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.tool-card {
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 110px;
}

.tool-card.wide {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  min-height: auto;
}

.tool-card .t-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.tool-card strong { font-size: 0.95rem; display: block; }
.tool-card small { color: #4b5563; font-size: 0.78rem; }

.tool-card.cream { background: #fef3c7; }
.tool-card.sky { background: #e0f2fe; }
.tool-card.mint { background: #d1fae5; }
.tool-card.peach { background: #ffedd5; }
.tool-card.sage { background: #dcfce7; }

/* Bottom nav */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 4px calc(8px + var(--safe-bottom));
  z-index: 50;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: #9ca3af;
  font-weight: 500;
  padding: 4px;
}

.bottom-nav a.active { color: var(--green); }
.bottom-nav svg { width: 22px; height: 22px; }

/* Calculator page */
.calc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.calc-top .back {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  flex-shrink: 0;
}

.calc-top .calc-brand {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-right: 40px;
  min-width: 0;
}

.calc-top .calc-brand img {
  height: 36px;
  width: 36px;
  object-fit: contain;
  object-position: center;
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  background: #14532d;
}

.calc-top h1 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  text-align: left;
  flex: unset;
  margin-right: 0;
}

.calc-body { padding: 20px 16px; }

.emi-hero {
  background: linear-gradient(160deg, var(--green-soft), #fff);
  border: 1.5px solid #c8e6ce;
  border-radius: 16px;
  padding: 22px 18px;
  text-align: center;
  margin-bottom: 20px;
}

.emi-hero .label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.emi-hero .value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--green);
  margin: 6px 0 4px;
  letter-spacing: -0.03em;
}

.emi-hero .meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.field {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.field-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.field-top label { font-weight: 600; font-size: 0.9rem; }
.field-top .val {
  font-weight: 700;
  color: var(--green);
  font-size: 1.05rem;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(31, 107, 58, 0.35);
}

.hints {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 6px;
}

.stats {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 13px 14px;
  background: #fff;
  border-radius: 10px;
  font-size: 0.9rem;
}

.stat-row span:last-child { font-weight: 600; }

.btn-main {
  width: 100%;
  margin-top: 16px;
  border: none;
  background: var(--green);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 15px;
  border-radius: 12px;
  cursor: pointer;
}

.btn-main:active { opacity: 0.92; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 6px;
}

/* —— Ads —— */
.ad-wrap {
  margin: 14px 0;
  padding: 8px 6px 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  min-height: 100px;
}

.ad-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 6px;
  font-weight: 600;
}

.ad-slot-pad {
  padding: 0 16px;
}

/* —— Extra content blocks —— */
.content-block {
  background: #fff;
  border-radius: 16px;
  padding: 16px 16px 14px;
  margin: 14px 0 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.content-block h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--green-dark);
}

.content-block p,
.content-block li {
  font-size: 0.86rem;
  color: #4b5563;
  line-height: 1.55;
}

.content-block p + p { margin-top: 8px; }

.content-block ul {
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.content-block .tip {
  background: var(--green-soft);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 0.84rem;
  color: var(--green-dark);
  font-weight: 500;
}

.disclaimer {
  font-size: 0.72rem;
  color: #9ca3af;
  line-height: 1.45;
  padding: 8px 4px 16px;
  text-align: center;
}
