:root {
  color-scheme: light;
  --green-900: #073b2f;
  --green-800: #0b4d3d;
  --green-700: #0f5d43;
  --green-600: #13855c;
  --gold-600: #b68a1f;
  --gold-500: #d3a63a;
  --gold-100: #fff4d6;
  --ink: #15211f;
  --muted: #63736f;
  --line: #dce7e1;
  --surface: #ffffff;
  --soft: #f5f8f6;
  --blue: #276a8f;
  --shadow: 0 22px 55px rgba(7, 59, 47, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100%;
  margin: 0;
  font-family: "Cairo", Tahoma, Arial, sans-serif;
  background:
    linear-gradient(180deg, #eef5f1 0, #f7faf8 360px, #f6f8f7 100%),
    var(--soft);
  color: var(--ink);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100vw;
  overflow-x: hidden;
}

.topbar {
  width: min(1180px, calc(100% - 28px));
  min-height: 88px;
  margin: 18px auto 0;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 93, 67, 0.12);
  border-radius: 20px;
  box-shadow: 0 16px 45px rgba(7, 59, 47, 0.09);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
}

.brand p,
.brand h1 {
  margin: 0;
}

.brand p {
  color: var(--gold-600);
  font-weight: 800;
  font-size: 0.92rem;
}

.brand h1 {
  color: var(--green-900);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 900;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-links a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--green-800);
  text-decoration: none;
  font-weight: 800;
  border: 1px solid var(--line);
  background: #fff;
}

main {
  width: min(1180px, calc(100% - 28px));
  margin: 22px auto 0;
  flex: 1;
}

.hero {
  min-height: 310px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 22px;
  align-items: stretch;
  padding: clamp(20px, 4vw, 38px);
  border-radius: 26px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(7, 59, 47, 0.98), rgba(15, 93, 67, 0.94)),
    linear-gradient(135deg, var(--green-800), var(--green-600));
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset-inline-start: 6%;
  bottom: 0;
  width: 62%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(211, 166, 58, 0.95), transparent);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.eyebrow {
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  color: #ffe9aa;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.9rem;
  font-weight: 800;
}

.hero h2 {
  margin: 14px 0 10px;
  max-width: 740px;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1.16;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.hero p {
  max-width: 660px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.today-card {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 13px;
  padding: 24px;
  border-radius: 24px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(15, 93, 67, 0.12);
}

.today-card span {
  width: fit-content;
  color: var(--green-700);
  background: #e9f5ef;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 900;
}

.today-card strong {
  display: block;
  color: var(--green-900);
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  line-height: 1.55;
}

.tool-tabs {
  margin: 22px 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.tool-tab {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--green-900);
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 10px 25px rgba(7, 59, 47, 0.05);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tool-tab:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 93, 67, 0.35);
}

.tool-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  border-color: transparent;
}

.tool-panel {
  display: none;
  padding: clamp(18px, 3vw, 28px);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.tool-panel.active {
  display: block;
}

.section-heading {
  margin-bottom: 22px;
  text-align: center;
}

.section-heading p,
.section-heading h2 {
  margin: 0;
}

.section-heading p {
  color: var(--gold-600);
  font-weight: 900;
}

.section-heading h2 {
  color: var(--green-900);
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  font-weight: 900;
}

.converter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-card {
  min-height: 100%;
  padding: clamp(16px, 3vw, 26px);
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wide-card {
  width: min(760px, 100%);
  margin: 0 auto;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title h3 {
  margin: 0;
  color: var(--green-900);
  font-size: 1.2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 5px 12px;
  color: var(--green-800);
  background: #e9f5ef;
  border-radius: 999px;
  font-weight: 900;
}

.badge.gold {
  color: #7a5600;
  background: var(--gold-100);
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--green-900);
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdfc;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 4px rgba(19, 133, 92, 0.12);
}

.date-fields,
.two-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.primary-button {
  min-height: 54px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(15, 93, 67, 0.18);
}

.gold-button {
  background: linear-gradient(135deg, #a77912, var(--gold-500));
  box-shadow: 0 14px 26px rgba(182, 138, 31, 0.18);
}

.result-box {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: 16px;
  color: var(--green-900);
  background: #f2f7f4;
  border: 1px solid #dcebe4;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 900;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-grid div {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f9fbfa, #eef6f1);
  border: 1px solid var(--line);
}

.metric-grid strong {
  color: var(--green-900);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
}

.metric-grid span {
  color: var(--muted);
  font-weight: 800;
}

.dual-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dual-results h3 {
  margin: 0 0 10px;
  color: var(--green-900);
  text-align: center;
  font-size: 1.05rem;
}

.months-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.month-item {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f6faf8);
}

.month-item strong {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  background: var(--green-700);
  flex: 0 0 auto;
}

.month-item span {
  color: var(--green-900);
  font-weight: 900;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.secondary-button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--green-800);
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.prayer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.prayer-item {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #eff7f2);
}

.prayer-item span {
  color: var(--muted);
  font-weight: 800;
}

.prayer-item strong {
  color: var(--green-900);
  font-size: 1.35rem;
  direction: ltr;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.segmented label {
  display: block;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green-900);
  font-weight: 900;
  cursor: pointer;
}

.segmented input:checked + span {
  color: #fff;
  background: linear-gradient(135deg, var(--green-700), var(--blue));
  border-color: transparent;
}

footer {
  width: min(1180px, calc(100% - 28px));
  margin: 22px auto 18px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
}

footer p {
  margin: 0;
  font-weight: 800;
}

@media (max-width: 860px) {
  .topbar,
  .hero,
  .converter-grid,
  .tool-tabs {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    justify-content: center;
    text-align: center;
  }

  .top-links {
    justify-content: center;
  }

  .hero {
    min-height: auto;
  }

  .tool-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .date-fields,
  .duration-fields,
  .two-columns,
  .metric-grid,
  .segmented,
  .dual-results,
  .months-grid,
  .button-row,
  .prayer-grid,
  .tool-tabs {
    grid-template-columns: 1fr;
  }

  .hero,
  .tool-panel,
  .tool-card {
    border-radius: 18px;
  }

  .hero h2 {
    max-width: 300px;
    font-size: 1.45rem;
    line-height: 1.45;
    text-align: center;
  }

  .hero p {
    max-width: 310px;
    font-size: 0.98rem;
    text-align: center;
  }

  .hero-copy {
    align-items: center;
    text-align: center;
  }

  .eyebrow {
    max-width: 100%;
    text-align: center;
    white-space: normal;
  }

  .today-card {
    text-align: center;
  }

  .today-card span {
    margin-inline: auto;
  }

  .brand-icon {
    width: 52px;
    height: 52px;
  }
}
