:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  color: #23332d;
  background: #eef3ef;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --green: #174c40;
  --muted: #62716b;
  --line: #dce5df;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  padding: 8px 12px;
  background: linear-gradient(145deg, #e8f0ea, #f5f7f4 55%, #e8efea);
}

.card {
  width: min(100%, 470px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #d5dfd8;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 18px 48px #203d301c;
}

.brand {
  position: relative;
  display: grid;
  min-height: 76px;
  place-items: center;
  overflow: hidden;
  background: var(--green);
  color: #fff;
}

.brand-image, .brand-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.brand-image { object-fit: cover; object-position: center 44%; opacity: .42; }
.brand-shade { background: linear-gradient(90deg, #103b33c9, #143f34a8); }
.brand h1 { position: relative; margin: 0; padding: 20px; text-align: center; font-size: clamp(1.35rem, 5vw, 1.8rem); letter-spacing: .04em; }

.status { padding: 8px 18px 7px; text-align: center; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.reminder { min-height: 29px; margin: 0; color: var(--green); font-size: clamp(1.3rem, 6vw, 1.7rem); font-weight: 700; }
.location-label { margin: 2px 0 0; color: var(--muted); font-size: .86rem; }

.controls { padding: 8px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8faf8; }
.controls label { display: block; margin-bottom: 5px; font-size: .84rem; font-weight: 700; }
.control-row { display: flex; gap: 8px; }
select, button { min-height: 36px; border: 1px solid #cbd7cf; border-radius: 8px; font: inherit; }
select { flex: 1; min-width: 0; padding: 0 11px; background: #fff; color: inherit; }
button { cursor: pointer; }
.secondary-button { padding: 0 12px; background: #fff; color: var(--green); font-size: .88rem; font-weight: 700; }
.secondary-button:hover, .sound-button:hover { background: #edf5ef; }
.helper { min-height: 1em; margin: 4px 0 0; color: var(--muted); font-size: .76rem; }
.helper:empty { display: none; }
.server-time { margin: 6px 0 0; color: var(--muted); font-size: .82rem; }
.server-time time { color: #263b32; font-variant-numeric: tabular-nums; font-weight: 700; }

.schedule-wrap { padding: 7px 16px 2px; }
.schedule { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.45; }
th, td { padding: 5px 9px; border-bottom: 1px solid #e1e9e3; text-align: right; white-space: nowrap; }
th { color: #52635a; font-size: .84rem; font-weight: 700; }
th:first-child, td:first-child { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { color: #263b32; font-weight: 700; }
td:not(:first-child) { color: #1e3028; font-variant-numeric: tabular-nums; font-weight: 600; }
td small { display: inline-block; color: #53665c; font-size: .82rem; font-weight: 400; }
.prayer-arabic { font-family: "Noto Naskh Arabic", "Noto Sans Arabic", "Traditional Arabic", serif; font-size: 1.05em; font-weight: 700; }
.hijri { margin: 0 0 5px; color: var(--green); font-size: .86rem; line-height: 1.4; text-align: center; }

.actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 20px 2px; }
.text-link { color: var(--green); font-size: .88rem; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.sound-button { padding: 0 12px; background: #fff; color: var(--green); font-size: .82rem; font-weight: 700; }
.sound-button[aria-pressed="true"] { border-color: #8db39d; background: #edf5ef; }
.sound-message { padding: 0 20px; }

#map-link { font-weight: normal; font-size: 0.8rem; }

footer { display: flex; align-items: center; gap: 10px; padding: 8px 20px 9px; }
footer img { display: block; object-fit: contain; }
footer p { margin: 0 0 0 auto; color: #78847e; font-size: .72rem; }
footer p a { color: inherit; }

@media (max-width: 420px) {
  body { padding: 12px 8px; }
  .card { border-radius: 13px; }
  .controls { padding-right: 16px; padding-left: 16px; }
  .schedule-wrap { padding-right: 12px; padding-left: 12px; }
  .actions { padding-right: 16px; padding-left: 16px; }
  .sound-message { padding-right: 16px; padding-left: 16px; }
  footer { padding-right: 16px; padding-left: 16px; }
  th, td { padding-right: 7px; padding-left: 7px; }
}
