@font-face {
  font-family: Fraunces;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/fraunces-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Fraunces;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/fraunces-latinext-500.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Fraunces;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/fraunces-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Fraunces;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/fraunces-latinext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/outfit-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/outfit-latinext-400.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/outfit-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/outfit-latinext-500.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/outfit-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/outfit-latinext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --bg0: #f6f3ec;
  --bg1: #f6f3ec;
  --bg2: #f6f3ec;
  --accent: #0c3d34;
  --accent-ink: #ffffff;
  --accent-soft: rgba(12, 61, 52, 0.14);
  --ink: #141414;
  --muted: #2c2c2c;
  --faint: #3f3f3f;
  --line: rgba(20, 20, 20, 0.18);
  --chip: #ffffff;
  --nav: #fffdf8;
  --serif: Fraunces, "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --sans: Outfit, "Avenir Next", "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg0: #141614;
  --bg1: #141614;
  --bg2: #141614;
  --accent: #9ddec8;
  --accent-ink: #06241e;
  --accent-soft: rgba(157, 222, 200, 0.18);
  --ink: #f6f3ec;
  --muted: #e7e2d8;
  --faint: #c9c3b6;
  --line: rgba(246, 243, 236, 0.28);
  --chip: #222522;
  --nav: #0e100e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 20px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--bg0);
  -webkit-text-size-adjust: 100%;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(90% 55% at 100% -10%, var(--bg2), transparent 58%),
    radial-gradient(80% 50% at -15% 110%, var(--bg1), transparent 55%),
    var(--bg0);
}

.sky::after { content: none; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  z-index: 5;
}
.skip:focus { top: 0.6rem; }

.app {
  width: min(32rem, 100%);
  margin: 0 auto;
  padding: calc(0.45rem + env(safe-area-inset-top)) 1rem calc(6.6rem + env(safe-area-inset-bottom));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.theme-toggle {
  flex: none;
  min-height: 2.8rem;
  padding: 0.35rem 0.85rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.theme-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.theme-choices button {
  min-height: 3.3rem;
  padding: 0.4rem 0.2rem;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--chip);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.theme-choices button[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.theme-choices + .hint { margin-top: 0.7rem; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.place, .install, .ghost, .primary, .iconbtn, .textbtn, .tabs button, .result {
  font: inherit;
  color: inherit;
}

.place {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.4rem;
  margin-top: 0.75rem;
  border-radius: 16px;
  padding: 0.7rem 1rem;
  border: 2px solid var(--ink);
  background: var(--chip);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: left;
}
.place-action {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  flex: none;
}

.place span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install, .ghost, .primary {
  border-radius: 999px;
  padding: 0.7rem 1rem;
  cursor: pointer;
}

.install-banner {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  min-height: 3.3rem;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
}
.steps {
  margin: 0.4rem 0 1rem;
  padding-left: 1.3rem;
  font-size: 1.15rem;
}
.steps li { margin: 0.75rem 0; }
.steps li strong { color: var(--ink); }
#install-later { margin-top: 0.55rem; }

.ghost {
  border: 1px solid var(--line);
  background: var(--chip);
}

.primary {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
}
.big { min-height: 3.4rem; font-size: 1.2rem; font-weight: 700; width: 100%; }
.extra { margin-top: 1rem; }
.extra summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.7rem 0;
}

.iconbtn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--chip);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}

.textbtn {
  border: 0;
  background: none;
  color: var(--accent);
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.dateline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  align-items: baseline;
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.dateline strong { color: var(--ink); font-weight: 500; }

#offline-flag {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.kicker {
  margin: 0;
  letter-spacing: 0;
  text-transform: none;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
}

.display {
  margin: 0.45rem 0 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 9vw, 3.3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.lede {
  color: var(--muted);
  max-width: 36ch;
}

.welcome-actions, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

#welcome-geo-status:empty { display: none; }
#welcome-geo:disabled, #geo-button:disabled { opacity: 0.7; }

#welcome { padding: 2.2rem 0 1rem; }

.daynav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
}
.daybtn {
  min-height: 3rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--chip);
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
}

.daynav-label {
  margin: 0;
  text-align: center;
  font-size: 0.98rem;
}

.daynav-label p { margin: 0; }

.hero { text-align: left; padding: 0.35rem 0 0; }
.track { display: none; }

.hero h1, .qibla-place, .month-caption {
  margin: 0.35rem 0 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.hero h1 { font-size: 1.7rem; line-height: 1.1; display: inline; margin-right: 0.45rem; }

.hero-time {
  margin: 0;
  display: inline;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.5rem;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.hero-time.is-word {
  display: block;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 0.15rem;
}

.hero-sub, .live-chip, .qibla-readout, .qibla-distance {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.live-chip {
  display: inline-block;
  margin-top: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}

.track {
  height: 3px;
  width: min(100%, 16rem);
  margin: 1.15rem auto 0;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}

.track span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.times {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

body:has(#install-button:not([hidden])) .install-banner { margin-top: 0.4rem; min-height: 3rem; }
body:has(#install-button:not([hidden])) .place { margin-top: 0.4rem; }
body:has(#install-button:not([hidden])) .dateline { margin-top: 0.35rem; }
body:has(#install-button:not([hidden])) .daynav { margin-top: 0.35rem; }
body:has(#install-button:not([hidden])) .times { margin-top: 0.5rem; }
body:has(#install-button:not([hidden])) .times li {
  min-height: 2.5rem;
  padding-top: 0.18rem;
  padding-bottom: 0.18rem;
}

.times li {
  display: grid;
  grid-template-columns: 1.1rem 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.45rem 0.15rem;
  border-bottom: 1px solid var(--line);
  min-height: 2.8rem;
}

.mark {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  justify-self: center;
}

.pname { font-size: 1.2rem; font-weight: 600; }

.times time {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.times li.past { color: var(--faint); }
.times li.past .mark { border-color: var(--faint); }
.times li.current {
  background: var(--accent-soft);
  border-radius: 12px;
  border-bottom-color: transparent;
}
.times li.current .pname,
.times li.current time { color: var(--accent); font-weight: 700; }
.times li.current .mark {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.sunnah {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.95rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.sunnah time {
  font-family: var(--serif);
  color: var(--ink);
  font-size: 1.05rem;
  margin-left: 0.3rem;
}

.footnote, .hint, .about p, .need-place {
  color: var(--muted);
  font-size: 0.92rem;
}

.footnote { margin: 0.75rem 0 0; display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; align-items: baseline; }
.footnote .textbtn { font-size: 0.92rem; }

.weekdays, .month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
}

.weekdays { margin-top: 0.8rem; }

.weekdays span {
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.month-grid { margin-top: 0.35rem; }

.month-grid button, .month-grid .pad {
  aspect-ratio: 1;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
}

.month-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  cursor: pointer;
}

.month-grid button { font-size: 1.15rem; font-weight: 700; }
.month-grid button small { display: none; }

.month-grid button.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.month-grid button.is-selected { background: var(--accent-soft); }
.month-grid button.is-friday { color: var(--accent); }

.month-caption {
  font-size: 1.35rem;
  margin-top: 1.2rem;
}

.qibla-place { font-size: 1.8rem; }

.compass {
  --heading: 0deg;
  --qibla: 0deg;
  width: min(78vw, 280px);
  aspect-ratio: 1;
  margin: 1.4rem auto 0.4rem;
  position: relative;
  border-radius: 50%;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 50%, transparent 0 58%, var(--accent-soft) 59% 61%, transparent 62%),
    var(--chip);
}

.rose, .needle {
  position: absolute;
  inset: 0;
  transition: transform 180ms linear;
}

.rose { transform: rotate(calc(var(--heading) * -1)); }
.needle { transform: rotate(calc(var(--qibla) - var(--heading))); }

.dir {
  position: absolute;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.dir.n { top: 8%; left: 50%; transform: translateX(-50%); color: var(--accent); }
.dir.s { bottom: 8%; left: 50%; transform: translateX(-50%); }
.dir.e { right: 8%; top: 50%; transform: translateY(-50%); }
.dir.w { left: 8%; top: 50%; transform: translateY(-50%); }

.needle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12%;
  width: 2px;
  height: 38%;
  background: var(--accent);
  transform: translateX(-50%);
}

.needle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8%;
  border: 7px solid transparent;
  border-bottom-color: var(--accent);
  transform: translateX(-50%);
}

.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}

.qibla-readout { text-align: center; font-size: 1.15rem; }
.qibla-readout strong {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  color: var(--ink);
}
.qibla-distance { text-align: center; }
#compass-permit { display: block; margin: 1rem auto 0; }
#compass-note { text-align: center; }

.vesvese-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 0.75rem;
  padding: 0.7rem;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--chip);
}

.vesvese-card[hidden] { display: none; }

.vesvese-home {
  position: relative;
  align-items: flex-start;
  margin: 0.85rem 0 0.15rem;
  padding: 2.55rem 0.7rem 0.75rem;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.vesvese-home.is-leaving {
  opacity: 0;
  transform: translateY(-0.4rem);
  pointer-events: none;
}

.vesvese-besmele {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  max-width: calc(100% - 0.9rem);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg0);
  color: var(--accent);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.38rem 0.7rem;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .vesvese-home { transition: none; }
}

.vesvese-card img {
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 14px;
  object-fit: cover;
  flex: none;
  background: #141614;
}

.vesvese-card strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
}

.vesvese-card p {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.vesvese-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.vesvese-actions:has(#vesvese-try:not([hidden])) {
  grid-template-columns: 1fr 1fr;
}

.vesvese-actions .ghost {
  width: 100%;
  min-height: 3rem;
  font-weight: 700;
}

.group { margin-top: 1.5rem; }

.group h2 {
  margin: 0 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
}

select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

select, input[type="search"], input[type="number"], input[type="text"], #tz-input {
  font: inherit;
  font-size: 1.15rem;
  color: var(--ink);
  background: var(--chip);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.8rem;
  min-height: 3.3rem;
  width: 100%;
}

.adj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.8rem;
}

.adj-grid label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  color: var(--muted);
}

.adj-grid input { width: 4.6rem; text-align: center; padding-inline: 0.3rem; }

.about p { margin: 0 0 0.7rem; }
#reset-button { margin-top: 0.4rem; }
#share-app { margin-top: 0.15rem; }

.tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(32rem, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.2rem;
  padding: 0.35rem 0.4rem calc(0.45rem + env(safe-area-inset-bottom));
  background: var(--nav);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  z-index: 2;
}

.tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  padding: 0.45rem 0 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  cursor: pointer;
}

.tabs button[aria-current="page"] { color: var(--accent); }
.tabs svg { width: 1.55rem; height: 1.55rem; }
.tabs { border-top: 2px solid var(--line); }

dialog {
  width: min(32rem, 100%);
  max-width: 100%;
  max-height: min(92dvh, 820px);
  margin: auto auto 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: var(--bg0);
  border-radius: 22px 22px 0 0;
}

dialog::backdrop { background: rgba(0, 0, 0, 0.48); }

.sheet {
  display: flex;
  flex-direction: column;
  max-height: min(92dvh, 820px);
  padding: 0.9rem 1.1rem calc(1rem + env(safe-area-inset-bottom));
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sheet-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.6rem;
}

.wide { width: 100%; margin-top: 0.8rem; }

.results {
  overflow: auto;
  min-height: 8rem;
  margin-top: 0.2rem;
}

.results h3 {
  margin: 0.9rem 0 0.15rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.result {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
  padding: 1rem 0.1rem;
  min-height: 3.5rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 600;
}

.result small { color: var(--muted); }

.coord { margin-top: 0.8rem; color: var(--muted); }
.coord summary { cursor: pointer; }
.coord-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.7rem;
}
.coord label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.92rem; }

#notify-copy {
  margin: 0.9rem 0 1rem;
  font-size: 1.08rem;
  line-height: 1.45;
}

#notify-dialog .big + .big { margin-top: 0.55rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(5.3rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  margin: 0;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg0);
  z-index: 6;
  font-size: 0.9rem;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (min-width: 720px) {
  dialog {
    margin: auto;
    border-radius: 22px;
    border: 1px solid var(--line);
  }
  .sheet { padding-bottom: 1.1rem; }
}

@media (min-width: 720px) and (max-width: 959.98px) and (min-height: 700px) {
  .app,
  .tabs { width: min(44rem, calc(100% - 2.5rem)); }
}

@media (min-width: 720px) and (min-height: 700px) {
  #view-month [data-has-place] {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(14.5rem, 0.85fr);
    column-gap: 1.75rem;
    align-items: start;
  }

  #view-month .daynav { grid-column: 1; grid-row: 1; }
  #view-month .weekdays { grid-column: 1; grid-row: 2; }
  #view-month .month-grid { grid-column: 1; grid-row: 3; }
  #view-month .month-caption {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    align-self: center;
  }
  #view-month #month-times {
    grid-column: 2;
    grid-row: 2 / span 2;
    margin-top: 0.8rem;
  }
}

@media (min-width: 960px) {
  .app {
    width: min(64rem, calc(100% - 4rem));
    padding-bottom: 2.5rem;
  }

  .tabs {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    transform: none;
    width: auto;
    margin: 0.35rem 0 0.2rem;
    padding: 0.35rem 0;
    background: var(--bg0);
    border-top: 0;
    border-bottom: 2px solid var(--line);
    backdrop-filter: none;
  }

  .tabs button {
    flex-direction: row;
    justify-content: center;
    min-height: 3.1rem;
    padding: 0.45rem 0.7rem;
    font-size: 1.15rem;
    border-radius: 12px;
  }

  .tabs button[aria-current="page"] { background: var(--accent-soft); }

  #welcome {
    max-width: 36rem;
    margin-inline: auto;
  }

  #today-body {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(18rem, 0.95fr);
    column-gap: 2.25rem;
    align-items: start;
  }

  #today-body .daynav,
  #today-body .footnote { grid-column: 1 / -1; }

  #today-body .hero-time { font-size: 3.15rem; }
  #today-body .hero h1 { font-size: 2rem; }

  #today-body .times,
  body:has(#install-button:not([hidden])) .times { margin-top: 0.15rem; }

  body:has(#install-button:not([hidden])) .times li {
    min-height: 2.8rem;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }

  #view-month [data-has-place] {
    grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
    column-gap: 2.25rem;
  }

  #view-qibla,
  #view-settings {
    max-width: 36rem;
    margin-inline: auto;
  }

  #view-qibla { text-align: center; }
  #view-qibla .qibla-place { text-align: center; }

  .toast { bottom: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  .sky, .tabs, .daynav button, .actions, .install, #welcome { display: none !important; }
  body, .app { background: white; color: black; }
  .app { padding-bottom: 0; }
  .times time, .hero-time, .wordmark { color: black; }
}
