:root {
  /* Neutral palette */
  --ink-50: #f8fafc;
  --ink-100: #f1f5f9;
  --ink-200: #e2e8f0;
  --ink-300: #cbd5e1;
  --ink-400: #94a3b8;
  --ink-600: #475569;
  --ink-700: #334155;
  --ink-900: #0f172a;
  --red-50: #fef2f2;
  --red-700: #b91c1c;

  /* Gregorian theme (green) — also the site-wide default accent */
  --greg-500: #10b981;
  --greg-600: #059669;
  --greg-700: #047857;
  --greg-50: #ecfdf5;
  --greg-100: #d1fae5;

  /* Hijri theme (amber) */
  --hijri-500: #f59e0b;
  --hijri-600: #d97706;
  --hijri-700: #b45309;
  --hijri-50: #fffbeb;
  --hijri-100: #fef3c7;

  /* Active theme (swapped by JS via data-theme on #age-calc-widget) */
  --accent-500: var(--greg-500);
  --accent-600: var(--greg-600);
  --accent-700: var(--greg-700);
  --accent-50: var(--greg-50);
  --accent-100: var(--greg-100);

  /* Shared shadow scale */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink-50);
  background-image:
    radial-gradient(720px 420px at 12% -8%, var(--accent-50) 0%, transparent 60%),
    radial-gradient(600px 360px at 100% 0%, var(--hijri-50) 0%, transparent 55%);
  background-repeat: no-repeat;
  color: var(--ink-900);
  font-family: "Cairo", Tahoma, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap-wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

:focus-visible {
  outline: 3px solid var(--accent-600);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection {
  background: var(--accent-100);
  color: var(--accent-700);
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--ink-200);
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-900);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Calculators nav (dropdown on desktop, slide-in panel on mobile) */
.main-nav {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.nav-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-700);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.nav-toggle:hover {
  border-color: var(--accent-500);
  color: var(--accent-700);
}

.nav-toggle-icon {
  transition: transform 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  transform: rotate(180deg);
}

.nav-panel {
  display: none;
  flex-direction: column;
  gap: 2px;
}

.nav-panel.open {
  display: flex;
}

@media (min-width: 860px) {
  .nav-panel.open {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 520px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border: 1px solid var(--ink-200);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
}

.nav-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.nav-item:hover {
  background: var(--ink-50);
}

.nav-item.is-active {
  background: var(--accent-50);
}

.nav-item-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ink-100);
  color: var(--ink-600);
}

.nav-item.is-active .nav-item-icon {
  background: var(--accent-100);
  color: var(--accent-700);
}

.nav-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nav-item-text strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-900);
}

.nav-item.is-active .nav-item-text strong {
  color: var(--accent-700);
}

.nav-item-text small {
  font-size: 0.74rem;
  color: var(--ink-400);
  line-height: 1.4;
}

/* Mobile: full slide-down panel below the header */
@media (max-width: 859px) {
  .main-nav {
    flex: 0;
  }

  .nav-panel.open {
    position: fixed;
    inset: 0;
    top: 65px;
    background: #fff;
    padding: 16px;
    overflow-y: auto;
    z-index: 20;
    animation: navSlideDown 0.2s ease-out;
  }

  @keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .nav-item {
    padding: 14px;
  }
}

.header-cta {
  display: none;
}

@media (min-width: 560px) {
  .header-cta {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--ink-900);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.15s ease, background 0.15s ease;
  }
  .header-cta:hover {
    background: var(--accent-600);
    transform: translateY(-1px);
  }
}

/* Hero */
.hero {
  text-align: center;
  padding-top: 52px;
  padding-bottom: 20px;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--ink-200);
  box-shadow: var(--shadow-sm);
  color: var(--accent-700);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hijri-500);
  box-shadow: 0 0 0 3px var(--hijri-100);
}

.hero h1 {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.hero .lead {
  max-width: 620px;
  margin: 18px auto 0;
  color: var(--ink-600);
  font-size: 1rem;
  line-height: 1.8;
}

@media (min-width: 640px) {
  .hero {
    padding-top: 76px;
    padding-bottom: 28px;
  }
  .hero h1 {
    font-size: 2.4rem;
  }
  .hero .lead {
    font-size: 1.12rem;
  }
}

/* Calculator */
.calc-section {
  padding-top: 8px;
  padding-bottom: 56px;
}

/* "Coming soon" placeholder for tool pages not built yet */
.coming-soon-card {
  background: #fff;
  border: 1px dashed var(--ink-300);
  border-radius: 22px;
  padding: 48px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.coming-soon-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--accent-50);
  color: var(--accent-600);
  margin-bottom: 20px;
}

.coming-soon-card h2 {
  margin: 0 0 10px;
  font-size: 1.4rem;
  font-weight: 800;
}

.coming-soon-card p {
  max-width: 440px;
  margin: 0 auto 24px;
  color: var(--ink-600);
  font-size: 0.95rem;
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--ink-100);
  color: var(--ink-600);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.age-widget {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.widget-header {
  text-align: center;
  padding: 28px 20px 20px;
  border-bottom: 1px solid var(--ink-200);
  background: linear-gradient(180deg, var(--accent-50), #fff 130%);
  transition: background 0.4s ease;
}

.widget-header h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--accent-700);
  letter-spacing: -0.01em;
  transition: color 0.3s ease;
}

.current-date-display {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--ink-400);
}

.current-date-display span {
  font-weight: 700;
  color: var(--accent-600);
  transition: color 0.3s ease;
}

.widget-body {
  padding: 24px 18px;
}

@media (min-width: 640px) {
  .widget-body {
    padding: 34px;
  }
}

/* Calendar toggle */
.calendar-toggle-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 26px;
}

.toggle-container {
  background: var(--ink-100);
  padding: 4px;
  border-radius: 999px;
  display: flex;
  position: relative;
  width: 232px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.toggle-slider {
  position: absolute;
  top: 4px;
  right: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: var(--accent-500);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1), background 0.3s ease;
  z-index: 1;
}

.toggle-btn {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-600);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: color 0.3s ease;
}

.toggle-btn.active {
  color: #fff;
}

.error-message {
  background: var(--red-50);
  color: var(--red-700);
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.error-message:focus-visible {
  outline: 3px solid var(--red-700);
  outline-offset: 2px;
}

.error-message.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .error-message.shake {
    animation: none;
  }
}

/* Date group with day/month/year dropdowns */
.date-group {
  margin-bottom: 18px;
}

.date-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-700);
  margin-bottom: 8px;
}

.selects-wrapper {
  display: flex;
  gap: 10px;
}

select {
  flex: 1;
  height: 52px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--ink-200);
  background: var(--ink-50);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-900);
  text-align: center;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 14px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

select:hover {
  border-color: var(--ink-300);
}

select:focus {
  border-color: var(--accent-600);
  background-color: #fff;
  box-shadow: 0 0 0 4px var(--accent-50);
  outline: none;
}

.text-input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--ink-200);
  background: var(--ink-50);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-900);
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.text-input:hover {
  border-color: var(--ink-300);
}

.text-input:focus {
  border-color: var(--accent-600);
  background-color: #fff;
  box-shadow: 0 0 0 4px var(--accent-50);
  outline: none;
}

/* Remove native spinner arrows so number inputs match the select's look. */
.text-input[type="number"]::-webkit-outer-spin-button,
.text-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.text-input[type="number"] {
  -moz-appearance: textfield;
}

.action-area {
  display: flex;
  gap: 10px;
  margin-top: 26px;
}

.btn {
  height: 54px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease, opacity 0.2s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  flex: 1;
  background: var(--accent-600);
  color: #fff;
  box-shadow: 0 8px 20px -6px var(--accent-600);
}

.btn-primary:hover {
  opacity: 0.94;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -6px var(--accent-600);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px -6px var(--accent-600);
}

.btn-outline {
  background: #fff;
  border: 1.5px solid var(--ink-200);
  color: var(--ink-600);
  padding: 0 24px;
}

.btn-outline:hover {
  border-color: var(--ink-400);
  color: var(--ink-900);
  background: var(--ink-100);
}

.privacy-note {
  margin: 0;
  padding: 16px 20px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-400);
  border-top: 1px solid var(--ink-200);
  background: var(--ink-50);
}

/* Results — matches result-area, nb-result-area, dd-result-area,
   ad-result-area, and any future "*-result-area" id on other calculators. */
[id$="result-area"] {
  margin-top: 26px;
  animation: fadeIn 0.4s ease-out;
  border-radius: 16px;
  scroll-margin-top: 16px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

[id$="result-area"].result-flash {
  animation: fadeIn 0.4s ease-out, resultFlash 1s ease-out;
}

@keyframes resultFlash {
  0% { box-shadow: 0 0 0 0 var(--accent-100); }
  35% { box-shadow: 0 0 0 8px var(--accent-100); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  [id$="result-area"].result-flash {
    animation: fadeIn 0.4s ease-out;
  }
}

.result-section {
  margin-bottom: 22px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink-200);
}

/* Arabic sentence boxes */
.arabic-age-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.arabic-age-box {
  position: relative;
  background: var(--accent-50);
  border: 1px solid var(--accent-100);
  border-right: 4px solid var(--accent-600);
  border-radius: 12px;
  padding: 14px 48px 14px 18px;
  min-height: 56px;
  display: flex;
  align-items: center;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.arabic-age-box:nth-child(2) {
  background: #fff;
  border-right-color: var(--ink-300);
}

.arabic-text-main {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-700);
  line-height: 1.4;
  letter-spacing: -0.01em;
  transition: color 0.3s ease;
}

.arabic-text-detail {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-700);
  line-height: 1.5;
}

.copy-icon-btn {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--accent-600);
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  transition: background 0.15s ease, color 0.3s ease;
}

.copy-icon-btn:hover {
  background: var(--accent-50);
}

.copy-icon-btn.copied {
  color: #059669;
}

.copy-icon-btn.copy-failed {
  color: var(--red-700);
}

/* Live summary grid (years/months/days/hours/minutes/seconds) */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

@media (max-width: 640px) {
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.summary-box {
  background: var(--ink-50);
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  padding: 13px 6px;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.3s ease;
}

.summary-box:hover {
  transform: translateY(-2px);
  border-color: var(--accent-100);
}

.summary-label {
  font-size: 0.68rem;
  color: var(--ink-400);
  margin-bottom: 4px;
  font-weight: 600;
}

.summary-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-700);
  line-height: 1;
  transition: color 0.3s ease;
  font-variant-numeric: tabular-nums;
}

/* Life stage badge */
.life-stage-container {
  display: flex;
  justify-content: center;
  margin: 6px 0 24px;
}

.life-stage-badge {
  background: var(--accent-50);
  color: var(--accent-700);
  border: 1px solid var(--accent-100);
  padding: 9px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

/* Gregorian / Hijri comparison cards */
.calendar-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}

@media (max-width: 560px) {
  .calendar-split {
    grid-template-columns: 1fr;
  }
}

.cal-card {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 14px;
  padding: 16px;
  border-top-width: 3px;
}

.cal-card.gregorian {
  border-top-color: var(--greg-500);
}

.cal-card.hijri {
  border-top-color: var(--hijri-500);
}

.cal-card h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
}

.cal-card.gregorian h3 {
  color: var(--greg-600);
}

.cal-card.hijri h3 {
  color: var(--hijri-600);
}

.cal-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  border-bottom: 1px dashed var(--ink-200);
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.cal-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cal-label {
  color: var(--ink-400);
  font-weight: 500;
  white-space: nowrap;
}

.cal-value {
  color: var(--ink-900);
  font-weight: 600;
  text-align: left;
}

/* Units grid */
.units-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 480px) {
  .units-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.unit-card {
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  border-radius: 12px;
  padding: 13px;
  text-align: center;
}

.unit-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}

.unit-lbl {
  font-size: 0.75rem;
  color: var(--ink-400);
}

/* Countdown */
.countdown-card {
  position: relative;
  background: linear-gradient(135deg, var(--accent-500), var(--accent-700));
  color: #fff;
  border-radius: 16px;
  padding: 26px 18px;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 14px 30px -12px var(--accent-700);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.countdown-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(220px 140px at 90% -20%, rgba(255, 255, 255, 0.18), transparent 60%),
    radial-gradient(200px 140px at 5% 120%, rgba(255, 255, 255, 0.12), transparent 60%);
  pointer-events: none;
}

.countdown-title {
  position: relative;
  font-size: 0.92rem;
  margin-bottom: 6px;
  opacity: 0.9;
  font-weight: 600;
}

.countdown-date {
  position: relative;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.cd-timer {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.cd-item {
  min-width: 56px;
  padding: 8px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
}

.cd-item strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cd-item span {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  opacity: 0.85;
}

/* Fun facts */
.fun-facts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 560px) {
  .fun-facts-grid {
    grid-template-columns: 1fr;
  }
}

.fact-card {
  background: var(--accent-50);
  border: 1px solid var(--accent-100);
  border-radius: 12px;
  padding: 13px;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.15s ease;
}

.fact-card:hover {
  transform: translateY(-2px);
}

.fact-title {
  font-size: 0.72rem;
  color: var(--accent-700);
  font-weight: 700;
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.fact-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}

/* Share URL */
.share-url-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: var(--ink-50);
  border: 1px solid var(--ink-200);
  padding: 14px;
  border-radius: 10px;
}

.share-url-box {
  flex: 1;
  min-width: 140px;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--ink-600);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  direction: ltr;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
}

.copy-url-btn,
.share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 18px;
  font-size: 0.88rem;
  white-space: nowrap;
}

@media (max-width: 500px) {
  .share-url-container {
    flex-direction: column;
    align-items: stretch;
  }
  .copy-url-btn,
  .share-btn {
    justify-content: center;
  }
}

/* Hero CTAs */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  height: 50px;
  padding: 0 24px;
  text-decoration: none;
}

/* Section header (shared by how-to / features / comparison) */
.section-header {
  text-align: center;
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.section-header p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--ink-600);
  font-size: 0.96rem;
}

/* All calculators grid */
.calculators-section {
  padding-top: 12px;
  padding-bottom: 48px;
}

.calculators-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 640px) {
  .calculators-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .calculators-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.calculator-card {
  position: relative;
  display: block;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 18px;
  padding: 22px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.calculator-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-100);
}

.calculator-card.is-current {
  border-color: var(--accent-500);
  background: var(--accent-50);
}

.calculator-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-50);
  color: var(--accent-600);
  margin-bottom: 14px;
}

.calculator-card.is-current .calculator-card-icon {
  background: #fff;
}

.calculator-card-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-600);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.calculator-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
}

.calculator-card p {
  margin: 0;
  color: var(--ink-600);
  font-size: 0.89rem;
  line-height: 1.6;
}

/* How-to-use steps */
.how-to-section {
  padding-top: 12px;
  padding-bottom: 48px;
}

.steps-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
}

/* Vertical connecting line running down the right side, behind the markers. */
.steps-timeline::before {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  right: 21px;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--ink-200) 0,
    var(--ink-200) 5px,
    transparent 5px,
    transparent 11px
  );
}

.timeline-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  width: 100%;
  padding: 14px 8px;
  border: none;
  background: transparent;
  font-family: inherit;
  text-align: right;
  cursor: pointer;
  border-radius: 14px;
  transition: background 0.2s ease;
}

.timeline-step:hover,
.timeline-step:focus-visible {
  background: var(--ink-50);
}

.timeline-marker {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.timeline-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent-500);
  color: var(--accent-700);
  font-weight: 800;
  font-size: 1.1rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.timeline-step:hover .timeline-number,
.timeline-step:focus-visible .timeline-number {
  background: var(--accent-500);
  color: #fff;
}

.timeline-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding-top: 8px;
}

.timeline-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-900);
}

.timeline-arrow {
  color: var(--accent-600);
  font-size: 0.85rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.timeline-step:hover .timeline-arrow,
.timeline-step:focus-visible .timeline-arrow {
  opacity: 1;
  transform: translateX(0);
}

.timeline-desc {
  color: var(--ink-600);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Momentary highlight applied to the calculator control a step points to. */
@keyframes gotoHighlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
  15%, 65% { box-shadow: 0 0 0 4px var(--accent-100); }
}

.goto-highlight {
  animation: gotoHighlight 1.6s ease;
  border-radius: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .goto-highlight {
    animation: none;
    outline: 3px solid var(--accent-500);
    outline-offset: 2px;
  }
}

/* Features grid */
.features-section {
  padding-top: 12px;
  padding-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-100);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--accent-50);
  color: var(--accent-600);
  margin-bottom: 14px;
  transition: background 0.3s ease, color 0.3s ease;
}

.feature-card h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 700;
}

.feature-card p {
  margin: 0;
  color: var(--ink-600);
  font-size: 0.89rem;
}

/* Gregorian/Hijri comparison */
.comparison-section {
  padding-top: 12px;
  padding-bottom: 48px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 640px) {
  .comparison-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.comparison-grid .card {
  border-top-width: 3px;
}

.comparison-grid .card:first-child {
  border-top-color: var(--greg-500);
}

.comparison-grid .card:last-child {
  border-top-color: var(--hijri-500);
}

.comparison-grid .card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 800;
}

.comparison-grid .card:first-child h3 {
  color: var(--greg-600);
}

.comparison-grid .card:last-child h3 {
  color: var(--hijri-600);
}

.comparison-grid .card p {
  margin: 0 0 16px;
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-list li {
  position: relative;
  padding-right: 26px;
  font-size: 0.88rem;
  color: var(--ink-700);
}

.check-list li::before {
  content: "";
  position: absolute;
  right: 0;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-100);
  box-shadow: inset 0 0 0 4px var(--accent-600);
}

/* Closing CTA */
.closing-section {
  padding-top: 12px;
  padding-bottom: 48px;
}

.closing-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-500), var(--accent-700));
  color: #fff;
  border-radius: 24px;
  padding: 40px 24px;
  text-align: center;
  box-shadow: 0 20px 40px -16px var(--accent-700);
}

.closing-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(360px 220px at 85% -10%, rgba(255, 255, 255, 0.16), transparent 60%),
    radial-gradient(320px 220px at 10% 120%, rgba(255, 255, 255, 0.10), transparent 60%);
  pointer-events: none;
}

.closing-card h2,
.closing-card p,
.closing-btn {
  position: relative;
}

.closing-card h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.closing-card p {
  margin: 0 auto 24px;
  max-width: 560px;
  font-size: 0.96rem;
  opacity: 0.95;
  line-height: 1.75;
}

.closing-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  height: 52px;
  padding: 0 30px;
  text-decoration: none;
  background: #fff;
  color: var(--accent-700);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.35);
}

.closing-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* Info + FAQ sections */
.info-section,
.faq-section {
  padding-top: 12px;
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-section .wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-top: 3px solid var(--ink-200);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

@media (min-width: 640px) {
  .card {
    padding: 32px;
  }
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  color: var(--ink-600);
  font-size: 0.95rem;
}

.faq-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 22px;
  text-align: center;
  letter-spacing: -0.01em;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.faq-item.open {
  border-color: var(--accent-100);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: none;
  border: none;
  padding: 18px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-900);
  text-align: right;
  cursor: pointer;
}

.faq-chevron {
  flex-shrink: 0;
  transition: transform 0.25s ease, color 0.2s ease;
  color: var(--ink-400);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--accent-600);
}

.faq-answer {
  padding: 0 20px 20px;
  color: var(--ink-600);
  font-size: 0.92rem;
  border-top: 1px solid var(--ink-100);
  padding-top: 14px;
}

/* Ad slots: hidden until monetization is enabled */
.ad-slot {
  display: none;
}

/* Footer */
.site-footer {
  background: var(--greg-50);
  border-top: 1px solid var(--greg-100);
}

.site-footer .wrap {
  padding: 40px 16px 0;
}

.footer-top {
  display: flex;
  flex-direction: column-reverse;
  gap: 32px;
}

@media (min-width: 720px) {
  .footer-top {
    flex-direction: row;
    justify-content: space-between;
    gap: 40px;
  }
}

.footer-brand {
  max-width: 480px;
}

.footer-brand-name {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink-900);
}

.footer-brand-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.9;
  color: var(--ink-600);
}

.footer-nav-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink-900);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--ink-600);
  font-size: 0.88rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent-700);
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 32px;
  padding: 18px 0;
  border-top: 1px solid var(--greg-100);
  text-align: center;
}

.copyright {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-400);
}
