:root {
  --ink: #eee8dc;
  --ink-soft: #a9b5ae;
  --ink-faint: #778781;
  --emerald-950: #061310;
  --emerald-900: #091b17;
  --emerald-850: #0d241e;
  --indigo: #111827;
  --glass: rgba(18, 43, 36, 0.68);
  --glass-strong: rgba(22, 50, 42, 0.9);
  --line: rgba(225, 218, 197, 0.11);
  --line-strong: rgba(222, 190, 128, 0.28);
  --gold: #d2b071;
  --gold-soft: #ecd8ad;
  --sage: #9cae9f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --radius: 26px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
  color: var(--ink);
  background: var(--emerald-950);
  font-family: Inter, "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--emerald-950); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% -5%, rgba(210, 176, 113, 0.13), transparent 28rem),
    radial-gradient(circle at 6% 42%, rgba(48, 73, 92, 0.18), transparent 30rem),
    linear-gradient(150deg, #071713 0%, #091a17 47%, #0a151b 100%);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: radial-gradient(rgba(255,255,255,.16) .45px, transparent .45px);
  background-size: 5px 5px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 3px;
}
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  font-family: "Cormorant Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.018em;
}
h1 { font-size: clamp(2.35rem, 10vw, 4.7rem); line-height: .98; margin-bottom: .75rem; }
h2 { font-size: clamp(1.55rem, 6vw, 2.4rem); line-height: 1.08; margin-bottom: .65rem; }
h3 { font-size: 1.35rem; line-height: 1.15; margin-bottom: .45rem; }
p { line-height: 1.66; }

.skip-link {
  position: fixed; left: 14px; top: -100px; z-index: 100;
  background: var(--gold-soft); color: var(--emerald-950); padding: 10px 16px; border-radius: 12px;
}
.skip-link:focus { top: 12px; }
.app-shell { min-height: 100vh; }
.sidebar {
  display: none; position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 20;
  padding: 32px 22px 26px; background: rgba(6, 19, 16, .86);
  border-right: 1px solid var(--line); backdrop-filter: blur(24px);
}
.brand-button {
  display: inline-flex; align-items: center; gap: 10px; border: 0; background: transparent;
  padding: 0; color: var(--ink); text-align: left;
}
.brand-button img { width: 34px; height: 34px; object-fit: contain; }
.brand-word {
  font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.48rem;
  letter-spacing: .16em; text-transform: uppercase;
}
.desktop-nav { display: grid; gap: 7px; margin-top: 46px; }
.nav-button {
  min-height: 50px; padding: 0 14px; display: flex; align-items: center; gap: 12px;
  border: 1px solid transparent; border-radius: 16px; background: transparent;
  color: var(--ink-faint); text-align: left; transition: .22s ease;
}
.nav-button:hover { color: var(--ink); background: rgba(255,255,255,.035); }
.nav-button.active { color: var(--gold-soft); background: rgba(210,176,113,.08); border-color: rgba(210,176,113,.15); }
.nav-glyph { width: 22px; text-align: center; font-size: 1rem; }
.sidebar-note { margin-top: auto; padding: 20px 4px 0; border-top: 1px solid var(--line); }
.sidebar-note p { margin: 5px 0 0; color: var(--ink-faint); font-size: .8rem; line-height: 1.5; }
.app-column { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 15; height: 72px; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(7, 23, 19, .72); border-bottom: 1px solid rgba(255,255,255,.045);
  backdrop-filter: blur(22px) saturate(125%);
}
.topbar-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.quiet-button, .icon-button, .secondary-button {
  min-height: 42px; min-width: 42px; border-radius: 99px; border: 1px solid var(--line);
  background: rgba(255,255,255,.035); padding: 0 14px;
}
.icon-button { padding: 0; font-size: 1.2rem; }
#content { position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; padding: 28px 18px calc(104px + var(--safe-bottom)); }
.eyebrow, .day-label {
  display: inline-block; margin-bottom: 9px; color: var(--gold);
  font-size: .68rem; font-weight: 750; letter-spacing: .18em; text-transform: uppercase;
}
.page-header { max-width: 680px; margin: 8px 0 30px; }
.page-header p, .today-header p, .gentle-heading p { color: var(--ink-soft); margin-bottom: 0; }

.today-header {
  position: relative; display: flex; justify-content: space-between; align-items: flex-start;
  min-height: 148px; padding: 12px 4px 20px;
}
.today-header h1 { margin-bottom: .55rem; }
.today-header p { font-size: .83rem; letter-spacing: .04em; }
.today-mark {
  position: absolute; right: -38px; top: -28px; width: 150px; height: 150px;
  object-fit: contain; opacity: .1; filter: saturate(.7);
}
.intention-card {
  width: 100%; min-height: 86px; margin: 2px 0 18px; padding: 16px 48px 16px 18px;
  display: grid; gap: 3px; position: relative; text-align: left;
  color: var(--ink); border: 1px solid var(--line); border-radius: 22px 30px 22px 30px;
  background: linear-gradient(115deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  backdrop-filter: blur(18px);
}
.intention-card .eyebrow { margin: 0; }
.intention-copy {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.14rem; color: #ddd8cc;
}
.edit-mark { position: absolute; right: 18px; top: 32px; color: var(--ink-faint); }
.glass-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(25,55,46,.72), rgba(13,34,29,.56));
  box-shadow: inset 0 1px rgba(255,255,255,.035), 0 18px 55px rgba(0,0,0,.14);
  backdrop-filter: blur(22px);
}
.fasting-card {
  padding: 21px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 17px;
}
.fasting-card h2 { margin: 0; font-size: 1.42rem; }
.pill-switch {
  width: 100%; display: grid; grid-template-columns: 1fr 1.35fr; gap: 5px;
  padding: 5px; border-radius: 99px; background: rgba(0,0,0,.17); border: 1px solid rgba(255,255,255,.04);
}
.pill-switch button {
  min-height: 43px; border: 0; border-radius: 99px; background: transparent; color: var(--ink-faint);
}
.pill-switch button.selected {
  color: #211b10; background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  box-shadow: 0 6px 26px rgba(210,176,113,.18); font-weight: 750;
}
.salah-card { margin-top: 14px; padding: 21px 15px 17px; }
.section-heading { padding-inline: 5px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin-bottom: 0; }
.crescent { color: var(--gold); font-size: 1.25rem; opacity: .72; }
.salah-row { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 6px; margin-top: 19px; }
.salah-button {
  min-height: 72px; position: relative; overflow: hidden; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.06); border-radius: 17px 17px 22px 22px;
  background: rgba(4,19,16,.31); color: var(--ink-faint); font-size: .68rem; letter-spacing: .015em;
}
.salah-button.selected {
  color: #f5e6c7; border-color: rgba(229,195,128,.38);
  background: linear-gradient(150deg, rgba(208,167,91,.2), rgba(32,51,39,.65));
  box-shadow: 0 0 26px rgba(210,176,113,.12), inset 0 0 22px rgba(210,176,113,.06);
}
.prayer-glow {
  width: 5px; height: 5px; margin-bottom: -10px; border-radius: 50%;
  background: currentColor; opacity: .38;
}
.salah-button.selected .prayer-glow { background: var(--gold-soft); opacity: 1; box-shadow: 0 0 10px var(--gold); }
.quiet-invitation {
  position: relative; overflow: hidden; margin-top: 14px; padding: 24px;
  display: grid; gap: 20px; border: 1px solid rgba(117,134,160,.14); border-radius: 30px 20px 30px 20px;
  background: linear-gradient(145deg, rgba(22,29,48,.82), rgba(7,25,24,.88));
}
.quiet-invitation::after {
  content: "☾"; position: absolute; right: -8px; top: -35px;
  color: rgba(236,216,173,.055); font-size: 9rem; font-family: serif;
}
.quiet-invitation h2 { max-width: 520px; margin-bottom: 0; font-size: 1.45rem; }
.amber-button {
  position: relative; z-index: 1; width: fit-content; min-height: 48px; padding: 0 20px;
  border: 1px solid rgba(236,216,173,.36); border-radius: 99px;
  color: #211a0f; background: linear-gradient(135deg, #ead4a5, #cda963);
  box-shadow: 0 10px 30px rgba(210,176,113,.13); font-weight: 750;
}
.amber-button span { margin-left: 12px; }

.gentle-heading { margin: 34px 3px 18px; max-width: 650px; }
.gentle-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.gentle-tile {
  min-height: 150px; padding: 17px; display: flex; flex-direction: column; align-items: flex-start;
  text-align: left; border: 1px solid var(--line); border-radius: 22px 30px 22px 22px;
  background: linear-gradient(145deg, rgba(26,57,48,.66), rgba(12,33,28,.52));
}
.gentle-tile.active { border-color: var(--line-strong); box-shadow: 0 0 34px rgba(210,176,113,.09); }
.gentle-tile .tile-glyph { color: var(--gold); font-size: 1.2rem; margin-bottom: auto; }
.gentle-tile strong { margin: 18px 0 5px; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.2rem; font-weight: 500; }
.gentle-tile small { color: var(--ink-faint); line-height: 1.45; }
.return-fasting {
  margin: 22px auto 0; display: block; border: 0; background: transparent; color: var(--ink-faint);
  font-size: .75rem; text-decoration: underline; text-underline-offset: 5px;
}

.quran-counter {
  padding: 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.large-number { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 4rem; line-height: .8; color: var(--gold-soft); }
.stepper { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 99px; }
.stepper button { width: 45px; height: 44px; border: 0; background: transparent; font-size: 1.1rem; }
.stepper output { min-width: 40px; text-align: center; color: var(--ink-soft); }
.verse-card {
  margin-top: 14px; padding: 30px 22px; text-align: center; border: 1px solid rgba(111,126,155,.15);
  border-radius: 34px 22px 34px 22px; background: linear-gradient(155deg, rgba(21,28,48,.78), rgba(10,29,27,.78));
}
.verse-card h2 { font-size: 1.8rem; }
.verse-card > p:last-child { margin: 0; color: var(--ink-faint); font-size: .75rem; letter-spacing: .09em; }
.arabic { font-family: "Noto Naskh Arabic", "Amiri Quran", serif; font-size: 1.65rem; line-height: 2; direction: rtl; }

.search-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.search-row input, label input, label textarea, label select {
  width: 100%; min-height: 49px; padding: 13px 15px; border: 1px solid var(--line);
  border-radius: 16px; background: rgba(255,255,255,.045); color: var(--ink);
}
.search-row input::placeholder, textarea::placeholder, input::placeholder { color: var(--ink-faint); }
label { display: grid; gap: 7px; font-weight: 650; }
label span { font-size: .82rem; color: var(--ink-soft); }
textarea { resize: vertical; line-height: 1.55; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 15px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  min-height: 39px; padding: 0 14px; white-space: nowrap; border: 1px solid var(--line);
  border-radius: 99px; background: transparent; color: var(--ink-faint);
}
.chip.active { color: var(--gold-soft); border-color: var(--line-strong); background: rgba(210,176,113,.08); }
.item-list { display: grid; gap: 12px; margin-top: 4px; }
.item-card {
  padding: 20px; border: 1px solid var(--line); border-radius: 22px 30px 22px 22px;
  background: linear-gradient(145deg, rgba(24,51,43,.66), rgba(10,31,26,.5));
}
.item-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.item-card h3 { margin-bottom: 0; }
.item-card p { color: #d1d3cb; }
.muted { color: var(--ink-faint) !important; }
.star-button, .small-button {
  min-width: 42px; min-height: 42px; border: 0; border-radius: 50%; background: rgba(255,255,255,.025); color: var(--ink-faint);
}
.star-button.active { color: var(--gold-soft); text-shadow: 0 0 12px rgba(210,176,113,.45); }
.item-actions { display: flex; gap: 4px; }
.text-button { min-height: 40px; padding: 0 5px; border: 0; background: transparent; color: var(--ink-faint); text-decoration: underline; text-underline-offset: 4px; }
.button-row { display: flex; align-items: center; margin-bottom: 17px; }
.empty-state { padding: 38px 22px; text-align: center; color: var(--ink-faint); border: 1px dashed var(--line-strong); border-radius: 24px; }
.journal-entry { padding-block: 24px; }

.quiet-mode { background: #040b0d; }
.quiet-mode .topbar, .quiet-mode .sidebar, .quiet-mode .mobile-nav { display: none !important; }
.quiet-mode .app-column { margin-left: 0; }
.quiet-mode #content { max-width: none; min-height: 100vh; padding: 0; }
.quiet-screen {
  min-height: 100vh; position: relative; overflow: hidden; display: grid; place-items: center; padding: 56px 22px;
  background:
    radial-gradient(circle at 50% 45%, rgba(49,69,92,.18), transparent 24rem),
    radial-gradient(circle at 50% 100%, rgba(36,76,63,.18), transparent 28rem),
    linear-gradient(165deg, #050d10, #080f18 55%, #071511);
}
.quiet-screen::before {
  content: ""; position: absolute; inset: 0; opacity: .25;
  background-image: radial-gradient(rgba(236,216,173,.28) .5px, transparent .5px);
  background-size: 27px 27px; mask-image: radial-gradient(circle, black 0, transparent 75%);
}
.quiet-orbit {
  position: absolute; width: min(82vw, 520px); aspect-ratio: 1; border: 1px solid rgba(210,176,113,.07);
  border-radius: 48% 52% 46% 54%; transform: rotate(18deg); box-shadow: 0 0 90px rgba(49,69,92,.08);
}
.quiet-content { position: relative; z-index: 1; width: min(100%, 620px); text-align: center; }
.quiet-mark { width: 58px; margin: 0 auto 12px; opacity: .35; filter: saturate(.7); }
.dua-focus {
  position: relative; margin: 22px 0 24px; padding: 32px 22px 29px;
  border: 1px solid rgba(236,216,173,.18); border-radius: 38px 24px 38px 24px;
  background: rgba(8,23,25,.5); box-shadow: inset 0 1px rgba(255,255,255,.025), 0 30px 90px rgba(0,0,0,.28);
  backdrop-filter: blur(20px);
}
.focus-star { color: var(--gold); font-size: .8rem; }
.dua-focus .arabic { margin: 18px 0 12px; color: var(--gold-soft); font-size: clamp(1.7rem, 7vw, 2.45rem); }
.dua-focus h1 { font-size: clamp(1.8rem, 7vw, 3rem); line-height: 1.12; }
.dua-focus > p:last-child { margin-bottom: 0; color: var(--ink-faint); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.quiet-actions { display: flex; justify-content: center; align-items: center; gap: 12px; }
.quiet-next {
  width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: rgba(210,176,113,.06); color: var(--gold-soft); font-size: 1.15rem;
}
.quiet-exit {
  position: absolute; z-index: 3; right: 18px; top: calc(18px + env(safe-area-inset-top, 0px));
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,.025); color: var(--ink-faint); font-size: 1.35rem;
}

.settings-card { padding: 4px 20px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row p { margin: 5px 0 0; color: var(--ink-faint); font-size: .8rem; line-height: 1.5; }
.modal {
  width: min(560px, calc(100% - 26px)); max-height: calc(100vh - 30px); overflow: auto;
  border: 1px solid var(--line); border-radius: 28px; padding: 0;
  color: var(--ink); background: linear-gradient(150deg, #102820, #0b1b19); box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(2,8,9,.74); backdrop-filter: blur(7px); }
.modal form { padding: 28px; display: grid; gap: 16px; }
.modal h1, .modal h2, .modal p { margin-bottom: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 5px; }
.modal-actions.single { justify-content: center; }
.primary-button, .secondary-button { min-height: 46px; padding: 0 18px; border-radius: 99px; font-weight: 700; }
.primary-button { border: 1px solid rgba(236,216,173,.34); color: #211a0f; background: linear-gradient(135deg, #ead4a5, #cda963); }
.onboarding-mark, .dialog-mark { width: 76px; opacity: .7; }
.onboarding-mark { margin: 0 auto; }
.check-row { display: flex; align-items: center; gap: 10px; }
.check-row input { width: 20px; min-height: auto; height: 20px; accent-color: var(--gold); }
.security-note { padding: 14px; border-radius: 15px; background: rgba(210,176,113,.08); color: #d5c7aa; }
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(92px + var(--safe-bottom));
  max-width: calc(100% - 30px); padding: 11px 17px; text-align: center;
  border: 1px solid var(--line-strong); border-radius: 99px; background: rgba(12,31,27,.96); color: var(--gold-soft);
  opacity: 0; pointer-events: none; transform: translate(-50%, 18px); transition: .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-nav {
  position: fixed; z-index: 18; left: 12px; right: 12px; bottom: calc(10px + var(--safe-bottom));
  min-height: 72px; padding: 7px; display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid rgba(236,216,173,.11); border-radius: 24px;
  background: rgba(6,20,18,.9); box-shadow: 0 18px 50px rgba(0,0,0,.4); backdrop-filter: blur(24px);
}
.mobile-nav .nav-button {
  min-height: 56px; padding: 5px 2px; justify-content: center; flex-direction: column; gap: 3px;
  border-radius: 17px; font-size: .61rem; letter-spacing: .02em;
}
.mobile-nav .nav-button.active { background: rgba(210,176,113,.075); }
.mobile-nav .nav-glyph { font-size: .95rem; }
.skeleton { height: 100px; border-radius: 24px; background: linear-gradient(90deg, rgba(255,255,255,.02), rgba(255,255,255,.055), rgba(255,255,255,.02)); background-size: 220% 100%; animation: shimmer 1.8s ease infinite; }
@keyframes shimmer { to { background-position-x: -220%; } }

@media (min-width: 640px) {
  #content { padding-inline: 32px; }
  .fasting-card { flex-direction: row; align-items: center; }
  .pill-switch { width: 290px; }
  .quiet-invitation { grid-template-columns: 1fr auto; align-items: center; }
  .gentle-grid { gap: 14px; }
  .gentle-tile { min-height: 178px; }
  .search-row { flex-direction: row; align-items: center; }
  .search-row input { flex: 1; }
}
@media (min-width: 980px) {
  .sidebar { display: flex; flex-direction: column; }
  .app-column { margin-left: 260px; }
  .topbar { height: 78px; padding-inline: 36px; }
  .mobile-brand, .mobile-nav { display: none; }
  #content { padding: 46px 46px 80px; }
  .today-mark { width: 190px; height: 190px; }
  .toast { bottom: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
