:root {
  --bg: #f6fbf9;
  --surface: #ffffff;
  --surface-soft: #f2f8f5;
  --surface-blue: #eef7fb;
  --ink: #102224;
  --muted: #5d7072;
  --soft-ink: #29484b;
  --faint: #dfe9e5;
  --faint-strong: #cadfd8;
  --emerald: #0f7a5c;
  --emerald-dark: #0a5f48;
  --sky: #2d7fa3;
  --gold: #bd7e25;
  --gold-soft: #fff3da;
  --red: #9f3d36;
  --red-soft: #fff0ee;
  --shadow: 0 22px 60px rgba(16, 34, 36, 0.13);
  --shadow-soft: 0 12px 34px rgba(16, 34, 36, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(231, 246, 242, 0.86)),
    url("assets/sydney-crescent-banner.png") center top / cover fixed,
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(15, 122, 92, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 122, 92, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 9% 10%, rgba(15, 122, 92, 0.12), transparent 26%),
    radial-gradient(circle at 86% 18%, rgba(189, 126, 37, 0.13), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(246, 251, 249, 0.93) 47%, #f6fbf9);
  background-size: 72px 72px, 72px 72px, auto, auto, auto;
  opacity: 0.9;
}

button,
select {
  font: inherit;
}

svg {
  display: block;
}

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 10px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 70px;
  margin-top: 14px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(223, 233, 229, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 900;
  text-decoration: none;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--emerald), #0b634d);
  box-shadow: 0 12px 26px rgba(15, 122, 92, 0.24);
  border-radius: var(--radius);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.location-select {
  min-width: 250px;
  min-height: 42px;
  padding: 0 38px 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(16, 34, 36, 0.05);
}

.hero-band {
  position: relative;
  overflow: hidden;
  min-height: 278px;
  margin-top: 22px;
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 253, 251, 0.92) 52%, rgba(228, 243, 238, 0.7) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(15, 122, 92, 0.06));
  box-shadow: var(--shadow);
}

.hero-band::after {
  position: absolute;
  right: 26px;
  bottom: 20px;
  width: 210px;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(189, 126, 37, 0.7), transparent);
}

.hero-art {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(58%, 690px);
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.62;
  mask-image: linear-gradient(90deg, transparent 0%, #000 32%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  min-height: 278px;
  padding: 38px;
}

.location-line,
.today-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 700;
}

.icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--emerald);
}

.icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 620px;
  margin-bottom: 13px;
  font-size: clamp(2.8rem, 6vw, 5.9rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 14px;
  font-size: 1rem;
  letter-spacing: 0;
}

.next-prayer-panel {
  display: grid;
  gap: 5px;
  min-width: 250px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(240, 249, 246, 0.9)),
    rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(202, 223, 216, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-label,
.method-chip {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.next-prayer-panel strong {
  color: var(--emerald-dark);
  font-size: 1.35rem;
  line-height: 1.2;
}

.next-prayer-panel span:last-child {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.05rem;
  font-weight: 700;
  line-height: 1;
}

.daily-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.summary-item {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 88px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(223, 233, 229, 0.94);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.summary-icon {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--emerald);
  background: linear-gradient(135deg, #e8f5ef, #eef7fb);
  border: 1px solid #d3e7df;
  border-radius: var(--radius);
}

.summary-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.summary-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.summary-item strong,
.summary-item small {
  display: block;
}

.summary-item strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.2;
}

.summary-item small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 20px;
  margin-top: 20px;
}

.panel,
.fasting-band {
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 48px rgba(16, 34, 36, 0.08);
  backdrop-filter: blur(18px);
}

.panel {
  padding: 26px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.method-chip {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--emerald-dark);
  background: linear-gradient(135deg, #eef8f4, #f7fcfa);
  border: 1px solid #cce2d9;
  border-radius: 999px;
}

.prayer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.text-button {
  min-height: 33px;
  padding: 0 12px;
  color: var(--emerald-dark);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #b8d9cb;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
}

.text-button:hover,
.text-button:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.selected-day-panel {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
  padding: 15px;
  background:
    linear-gradient(135deg, rgba(238, 248, 244, 0.98), rgba(238, 247, 251, 0.96)),
    linear-gradient(90deg, rgba(189, 126, 37, 0.24), transparent);
  border: 1px solid #c8e0d7;
  border-radius: var(--radius);
}

.selected-day-panel strong {
  font-size: 1.05rem;
}

.selected-day-panel span:last-child {
  color: var(--muted);
  font-weight: 700;
}

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

.prayer-card {
  display: grid;
  grid-template-columns: auto minmax(76px, 1fr) minmax(104px, auto);
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 17px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(249, 253, 251, 0.92));
  border: 1px solid rgba(223, 233, 229, 0.95);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(16, 34, 36, 0.04);
}

.prayer-card.next {
  background:
    linear-gradient(135deg, rgba(238, 248, 244, 0.98), rgba(255, 255, 255, 0.96)),
    linear-gradient(90deg, rgba(15, 122, 92, 0.16), transparent);
  border-color: #9dccbb;
  box-shadow:
    inset 4px 0 0 var(--emerald),
    0 12px 28px rgba(15, 122, 92, 0.09);
}

.prayer-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--emerald);
  background: linear-gradient(135deg, #e1f2eb, #edf8f4);
  border-radius: var(--radius);
}

.prayer-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.prayer-name {
  display: block;
  font-weight: 850;
}

.prayer-meta {
  display: block;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 650;
}

.prayer-time {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.48rem;
  font-weight: 700;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.source-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(238, 247, 251, 0.98), rgba(244, 250, 247, 0.98));
  border: 1px solid #dbecea;
  border-radius: var(--radius);
}

.source-note p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.calendar-heading {
  align-items: center;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: var(--emerald);
  border-color: #aed4c5;
  outline: none;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day,
.calendar-empty {
  min-height: 92px;
  padding: 9px;
  border-radius: var(--radius);
}

.calendar-empty {
  background: rgba(247, 250, 248, 0.62);
}

.calendar-day {
  display: flex;
  flex-direction: column;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  gap: 6px;
  background: rgba(251, 253, 252, 0.92);
  border: 1px solid rgba(223, 233, 229, 0.96);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.calendar-day:hover,
.calendar-day:focus-visible {
  border-color: #9dccbb;
  box-shadow: 0 10px 24px rgba(16, 34, 36, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.calendar-day.today {
  border-color: var(--emerald);
  box-shadow:
    inset 0 0 0 1px var(--emerald),
    0 8px 18px rgba(15, 122, 92, 0.09);
}

.calendar-day.selected {
  background: linear-gradient(135deg, #eef8f4, #fff8eb);
  border-color: var(--gold);
  box-shadow:
    inset 0 0 0 1px var(--gold),
    0 10px 24px rgba(189, 126, 37, 0.12);
}

.calendar-number-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.gregorian-day {
  font-weight: 850;
}

.hijri-day {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.tag-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}

.day-tag,
.legend {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 850;
  line-height: 1.1;
}

.fast {
  color: #0f5f4a;
  background: #e4f3ee;
}

.white-days {
  color: #23657f;
  background: #e7f4fa;
}

.ramadan {
  color: #684610;
  background: var(--gold-soft);
}

.special {
  color: #74420c;
  background: #ffead0;
}

.shawwal {
  color: #19666c;
  background: #e4f8f9;
}

.eid {
  color: var(--red);
  background: var(--red-soft);
}

.more-tag {
  color: var(--muted);
  background: #f1f5f3;
}

.fasting-band {
  margin-top: 20px;
  padding: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 253, 252, 0.94)),
    radial-gradient(circle at 8% 15%, rgba(15, 122, 92, 0.08), transparent 30%);
}

.legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

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

.info-panel {
  padding: 18px 18px 12px;
  background: rgba(251, 253, 252, 0.72);
  border: 1px solid rgba(223, 233, 229, 0.92);
  border-radius: var(--radius);
}

.info-panel h3 {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 8px;
  color: var(--soft-ink);
}

.event-list {
  display: grid;
  gap: 0;
}

.event-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 74px;
  padding: 14px 0;
  border-top: 1px solid var(--faint);
}

.event-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.event-title {
  display: block;
  margin-bottom: 2px;
  font-weight: 850;
}

.event-date {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.event-item .day-tag {
  justify-self: end;
  white-space: nowrap;
}

.calendar-help {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
}

.footer {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 28px 0 38px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer a {
  color: var(--emerald-dark);
  font-weight: 800;
  text-decoration: none;
}

.loading,
.error {
  color: var(--muted);
  padding: 12px;
  background: #fbfdfc;
  border: 1px solid var(--faint);
  border-radius: var(--radius);
}

.error {
  color: var(--red);
  background: var(--red-soft);
}

@media (max-width: 920px) {
  .topbar,
  .hero-content,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: static;
    padding: 16px 0;
    margin-top: 0;
    border-radius: 0;
    border-right: 0;
    border-left: 0;
  }

  .topbar-actions,
  .location-select {
    width: 100%;
  }

  .hero-content {
    min-height: 330px;
    justify-content: flex-end;
    padding: 24px;
  }

  .hero-art {
    width: 100%;
    opacity: 0.46;
    mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  }

  .next-prayer-panel {
    min-width: 0;
  }

  .dashboard-grid,
  .info-grid,
  .daily-strip {
    grid-template-columns: 1fr;
  }

  .method-chip {
    align-self: flex-start;
  }

  .prayer-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .site-shell {
    width: min(100% - 20px, 1180px);
  }

  .panel,
  .fasting-band {
    padding: 16px;
  }

  .hero-content {
    padding: 24px;
  }

  .daily-strip {
    gap: 8px;
  }

  .summary-item {
    min-height: 76px;
    padding: 13px;
  }

  .prayer-grid {
    grid-template-columns: 1fr;
  }

  .prayer-card {
    grid-template-columns: auto minmax(70px, 1fr) minmax(98px, auto);
  }

  .prayer-time {
    font-size: 1.42rem;
  }

  .calendar-day,
  .calendar-empty {
    min-height: 70px;
    padding: 5px;
  }

  .calendar-heading {
    flex-direction: row;
    align-items: center;
  }

  .calendar-heading h2 {
    font-size: 1.35rem;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 4px;
  }

  .calendar-weekdays {
    font-size: 0.66rem;
  }

  .gregorian-day {
    font-size: 0.92rem;
  }

  .hijri-day {
    font-size: 0.62rem;
  }

  .calendar-day .day-tag {
    width: 12px;
    min-height: 12px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    border-radius: 999px;
    text-indent: -999px;
  }

  .footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
