:root {
  --ink: #172b27;
  --muted: #65736d;
  --emerald: #0f3d35;
  --teal: #2f7f75;
  --gold: #c99a3d;
  --clay: #a85d3a;
  --ivory: #fbf6ea;
  --paper: #f4ead8;
  --line: rgba(23, 43, 39, 0.13);
  --shadow: 0 18px 60px rgba(23, 43, 39, 0.12);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(201, 154, 61, 0.2), transparent 32%),
    linear-gradient(135deg, var(--ivory), #eef4ed 62%, var(--paper));
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 44px);
  background: rgba(251, 246, 234, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    linear-gradient(150deg, var(--gold), #f1d68a 54%, var(--clay));
  box-shadow: inset 0 0 0 5px rgba(15, 61, 53, 0.14);
}

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fffaf0;
  color: var(--emerald);
  cursor: pointer;
}

main {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
}

.flash {
  margin: 18px 0 0;
  padding: 12px 16px;
  border: 1px solid rgba(47, 127, 117, 0.25);
  border-radius: 8px;
  background: rgba(47, 127, 117, 0.08);
  color: var(--emerald);
}

.memorial-hero {
  min-height: calc(100svh - 88px);
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  padding: 44px 0 28px;
}

.portrait-wrap {
  width: min(190px, 46vw);
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--gold), var(--teal));
  box-shadow: var(--shadow);
}

.portrait {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  display: block;
  object-fit: cover;
  background: var(--paper);
}

.status,
.years,
.section-heading p,
.daily-card > p,
.home-hero > p:first-child {
  color: var(--clay);
  font-weight: 800;
}

.memorial-hero h1 {
  margin: 8px 0 4px;
  font-size: clamp(34px, 8vw, 72px);
  line-height: 1.08;
}

.years {
  margin: 0;
  color: var(--muted);
}

blockquote {
  max-width: 720px;
  margin: 26px 0 0;
  padding: 0;
  color: var(--emerald);
  font-size: clamp(20px, 3.5vw, 32px);
  line-height: 1.8;
  font-weight: 700;
}

.bio-band,
.reminder-band,
.share-panel,
.daily-card,
.payment-panel,
.admin-settings {
  margin: 24px 0;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
  box-shadow: var(--shadow);
}

.bio-band,
.reminder-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.bio-band h2,
.daily-card h2,
.reminder-band h2,
.share-panel h2,
.payment-panel h2,
.admin-settings h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
}

.bio-band p,
.daily-card p,
.reminder-band p,
.share-panel p,
.payment-panel p,
.admin-settings p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.price-note {
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(201, 154, 61, 0.14);
  color: var(--emerald);
  font-weight: 800;
}

code {
  direction: ltr;
  display: inline-block;
  max-width: 100%;
  padding: 3px 6px;
  border-radius: 6px;
  overflow-wrap: anywhere;
  background: rgba(15, 61, 53, 0.08);
  color: var(--emerald);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.action-tile {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  align-content: space-between;
  background: rgba(255, 250, 240, 0.66);
  transition: transform 160ms ease, border-color 160ms ease;
}

.action-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 154, 61, 0.72);
}

.action-tile span {
  font-size: 28px;
}

.action-tile strong {
  font-size: 18px;
}

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

.content-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.content-sections article,
.message-card,
.admin-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
}

.content-sections h2,
.message-card p,
.admin-card h2 {
  margin-top: 0;
}

.wide-card {
  grid-column: span 2;
}

.quran-reader {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(15, 61, 53, 0.06);
}

.quran-reader h3 {
  margin: 0;
  color: var(--emerald);
}

.quran-reader p {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 2.1;
}

.quran-reader span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-inline-start: 6px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.zikr-item {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.zikr-item:first-of-type {
  border-top: 0;
}

.zikr-item strong {
  color: var(--emerald);
}

.zikr-item p {
  margin: 8px 0;
  line-height: 1.8;
}

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

.counter {
  width: 86px;
  height: 86px;
  border: 0;
  border-radius: 50%;
  background: var(--emerald);
  color: var(--ivory);
  font-size: 28px;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.dua-button,
.primary-link,
.secondary-link {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button,
.dua-button,
.primary-link {
  background: var(--emerald);
  color: var(--ivory);
}

.secondary-button,
.secondary-link {
  background: #fffaf0;
  color: var(--emerald);
  border: 1px solid var(--line);
}

.messages,
.message-form,
.admin-shell,
.home-shell,
.create-shell {
  padding: 36px 0;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 48px);
}

.message-list,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.message-card strong {
  color: var(--emerald);
}

.message-card p,
.admin-card p {
  color: var(--muted);
  line-height: 1.8;
}

form {
  display: grid;
  gap: 14px;
}

.create-form {
  max-width: 760px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.74);
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

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

textarea {
  resize: vertical;
}

form p {
  margin: 0;
  color: var(--muted);
}

.admin-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.admin-stats span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(47, 127, 117, 0.1);
  color: var(--emerald);
  font-size: 13px;
  font-weight: 800;
}

.payment-table {
  display: grid;
  gap: 10px;
}

.payment-table article {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.68);
}

.payment-table span {
  color: var(--emerald);
  font-weight: 800;
}

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

.home-shell {
  min-height: calc(100svh - 140px);
  display: grid;
  align-items: center;
}

.home-hero {
  max-width: 760px;
}

.home-hero h1 {
  margin: 0;
  font-size: clamp(38px, 8vw, 82px);
  line-height: 1.08;
}

.home-hero p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.9;
}

.home-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.footer {
  width: min(1040px, calc(100% - 32px));
  margin: 28px auto 0;
  padding: 18px 0 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .brand small {
    display: none;
  }

  .memorial-hero {
    min-height: auto;
  }

  .bio-band,
  .reminder-band {
    align-items: stretch;
    flex-direction: column;
  }

  .action-grid,
  .content-sections,
  .message-list,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .wide-card {
    grid-column: auto;
  }

  .footer {
    flex-direction: column;
  }

  .payment-table article {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .action-tile {
    transition: none;
  }
}
