/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:      #16a34a;
  --green-dark: #15803d;
  --green-light:#dcfce7;
  --green-pale: #f0fdf4;
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-400:   #9ca3af;
  --gray-500:   #6b7280;
  --gray-600:   #4b5563;
  --gray-800:   #1f2937;
  --gray-900:   #111827;
  --red:        #ef4444;
  --white:      #ffffff;
  --radius:     10px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
}

/* ── Dark mode ── */
[data-theme="dark"] {
  color-scheme: dark;
  --green-pale:  #052e16;
  --green-light: #14532d;
  --gray-50:  #0f172a;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-400: #64748b;
  --gray-500: #94a3b8;
  --gray-600: #cbd5e1;
  --gray-800: #e2e8f0;
  --gray-900: #f1f5f9;
  --white:    #1e293b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5);
}
[data-theme="dark"] .site-header { background: #020617; border-color: #1e293b; }
[data-theme="dark"] .site-footer { background: #020617; }
[data-theme="dark"] .mobile-nav  { background: #020617; }
[data-theme="dark"] .cal-hero    { background: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 100%); }
/* In-body links need a brighter green in dark mode (green-dark is too low-contrast). Nav/footer links keep their own colors via higher specificity / source order. Button-style links (.btn-cta) are excluded so their white text stays visible on green background. */
[data-theme="dark"] a:not(.btn-cta) { color: var(--green); }
/* Breadcrumbs are always on coloured hero backgrounds — restore white regardless of dark mode link override above */
[data-theme="dark"] .breadcrumb a { color: rgba(255,255,255,.85); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --green-pale:  #052e16;
    --green-light: #14532d;
    --gray-50:  #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-800: #e2e8f0;
    --gray-900: #f1f5f9;
    --white:    #1e293b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,.5);
  }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .site-header { background: #020617; border-color: #1e293b; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .site-footer { background: #020617; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .mobile-nav  { background: #020617; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .cal-hero    { background: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 100%); }
  :root:not([data-theme="light"]):not([data-theme="dark"]) a:not(.btn-cta) { color: var(--green); }
  /* Breadcrumbs are always on coloured hero backgrounds — restore white regardless of dark mode link override above */
  :root:not([data-theme="light"]):not([data-theme="dark"]) .breadcrumb a { color: rgba(255,255,255,.85); }
}

html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ── Header ── */
.site-header {
  background: var(--gray-900);
  border-bottom: 1px solid var(--gray-800);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
[id] { scroll-margin-top: 80px; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: 1100px;
  margin: 0 auto;
  gap: 12px;
}

/* ── Theme Segmented Control ── */
.theme-seg { position:relative; display:flex; flex-shrink:0; background:rgba(255,255,255,.1); border-radius:8px; padding:3px; }
.theme-pill { position:absolute; top:3px; bottom:3px; background:rgba(255,255,255,.2); border-radius:5px; transition:left .2s cubic-bezier(.4,0,.2,1), width .2s cubic-bezier(.4,0,.2,1); pointer-events:none; }
.theme-seg button { position:relative; z-index:1; background:none; border:none; cursor:pointer; padding:5px 10px; border-radius:5px; font-size:.78rem; line-height:1; color:rgba(255,255,255,.45); transition:color .2s; font-family:inherit; white-space:nowrap; }
.theme-seg button.active { color:rgba(255,255,255,.95); font-weight:600; }

/* ── Hamburger (mobile only) ── */
.hamburger { display:none; flex-direction:column; justify-content:center; gap:5px; background:none; border:none; cursor:pointer; padding:6px; flex-shrink:0; }
.hamburger span { display:block; width:22px; height:2px; background:rgba(255,255,255,.6); border-radius:2px; transition:all .2s; }
.hamburger.open span:nth-child(1) { transform:rotate(45deg) translate(5px,5px); }
.hamburger.open span:nth-child(2) { opacity:0; }
.hamburger.open span:nth-child(3) { transform:rotate(-45deg) translate(5px,-5px); }

/* ── Mobile nav dropdown ── */
/* Always dark — never use CSS vars here, they invert in dark mode */
.mobile-nav { display:none; background:#111827; border-top:1px solid rgba(255,255,255,.07); }
.mobile-nav.open { display:block; }
.mobile-nav-links { display:flex; flex-direction:column; padding:4px 20px 14px; max-width:1100px; margin:0 auto; }
.mobile-nav-links a { color:rgba(255,255,255,.55) !important; font-weight:500; padding:10px 0; border-bottom:1px solid rgba(255,255,255,.05); font-size:.93rem; display:block; }
.mobile-nav-links a:last-child { border-bottom:none; }
.mobile-nav-links a.active { color:rgba(255,255,255,.92) !important; }
.mobile-nav-section { font-size:.67rem; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:rgba(255,255,255,.28); padding:12px 0 2px; }
.mobile-nav-divider { height:1px; background:rgba(255,255,255,.08); margin:6px 0; }

@media (max-width: 640px) {
  .nav-links  { display:none !important; }
  .hamburger  { display:flex; }
}
.nav-links { display: flex; align-items: center; gap: 20px; font-size: .9rem; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
/* Nav is always on dark header — hardcode colours so dark mode can't invert them */
.nav-links a { color: rgba(255,255,255,.55); font-weight: 500; transition: color .2s; white-space: nowrap; flex-shrink: 0; }
.nav-links a:hover { color: rgba(255,255,255,.92); text-decoration: none; }
.nav-links a.active { color: rgba(255,255,255,.95); font-weight: 700; }
.nav-sep { color: rgba(255,255,255,.2); font-weight: 300; user-select: none; flex-shrink: 0; }

/* ── Ad banner ── */
.ad-banner {
  background: var(--gray-100);
  border: 1px dashed var(--gray-400);
  border-radius: var(--radius);
  text-align: center;
  padding: 12px;
  font-size: .75rem;
  color: var(--gray-400);
  margin: 16px 0;
}
.ad-banner.leaderboard { min-height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-banner.rectangle   { min-height: 250px; display: flex; align-items: center; justify-content: center; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--green) 0%, #059669 100%);
  color: var(--white);
  padding: 52px 20px 40px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}
.hero p {
  font-size: 1.05rem;
  opacity: .88;
  max-width: 600px;
  margin: 0 auto;
}
.breadcrumb {
  font-size: .8rem;
  opacity: .75;
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--white); opacity: .8; }

/* ── Main grid ── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  padding: 32px 0 48px;
}
@media (max-width: 860px) {
  .main-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

@media (max-width: 480px) {
  /* Header */
  .header-inner { padding: 12px 16px; }
  .logo { font-size: 1.05rem; }
  .nav-links { gap: 14px; font-size: .8rem; }

  /* Hero */
  .hero { padding: 32px 16px 28px; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: .92rem; }

  /* Cards */
  .card { padding: 20px 16px; }

  /* Buttons — prevent text from getting cut off */
  .btn { padding: 12px 16px; font-size: .92rem; }
  .btn-group { flex-direction: column; }
  .btn-primary, .btn-secondary { width: 100%; text-align: center; }

  /* Results table */
  .result-table { font-size: .82rem; }
  .result-table td { padding: 8px 8px; }

  /* Popup */
  .popup-card { padding: 28px 20px 22px; }
  .popup-actions { flex-direction: column; }
  .btn-nanti, .btn-kirim { width: 100%; }

  /* Ad banners */
  .ad-banner.leaderboard { min-height: 60px; font-size: .75rem; }

  /* FAQ */
  .faq-question { font-size: .9rem; padding: 14px 16px; }
  .faq-answer { font-size: .88rem; }

  /* Container padding */
  .container { padding: 0 14px; }
}

/* ── Card ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 28px;
  margin-bottom: 24px;
}
.card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--green-light);
}

/* ── Form ── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color .2s;
  appearance: none;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}
.input-prefix {
  position: relative;
}
.input-prefix span {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--gray-400);
  pointer-events: none;
}
.input-prefix input { padding-left: 42px; }

.field-error { font-size: .8rem; color: var(--red); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

/* ── Buttons ── */
.btn-group { display: flex; gap: 12px; margin-top: 22px; }
.btn {
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
}
.btn-primary {
  background: var(--green);
  color: var(--white);
  flex: 1;
}
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-600);
}
.btn-secondary:hover { background: var(--gray-200); }

/* ── Results ── */
.hidden { display: none !important; }

#results { margin-top: 24px; }
#results .card h2 { color: var(--green-dark); margin-bottom: 0; border-bottom: none; padding-bottom: 0; }

/* Results title row: title left, Simpan button right */
.results-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--green-light);
}
.simpan-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.simpan-btn:hover { background: var(--green-dark); }
.simpan-btn:active { transform: scale(.97); }

.result-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.result-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
}
.result-table tr:last-child td { border-bottom: none; }
.result-table tr:hover td { background: var(--gray-50); }

.result-highlight td {
  background: var(--green-light) !important;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--green-dark);
}
/* In dark mode --green-light and --green-dark are both dark-green shades,
   so the highlight text becomes nearly invisible. Override to a bright
   pastel green that contrasts ~12:1 on the dark green background. */
[data-theme="dark"] .result-highlight td { color: #dcfce7; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .result-highlight td { color: #dcfce7; }
}
.result-total td {
  background: var(--gray-100) !important;
  font-weight: 600;
  border-top: 2px solid var(--gray-200);
}
.text-right { text-align: right; font-variant-numeric: tabular-nums; }

.badge-deduction {
  font-size: .68rem;
  background: #fee2e2;
  color: var(--red);
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 4px;
}

/* ── Info boxes ── */
.info-box {
  background: var(--green-pale);
  border-left: 4px solid var(--green);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  font-size: .9rem;
  color: var(--gray-800);
  margin-bottom: 16px;
}

/* ── Article body typography ── */
article section { margin-bottom: 32px; }
article h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gray-900);
  margin: 32px 0 10px;
  line-height: 1.25;
}
article h2:first-child { margin-top: 0; }
article h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 20px 0 8px;
  line-height: 1.3;
}
article p {
  font-size: .95rem;
  line-height: 1.7;
  color: var(--gray-800);
  margin-bottom: 12px;
}
article ul, article ol {
  padding-left: 20px;
  margin: 8px 0 14px;
}
article li {
  font-size: .95rem;
  line-height: 1.65;
  color: var(--gray-800);
  margin-bottom: 6px;
}
article strong { color: var(--gray-900); }
@media (max-width: 640px) {
  article h2 { font-size: 1.15rem; margin: 24px 0 8px; }
  article h3 { font-size: .95rem; margin: 16px 0 6px; }
  article p, article li { font-size: .9rem; }
  article ul, article ol { padding-left: 18px; }
  /* prevent Saweria button from hiding last content */
  main.container { padding-bottom: 80px; }
}

/* ── FAQ ── */
.faq-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--gray-900);
}
.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--white);
}
.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 16px 20px;
  font-size: .97rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--gray-800);
  font-family: inherit;
}
.faq-question:hover { background: var(--gray-50); }
.faq-icon { font-size: 1.2rem; color: var(--green); transition: transform .2s; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .2s;
  font-size: .93rem;
  color: var(--gray-600);
  line-height: 1.7;
  border-top: 1px solid transparent;
}
.faq-item.open .faq-answer { max-height: 500px; padding: 12px 20px 18px; border-top-color: var(--gray-200); }

/* ── Explainer section ── */
.explainer h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--gray-900);
}
.explainer h3 { font-size: 1.05rem; font-weight: 700; margin: 18px 0 6px; color: var(--green-dark); }
.explainer p, .explainer ul { font-size: .95rem; color: var(--gray-600); margin-bottom: 10px; }
.explainer ul { padding-left: 20px; }
.explainer li { margin-bottom: 4px; }

/* ── Sidebar ── */
.sidebar .card h3 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--gray-800);
}
.related-tools a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: .88rem;
  color: var(--gray-800);
  font-weight: 500;
}
.related-tools a:last-child { border-bottom: none; }
.related-tools a:hover { color: var(--green); text-decoration: none; }

/* ── Footer ── */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  text-align: center;
  padding: 32px 20px;
  font-size: .85rem;
  margin-top: 48px;
}
.site-footer a { color: var(--gray-400); }
.site-footer strong { color: var(--white); }

/* ── Email Popup ── */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.popup-card {
  background: var(--white);
  border-radius: 16px;
  padding: 36px 32px 28px;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: slideUp .3s ease;
  text-align: center;
}
@keyframes slideUp { from { transform: translateY(24px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

.popup-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  font-size: 1.1rem; color: var(--gray-400);
  cursor: pointer; padding: 4px 8px;
  border-radius: 6px;
}
.popup-close:hover { background: var(--gray-100); color: var(--gray-800); }

.popup-icon { font-size: 2.2rem; margin-bottom: 10px; }

.popup-card h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 10px;
}
.popup-card p {
  font-size: .93rem;
  color: var(--gray-600);
  line-height: 1.65;
  margin-bottom: 20px;
}

#popup-email {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 10px;
  text-align: center;
}
#popup-email:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,.12); }

.popup-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.btn-nanti {
  flex: 1;
  padding: 11px;
  background: var(--gray-100);
  color: var(--gray-600);
  border: none; border-radius: 8px;
  font-size: .95rem; font-weight: 600;
  cursor: pointer;
}
.btn-nanti:hover { background: var(--gray-200); }
.btn-kirim {
  flex: 2;
  padding: 11px;
  background: var(--green);
  color: var(--white);
  border: none; border-radius: 8px;
  font-size: .95rem; font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn-kirim:hover { background: var(--green-dark); }
.btn-kirim:disabled { opacity: .6; cursor: not-allowed; }

.popup-msg {
  font-size: .85rem;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 8px;
  text-align: center;
}
.msg-ok  { background: var(--green-light); color: var(--green-dark); }
.msg-err { background: #fee2e2; color: var(--red); }

/* ── Contextual Ad Strip ── */
.contextual-ad-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0 0 28px;
}
@media (max-width: 600px) { .contextual-ad-row { grid-template-columns: 1fr; } }

.ctx-ad-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.ctx-ad-label {
  font-size: .72rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}

/* ── Utility ── */
.text-green { color: var(--green); }
.mt-8 { margin-top: 8px; }
.select-wrapper { position: relative; }
.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--gray-400);
}
.select-wrapper select { padding-right: 36px; }

/* ── Language Switcher (footer) ── */
.footer-lang {
  margin-top: 12px;
  color: var(--gray-600);
}
.footer-lang-btn {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  outline: none;
  color: rgba(255,255,255,.3);
  font-size: .85rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0 2px;
  transition: color .15s;
}
.footer-lang-btn.active { color: #fff; font-weight: 600; }
.footer-lang-btn:not(.active):hover { color: rgba(255,255,255,.55); }

/* ── Saweria floating button ── */
.saweria-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  background: var(--green);
  color: #fff !important;
  padding: 11px 18px 11px 13px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(22,163,74,.45), 0 1px 4px rgba(0,0,0,.14);
  text-decoration: none !important;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  user-select: none;
  animation: saweria-pop .45s ease 2.8s both;
}
@keyframes saweria-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.08); }
  72%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}
.saweria-btn:hover {
  background: var(--green-dark);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 28px rgba(22,163,74,.55), 0 2px 6px rgba(0,0,0,.16);
  color: #fff !important;
  text-decoration: none !important;
}
.saweria-btn:active { transform: translateY(-1px) scale(1.01); }
.saweria-btn .sb-icon  { font-size: 1.35rem; line-height: 1; flex-shrink: 0; }
.saweria-btn .sb-label { font-size: .75rem; font-weight: 700; line-height: 1.35; text-align: left; }
@media (max-width: 640px) {
  .saweria-btn {
    bottom: 18px;
    right: 16px;
    padding: 10px 15px 10px 11px;
    gap: 8px;
    transition: right .28s cubic-bezier(.4,0,.2,1), transform .18s ease, box-shadow .18s ease, background .18s ease;
  }
  .saweria-btn .sb-icon  { font-size: 1.2rem; }
  .saweria-btn .sb-label { font-size: .72rem; }
  /* hidden — slides right, leaves icon + caret tab visible (~46px) */
  .saweria-btn.sb-hidden {
    right: -120px; /* button width ~166px → shows ~46px: icon + left pad */
    border-radius: 50px 0 0 50px;
    box-shadow: -2px 0 14px rgba(22,163,74,.38);
  }
  /* fade label only; keep icon visible so user sees the ☕ peeking out */
  .saweria-btn.sb-hidden .sb-label { opacity: 0; transition: opacity .12s; }
  /* arrow tab to the left of the icon as an extra nudge */
  .saweria-btn.sb-hidden::after {
    content: '‹';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .85rem;
    font-weight: 900;
    color: rgba(255,255,255,.7);
    pointer-events: none;
  }
}

/* ── Calculator mode tabs (Nett / Gross / Guess) ── */
.mode-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.mode-tab  { flex: 1; padding: 10px 8px; border: 1.5px solid var(--gray-200);
  background: var(--white); color: var(--gray-600); font-weight: 600; font-size: .85rem;
  border-radius: 8px; cursor: pointer; transition: all .15s ease; text-align: center;
  font-family: inherit; }
.mode-tab.active { border-color: var(--green); color: var(--green-dark);
  background: var(--green-pale); box-shadow: 0 0 0 1px var(--green) inset; }
.mode-tab:hover:not(.active) { border-color: var(--green-light); color: var(--gray-800); }

/* Mode-tabs intro hint */
.mode-hint { font-size: .8rem; color: var(--gray-500); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px; }

/* "Baru" badge on the new mode tabs — own line so all 3 tabs stack consistently */
.mode-new { display: block; background: var(--green); color: #fff;
  font-size: .58rem; font-weight: 800; line-height: 1; padding: 3px 8px;
  border-radius: 999px; margin: 6px auto 0; width: fit-content;
  letter-spacing: .04em; text-transform: uppercase; }
.mode-tab.active .mode-new { background: var(--green-dark); }

/* Cross-mode CTA shown below results */
.mode-cross-cta { margin-top: 20px; padding-top: 18px;
  border-top: 1px dashed var(--gray-200);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mode-cta-title { font-size: .82rem; font-weight: 700; color: var(--gray-600);
  width: 100%; margin-bottom: 4px; }
.mode-cta-chip { display: inline-flex; align-items: center; gap: 4px;
  background: var(--green-pale); border: 1px solid var(--green-light);
  color: var(--green-dark); font-weight: 600; font-size: .82rem;
  padding: 8px 12px; border-radius: 999px; cursor: pointer;
  font-family: inherit; transition: all .15s ease; }
.mode-cta-chip:hover { background: var(--green); color: #fff; border-color: var(--green); }

/* Lift Saweria button above the cookie consent banner when it's present.
   :has() is supported in modern Safari 15.4+/Chrome 105+ (2022).
   The banner wraps to ~120px on narrow mobile widths, so the lift has to
   clear that comfortably. */
body:has(#_td_cc_bar) .saweria-btn { bottom: 100px; }
@media (max-width: 640px) {
  body:has(#_td_cc_bar) .saweria-btn { bottom: 140px; }
}

/* ── Inline post-calc email CTA (replaces the old popup) ── */
.calc-email-cta { margin-top: 18px; padding: 22px 22px 18px;
  border: 1.5px solid var(--green-light); background: var(--green-pale);
  border-radius: 12px; box-shadow: none; }
.calc-email-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.calc-email-icon { font-size: 1.8rem; line-height: 1; flex-shrink: 0; }
.calc-email-cta h3 { font-size: 1.02rem; font-weight: 700; color: var(--gray-900);
  margin: 0 0 4px; line-height: 1.35; }
.calc-email-cta p { font-size: .88rem; color: var(--gray-600); margin: 0; line-height: 1.5; }
#calc-email-form { display: flex; gap: 8px; flex-wrap: wrap; }
#calc-email-input { flex: 1; min-width: 200px; padding: 11px 14px;
  border: 1.5px solid var(--gray-200); background: var(--white); color: var(--gray-800);
  border-radius: 8px; font-family: inherit; font-size: .92rem; }
#calc-email-input:focus { outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
#calc-email-btn { background: var(--green); color: #fff; border: none;
  padding: 11px 18px; border-radius: 8px; font-weight: 700; font-size: .92rem;
  cursor: pointer; font-family: inherit; transition: background .15s ease; }
#calc-email-btn:hover:not(:disabled) { background: var(--green-dark); }
#calc-email-btn:disabled { opacity: .65; cursor: wait; }
.calc-email-msg { margin-top: 10px; font-size: .85rem; padding: 8px 12px; border-radius: 6px; }
.calc-email-msg.hidden { display: none; }
.calc-email-msg.msg-ok  { background: var(--green-light); color: var(--green-dark); }
.calc-email-msg.msg-err { background: #fee2e2; color: #991b1b; }
.calc-email-note { font-size: .72rem !important; color: var(--gray-500) !important;
  margin-top: 10px !important; line-height: 1.5 !important; }

/* ── Share row (post-calc) ── */
.calc-share { margin-top: 18px; padding: 14px 16px; background: var(--gray-50);
  border: 1px solid var(--gray-200); border-radius: 10px;
  display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.calc-share-title { font-size: .85rem; font-weight: 700; color: var(--gray-700, var(--gray-800));
  width: 100%; }
.calc-share-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn { display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: 8px; font-size: .82rem; font-weight: 700;
  text-decoration: none; cursor: pointer; font-family: inherit;
  border: 1.5px solid var(--gray-200); background: var(--white); color: var(--gray-800);
  transition: all .15s ease; }
.share-btn:hover { border-color: var(--green); color: var(--green-dark); }
.share-btn.share-native { background: var(--green); color: #fff; border-color: var(--green); }
.share-btn.share-native:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.share-btn.share-x:hover  { border-color: #000; color: #000; }
.share-btn.share-wa:hover { border-color: #25d366; color: #128c7e; }
