:root {
  --bg: #f4f7f2;
  --surface: #ffffff;
  --ink: #15231d;
  --muted: #627066;
  --line: #dce5dd;
  --accent: #0f7b5f;
  --accent-dark: #085944;
  --gold: #d99f2b;
  --rose: #e64b40;
  --blue: #245ec7;
  --shadow: 0 18px 55px rgba(31, 59, 47, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, #fff8e8 0%, #f3fbf5 44%, #eef5ff 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 212, 90, 0.28), transparent 30%),
    radial-gradient(circle at 76% 30%, rgba(36, 94, 199, 0.26), transparent 32%),
    linear-gradient(135deg, #10251e 0%, #0f7b5f 52%, #245ec7 100%);
  color: #ffffff;
  opacity: 1;
  transition: opacity 320ms ease, visibility 320ms ease;
}

.splash-screen.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.splash-card {
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
}

.splash-card img {
  width: 116px;
  height: 116px;
  border-radius: 28px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
}

.splash-card strong {
  margin-top: 8px;
  font-size: 2.2rem;
}

.splash-card span {
  color: #e3fff1;
  font-weight: 800;
}

.splash-loader {
  width: 96px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  margin-top: 14px;
  overflow: hidden;
}

.splash-loader::before {
  content: "";
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd45a, #ff6b4a);
  animation: splashLoad 900ms ease-in-out infinite alternate;
}

@keyframes splashLoad {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(138%);
  }
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.mobile-header,
.bottom-tabs {
  display: none;
}

.sidebar {
  background:
    linear-gradient(180deg, #10251e 0%, #173b31 62%, #0d1f27 100%);
  color: #f7fbf8;
  padding: 28px 20px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 34px;
}

.brand.compact {
  margin-bottom: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.72);
  color: #10251e;
  font-weight: 800;
  overflow: hidden;
  padding: 4px;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1.1rem;
}

.brand div span {
  margin-top: 2px;
  color: #b9c8bf;
  font-size: 0.84rem;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d8e2dd;
  padding: 0 12px;
  text-align: left;
  transition: background 160ms ease, color 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  background: #1c3b30;
  color: #ffffff;
}

.nav-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold);
  font-weight: 800;
}

.content {
  padding: 32px;
  min-width: 0;
}

.topbar,
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.location-pill,
.connection-pill,
.time-pill,
.share-button {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 700;
}

.share-button {
  background: #ffffff;
  color: var(--accent-dark);
  min-height: 40px;
}

.share-button:hover {
  background: #edf5f1;
}

.connection-pill {
  min-height: 40px;
  color: #085944;
}

.time-pill {
  min-height: 40px;
  color: #1d4f8f;
}

.connection-pill.offline {
  background: #fff8e8;
  border-color: #edce86;
  color: #74510d;
}

.panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel.active {
  display: block;
}

.ad-slot {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 92px;
  border: 1px dashed rgba(15, 123, 95, 0.46);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.96), rgba(237, 249, 242, 0.96));
  color: var(--muted);
  text-align: center;
}

.ad-slot span {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ad-slot strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.ad-slot small {
  max-width: 100%;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  padding: 0 10px;
  word-break: break-all;
}

.sidebar-ad {
  margin-top: 28px;
  min-height: 170px;
  background:
    linear-gradient(145deg, rgba(255, 212, 90, 0.18), rgba(255, 255, 255, 0.08));
  border-color: rgba(255, 255, 255, 0.28);
}

.sidebar-ad strong {
  color: #ffffff;
}

.sidebar-ad span {
  color: #ffe39a;
}

.sidebar-ad small {
  color: #cce9dd;
}

.hero-ad {
  margin-bottom: 24px;
}

.feed-ad {
  margin-top: 22px;
}

.calculation-note {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 12px 0 0;
}

.prayer-home {
  border-color: #cfe3d8;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.98)),
    linear-gradient(135deg, #ffe8a8 0%, #dff5e7 40%, #dce8ff 100%);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px 180px;
  gap: 20px;
  align-items: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #123628 0%, #0f7b5f 44%, #245ec7 100%);
  color: #ffffff;
  margin-bottom: 24px;
  min-height: 190px;
  overflow: hidden;
  padding: 24px;
  position: relative;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 6px;
  background: linear-gradient(90deg, var(--gold), var(--rose), var(--blue), var(--accent));
}

.hero-copy,
.hero-emblem,
.next-prayer-card {
  position: relative;
  z-index: 1;
}

.hero-copy .eyebrow {
  color: #ffe39a;
}

.hero-copy h2 {
  max-width: 560px;
  margin-bottom: 10px;
  font-size: clamp(1.7rem, 3vw, 2.65rem);
}

.hero-copy p:last-child {
  max-width: 580px;
  color: #e8f6ef;
  line-height: 1.6;
  margin-bottom: 0;
}

.hero-emblem {
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
  padding: 15px;
}

.hero-emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.next-prayer-card {
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  padding: 18px;
  backdrop-filter: blur(12px);
}

.next-prayer-card span,
.next-prayer-card small {
  display: block;
  color: #e8f6ef;
  font-weight: 800;
}

.next-prayer-card strong {
  display: block;
  margin: 8px 0;
  color: #ffe39a;
  font-size: 2rem;
}

.primary-action,
.secondary-action,
.list-row button {
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-action,
.list-row button {
  background: var(--accent);
  color: #ffffff;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--accent-dark);
}

.primary-action:hover,
.list-row button:hover {
  background: var(--accent-dark);
}

.secondary-action:hover {
  background: #edf5f1;
}

.prayer-grid,
.ramadan-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.time-card,
.ramadan-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 18px;
}

.time-card span,
.ramadan-grid span {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.time-card strong,
.ramadan-grid strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 1.45rem;
}

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

.time-card.current {
  border-color: #e9c66e;
  background: #fff8e8;
}

.time-card {
  position: relative;
  overflow: hidden;
}

.time-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
}

.time-card.fajr::before {
  background: #d99f2b;
}

.time-card.dhuhr::before {
  background: #0f7b5f;
}

.time-card.asr::before {
  background: #245ec7;
}

.time-card.maghrib::before {
  background: #e64b40;
}

.time-card.isha::before {
  background: #6b4bc4;
}

.time-card.fajr {
  background: #fff8e8;
}

.time-card.dhuhr {
  background: #edf9f2;
}

.time-card.asr {
  background: #eef5ff;
}

.time-card.maghrib {
  background: #fff1eb;
}

.time-card.isha {
  background: #f3efff;
}

.list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.auto-azaan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #cfe3d8;
  border-radius: 8px;
  background: #f5fbf8;
  margin-top: 24px;
  padding: 18px;
}

.auto-azaan-card h3 {
  margin-bottom: 8px;
}

.auto-azaan-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.auto-actions {
  display: grid;
  gap: 10px;
  min-width: 170px;
}

.support-note {
  margin-top: 10px;
  font-size: 0.9rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #fff8e8;
  color: #74510d;
  margin-bottom: 12px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill.enabled {
  background: #ddf3e8;
  color: #085944;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.list-row strong,
.list-row span {
  display: block;
}

.list-row span {
  margin-top: 4px;
  color: var(--muted);
}

.qibla-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 26px;
  align-items: center;
  margin-top: 24px;
}

.compass {
  position: relative;
  display: grid;
  width: 220px;
  height: 220px;
  place-items: center;
  border: 12px solid #dfe9e2;
  border-radius: 50%;
  background: #f9fbf9;
}

.compass span {
  position: absolute;
  top: 18px;
  color: var(--muted);
  font-weight: 800;
}

.needle {
  position: absolute;
  width: 8px;
  height: 84px;
  background: var(--gold);
  border-radius: 999px;
  transform: rotate(45deg) translateY(-20px);
  transform-origin: bottom center;
}

.compass strong {
  z-index: 1;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  padding: 9px 14px;
}

.settings-form,
.notice-composer {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  max-width: 640px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
  padding: 12px 14px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.toggle-row input {
  width: 22px;
  height: 22px;
}

@media (max-width: 880px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .app-shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
    background:
      linear-gradient(120deg, #10251e 0%, #0f7b5f 42%, #245ec7 100%);
    color: #ffffff;
    padding: 12px 16px;
    box-shadow: 0 12px 30px rgba(16, 37, 30, 0.22);
  }

  .mobile-actions {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .mobile-header .brand div span {
    color: #e3fff1;
  }

  .compact-share {
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 0 12px;
    backdrop-filter: blur(10px);
  }

  .download-button {
    min-height: 40px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffd45a, #ff6b4a);
    color: #10251e;
    padding: 0 14px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
  }

  .download-button:disabled {
    cursor: default;
    opacity: 0.75;
  }

  .sidebar {
    display: none;
  }

  .bottom-tabs {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 25;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    box-shadow: 0 -16px 34px rgba(31, 59, 47, 0.12);
    backdrop-filter: blur(14px);
  }

  .tab-item {
    display: grid;
    gap: 3px;
    min-width: 0;
    min-height: 52px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
  }

  .tab-item span {
    font-size: 1.15rem;
    line-height: 1;
  }

  .tab-item small {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tab-item.active {
    background: #e7f2ec;
    color: var(--accent-dark);
  }

  .content {
    padding: 18px 16px 92px;
  }

  .topbar,
  .section-header,
  .list-row,
  .auto-azaan-card {
    align-items: stretch;
    flex-direction: column;
  }

  .auto-actions {
    min-width: 0;
  }

  .topbar {
    margin-bottom: 16px;
  }

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

  .topbar .share-button {
    display: none;
  }

  h1 {
    font-size: 2rem;
  }

  .qibla-card {
    grid-template-columns: 1fr;
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .sidebar-ad {
    display: none;
  }

  .hero-emblem {
    width: 104px;
    height: 104px;
  }

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

@media (max-width: 520px) {
  .brand.compact div span {
    display: none;
  }

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

  .panel {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 18px 16px;
    margin-right: -16px;
    margin-left: -16px;
  }

  .home-hero {
    margin: -2px -2px 20px;
    min-height: auto;
    padding: 20px;
  }

  .hero-copy h2 {
    font-size: 1.8rem;
  }

  .location-pill,
  .connection-pill,
  .time-pill,
  .share-button {
    width: 100%;
  }

  .mobile-actions .share-button,
  .mobile-actions .download-button {
    width: auto;
  }

  .qibla-card {
    justify-items: center;
    text-align: center;
  }

  .compass {
    width: min(220px, 78vw);
    height: min(220px, 78vw);
  }

  .list-row button,
  .auto-actions,
  .secondary-action,
  .primary-action {
    width: 100%;
  }
}
