:root{
  --bg-black:#0b0b0b;
  --cream:#f2f0e6;
  --green:#3aa858;
  --green-light:#63c17d;
  --orange:#f2884b;
  --orange-dark:#e06b2c;
  --white:#ffffff;
  --line: rgba(255,255,255,0.12);
  --line-light: #dcd8c8;
}

*{ box-sizing:border-box; }

html,body{
  margin:0; padding:0;
  background:var(--bg-black);
  color:var(--white);
  font-family:'Tajawal','Segoe UI',sans-serif;
  -webkit-font-smoothing:antialiased;
}

a{ text-decoration:none; color:inherit; }

.wrap{
  max-width:520px;
  margin:0 auto;
  min-height:100vh;
  padding:0 0 60px;
}

/* ---------- NAV ---------- */
.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:24px 20px;
}
.nav-brand-block{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.nav-brand{
  font-size:28px;
  font-weight:900;
  display:flex;
  align-items:center;
  gap:10px;
}
.nav-brand img.icon{
  width:38px;
  height:38px;
  display:block;
  flex-shrink:0;
}
.nav-brand img.wordmark{
  height:34px;
  width:auto;
  display:block;
}
.nav-tagline{
  font-size:11px;
  font-weight:700;
  color:#999;
  padding-right:2px;
}
.nav-tagline .g{ color:var(--green-light); }
.nav-tagline .o{ color:var(--orange); }
.nav-back{
  font-size:14px;
  font-weight:700;
  color:#bcbcbc;
  display:flex;
  align-items:center;
  gap:6px;
}

/* ---------- HERO (home) ---------- */
.hero{
  padding:8px 24px 32px;
  text-align:center;
}
.hero h1{
  font-size:32px;
  font-weight:900;
  margin:0 0 10px;
  line-height:1.3;
}
.hero p{
  font-size:15px;
  color:#a9a9a9;
  margin:0;
  line-height:1.8;
}

/* ---------- CALCULATOR CARDS (home grid) ---------- */
.calc-grid{
  padding:0 20px;
  display:flex;
  flex-direction:column;
  gap:16px;
}
.calc-card{
  background:var(--cream);
  color:#1a1a1a;
  border-radius:20px;
  padding:22px;
  display:flex;
  align-items:center;
  gap:18px;
  transition:transform .15s ease;
}
.calc-card:active{ transform:scale(0.98); }
.calc-icon{
  width:56px;height:56px;
  border-radius:16px;
  display:flex;align-items:center;justify-content:center;
  font-size:28px;
  flex-shrink:0;
}
.calc-icon.g{ background:rgba(58,168,88,0.18); }
.calc-icon.o{ background:rgba(242,136,75,0.18); }
.calc-icon.k{ background:rgba(0,0,0,0.08); }
.calc-info{ flex:1; }
.calc-info h3{ font-size:17px; margin:0 0 4px; font-weight:800; }
.calc-info p{ font-size:12.5px; color:#666; margin:0; line-height:1.6; }
.calc-arrow{ font-size:20px; color:#999; }

/* ---------- PAGE HERO (inner calculator page) ---------- */
.page-tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:rgba(58,168,88,0.15);
  border:1px solid rgba(58,168,88,0.4);
  color:var(--green-light);
  font-size:12px;
  font-weight:700;
  padding:5px 12px;
  border-radius:999px;
  margin:0 20px 14px;
}
.page-title{
  font-size:26px;
  font-weight:800;
  line-height:1.35;
  margin:0 20px 8px;
}
.page-sub{
  font-size:14px;
  color:#9c9c9c;
  line-height:1.7;
  margin:0 20px;
}

/* ---------- CARD (cream input container) ---------- */
.card{
  background:var(--cream);
  color:#1a1a1a;
  border-radius:20px;
  padding:24px 22px;
  margin:22px 20px 0;
}
.field{ margin-bottom:18px; }
.field:last-child{ margin-bottom:0; }
.field-label{
  font-size:13px;
  font-weight:700;
  color:#555;
  margin-bottom:10px;
  display:block;
}
.input-row{
  display:flex;
  align-items:center;
  background:#ffffff;
  border:2px solid #1a1a1a;
  border-radius:14px;
  padding:4px 4px 4px 14px;
  overflow:hidden;
}
.input-row input{
  flex:1;
  border:none;
  outline:none;
  background:transparent;
  font-family:'Tajawal', sans-serif;
  font-size:20px;
  font-weight:800;
  text-align:center;
  color:#1a1a1a;
  padding:12px 0;
  width:100%;
  -moz-appearance:textfield;
}
.input-row input::-webkit-outer-spin-button,
.input-row input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.input-suffix{
  background:#1a1a1a;
  color:var(--cream);
  font-size:13px;
  font-weight:700;
  padding:10px 14px;
  border-radius:10px;
  white-space:nowrap;
}

/* sliders */
input[type="range"]{
  -webkit-appearance:none;
  width:100%;
  height:8px;
  border-radius:6px;
  outline:none;
  background:#e2ded0;
  margin-top:6px;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:22px; height:22px;
  border-radius:50%;
  background:#ffffff;
  border:3px solid #1a1a1a;
  cursor:pointer;
}
input[type="range"]::-moz-range-thumb{
  width:22px; height:22px;
  border-radius:50%;
  background:#ffffff;
  border:3px solid #1a1a1a;
  cursor:pointer;
}
.field-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}
.field-value{
  font-size:15px;
  font-weight:900;
  font-variant-numeric: tabular-nums;
  color:var(--green);
}

/* toggle chips */
.chip-row{ display:flex; gap:8px; }
.chip{
  flex:1;
  background:#ffffff;
  border:1.5px solid #d8d5c8;
  border-radius:12px;
  padding:12px 8px;
  text-align:center;
  cursor:pointer;
  font-size:13px;
  font-weight:700;
  color:#333;
}
.chip.active{ background:#1a1a1a; border-color:#1a1a1a; color:var(--cream); }

/* ---------- RESULTS ---------- */
.results{ margin:24px 20px 0; }
.result-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:var(--cream);
  border-radius:16px;
  padding:16px 18px;
  margin-bottom:10px;
  color:#1a1a1a;
  position:relative;
  overflow:hidden;
}
.result-row::before{ content:""; position:absolute; right:0; top:0; bottom:0; width:5px; }
.result-row.a::before{ background:var(--orange); }
.result-row.b::before{ background:var(--green); }
.result-row.c::before{ background:#1a1a1a; }
.result-left{ display:flex; align-items:center; gap:10px; }
.result-icon{
  width:38px; height:38px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-size:18px; flex-shrink:0;
}
.result-row.a .result-icon{ background:rgba(242,136,75,0.18); }
.result-row.b .result-icon{ background:rgba(58,168,88,0.18); }
.result-row.c .result-icon{ background:rgba(0,0,0,0.08); }
.result-name{ font-size:14px; font-weight:800; margin:0; }
.result-sub{ font-size:11.5px; color:#777; margin:2px 0 0; }
.result-amount{ font-size:19px; font-weight:900; font-variant-numeric: tabular-nums; white-space:nowrap; }

.highlight-box{
  margin:20px 20px 0;
  background:linear-gradient(135deg, rgba(58,168,88,0.18), rgba(99,193,125,0.08));
  border:1.5px solid rgba(58,168,88,0.4);
  border-radius:18px;
  padding:20px;
  text-align:center;
}
.highlight-box .label{ font-size:13px; font-weight:700; color:#8fd6a5; margin-bottom:6px; }
.highlight-box .value{ font-size:26px; font-weight:900; color:var(--green-light); }

.warning-box{
  margin:16px 20px 0;
  background:#3a1f14;
  border:1.5px solid rgba(242,136,75,0.5);
  color:#f3b98f;
  border-radius:14px;
  padding:14px 16px;
  font-size:13px;
  font-weight:700;
  text-align:center;
  line-height:1.7;
  display:none;
}
.warning-box.show{ display:block; }

/* ---------- NOTE / DISCLAIMER ---------- */
.note-box{
  margin:24px 20px 0;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--line);
  border-radius:14px;
  padding:16px 16px;
  font-size:12.5px;
  line-height:1.9;
  color:#a9a9a9;
}
.note-box b{ color:var(--white); }
.disclaimer{
  text-align:center;
  font-size:11px;
  color:#666;
  margin:28px 20px 0;
  line-height:1.8;
}
.footer-brand{
  text-align:center;
  margin-top:18px;
  font-size:12px;
  color:#555;
  font-weight:700;
}
.footer-links{
  display:flex;
  justify-content:center;
  gap:16px;
  margin-top:14px;
}
.footer-links a{
  font-size:12px;
  color:#888;
  font-weight:700;
}

/* ---------- PRIVACY NOTE ---------- */
.privacy-note{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin:22px 20px 0;
  padding:12px 14px;
  background:rgba(58,168,88,0.08);
  border:1px solid rgba(58,168,88,0.25);
  border-radius:12px;
  font-size:11.5px;
  color:#8fd6a5;
  font-weight:700;
  text-align:center;
  line-height:1.6;
}

/* ---------- SHARE BUTTON ---------- */
.share-row{
  display:flex;
  gap:10px;
  margin:18px 20px 0;
}
.share-btn{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:14px 10px;
  border-radius:14px;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
  border:none;
  font-family:inherit;
}
.share-btn.whatsapp{
  background:#25D366;
  color:#0b0b0b;
}
.share-btn.copy{
  background:rgba(255,255,255,0.08);
  border:1.5px solid var(--line);
  color:var(--white);
}
.share-btn:active{ transform:scale(0.97); }
.share-toast{
  position:fixed;
  bottom:24px;
  left:50%;
  transform:translateX(-50%);
  background:#1a1a1a;
  color:var(--cream);
  padding:12px 22px;
  border-radius:999px;
  font-size:13px;
  font-weight:700;
  opacity:0;
  pointer-events:none;
  transition:opacity .25s ease;
  z-index:999;
  white-space:nowrap;
}
.share-toast.show{ opacity:1; }
