/* =========================================================
   Munasabah Ahlul Bait — tampilan publik
   ========================================================= */

:root {
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Marcellus', Georgia, serif;
  --font-ar: 'Amiri', 'Traditional Arabic', serif;

  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* Tema terang (perkamen & zamrud) */
  --bg: #f6f0e1;
  --bg-2: #efe6cf;
  --surface: #fffdf7;
  --surface-2: #f8f2e3;
  --text: #1b2a25;
  --muted: #66746d;
  --line: rgba(120, 94, 30, .16);
  --gold: #a57c1b;
  --gold-2: #c9a13e;
  --gold-soft: rgba(201, 161, 62, .14);
  --emerald: #0f6b55;
  --emerald-2: #12846a;
  --shadow: 0 10px 30px -12px rgba(60, 45, 10, .25), 0 2px 6px rgba(60, 45, 10, .06);
  --nav-bg: rgba(255, 253, 247, .88);

  --c-wiladah: #138a69;
  --c-syahadah: #b0434f;
  --c-id: #b48a1f;
  --c-peringatan: #2f7fb3;

  --pattern-opacity: .08;
  color-scheme: light;
}

/* Tema gelap (malam & emas) */
:root[data-theme="dark"] {
  --bg: #04150f;
  --bg-2: #071d17;
  --surface: #0b241e;
  --surface-2: #0f2c25;
  --text: #f2ead6;
  --muted: #9fb1a8;
  --line: rgba(212, 175, 55, .16);
  --gold: #e3c26a;
  --gold-2: #d4af37;
  --gold-soft: rgba(212, 175, 55, .12);
  --emerald: #2fb58a;
  --emerald-2: #46c79c;
  --shadow: 0 14px 34px -14px rgba(0, 0, 0, .7), 0 2px 8px rgba(0, 0, 0, .25);
  --nav-bg: rgba(8, 30, 24, .86);

  --c-wiladah: #3ccf9c;
  --c-syahadah: #e57882;
  --c-id: #e8c35c;
  --c-peringatan: #6db8e8;

  --pattern-opacity: .07;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #04150f;
    --bg-2: #071d17;
    --surface: #0b241e;
    --surface-2: #0f2c25;
    --text: #f2ead6;
    --muted: #9fb1a8;
    --line: rgba(212, 175, 55, .16);
    --gold: #e3c26a;
    --gold-2: #d4af37;
    --gold-soft: rgba(212, 175, 55, .12);
    --emerald: #2fb58a;
    --emerald-2: #46c79c;
    --shadow: 0 14px 34px -14px rgba(0, 0, 0, .7), 0 2px 8px rgba(0, 0, 0, .25);
    --nav-bg: rgba(8, 30, 24, .86);
    --c-wiladah: #3ccf9c;
    --c-syahadah: #e57882;
    --c-id: #e8c35c;
    --c-peringatan: #6db8e8;
    --pattern-opacity: .07;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 100% 0%, var(--gold-soft), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(18, 132, 106, .10), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* Pola geometris bintang delapan */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: var(--pattern-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23c9a13e' stroke-width='1'%3E%3Cpath d='M20 20h40v40H20z'/%3E%3Cpath d='M40 11.7 68.3 40 40 68.3 11.7 40z'/%3E%3Cpath d='M0 0l20 20M80 0 60 20M0 80l20-20M80 80 60 60M40 0v11.7M40 80V68.3M0 40h11.7M80 40H68.3'/%3E%3Ccircle cx='40' cy='40' r='8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 80px;
  z-index: 0;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--emerald); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

.ico { display: inline-flex; width: 22px; height: 22px; flex: none; }
.ico svg, .icon-btn svg { width: 100%; height: 100%; }

.app {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

/* ======================= HERO ======================= */
.hero {
  position: relative;
  color: #f7f0dc;
  overflow: hidden;
  border-radius: 0 0 32px 32px;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(3, 22, 17, .55) 0%, rgba(3, 26, 20, .78) 55%, rgba(2, 18, 14, .95) 100%),
    url('../../bg.jpg') center 30% / cover no-repeat;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .13;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23e3c26a' stroke-width='1'%3E%3Cpath d='M20 20h40v40H20z'/%3E%3Cpath d='M40 11.7 68.3 40 40 68.3 11.7 40z'/%3E%3Cpath d='M0 0l20 20M80 0 60 20M0 80l20-20M80 80 60 60M40 0v11.7M40 80V68.3M0 40h11.7M80 40H68.3'/%3E%3Ccircle cx='40' cy='40' r='8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.hero-inner {
  padding: calc(14px + env(safe-area-inset-top)) 18px 34px;
}
.hero-ornament {
  height: 14px;
  background:
    radial-gradient(circle at 7px 0, transparent 6px, #d4af37 6.5px, #d4af37 7.5px, transparent 8px) 0 0 / 14px 14px repeat-x;
  opacity: .55;
  margin-top: -14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.brand img {
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(227, 194, 106, .45), 0 6px 16px rgba(0, 0, 0, .35);
}
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-family: var(--font-display); font-weight: 400; font-size: 19px; letter-spacing: .4px; }
.brand small { font-size: 11.5px; letter-spacing: 2.4px; text-transform: uppercase; color: #e3c26a; }
.brand small i { text-transform: none; letter-spacing: 0; }
.topbar-actions { display: flex; gap: 8px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(227, 194, 106, .28);
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: inherit;
  transition: transform .2s var(--ease), background .2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.ghost {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text);
}

.salawat {
  font-family: var(--font-ar);
  font-size: clamp(22px, 6vw, 30px);
  text-align: center;
  color: #ecd18a;
  margin: 26px 0 18px;
  line-height: 1.9;
  text-shadow: 0 2px 18px rgba(212, 175, 55, .35);
}

.today-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .03));
  border: 1px solid rgba(227, 194, 106, .30);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 20px 40px -20px rgba(0, 0, 0, .6);
}
.moon {
  width: 78px;
  height: 78px;
  flex: none;
  filter: drop-shadow(0 0 18px rgba(240, 220, 150, .45));
}
.moon svg { width: 100%; height: 100%; }
.today-text { min-width: 0; flex: 1; }
.today-weekday {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: #e3c26a;
  font-weight: 700;
}
.today-hijri { display: flex; align-items: center; gap: 12px; margin: 2px 0; }
.today-day {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  background: linear-gradient(180deg, #fff6d6, #e3c26a 70%, #b98d23);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.today-month { display: flex; flex-direction: column; line-height: 1.2; }
.today-month #today-month { font-family: var(--font-display); font-size: 22px; }
.today-year { font-size: 13px; color: rgba(247, 240, 220, .75); letter-spacing: 1px; }
.today-ar { font-family: var(--font-ar); font-size: 18px; color: rgba(236, 209, 138, .9); text-align: left; }
.today-greg { font-size: 13px; color: rgba(247, 240, 220, .75); margin-top: 2px; }

/* ======================= NAV ======================= */
.tabs {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  gap: 4px;
  width: min(calc(100% - 24px), 440px);
  padding: 6px;
  border-radius: 24px;
  background: var(--nav-bg);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .45);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 6px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition: background .25s var(--ease), color .25s;
}
.tab .ico { width: 22px; height: 22px; }
.tab.active {
  color: var(--gold);
  background: var(--gold-soft);
}

/* ======================= KONTEN ======================= */
.content { padding: 8px 16px 0; }
.view { display: none; animation: rise .45s var(--ease) both; }
.view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 2px 12px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-head h2::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  background: var(--gold-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0l3.5 3.5H20.5v5L24 12l-3.5 3.5v5h-5L12 24l-3.5-3.5h-5v-5L0 12l3.5-3.5v-5h5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0l3.5 3.5H20.5v5L24 12l-3.5 3.5v5h-5L12 24l-3.5-3.5h-5v-5L0 12l3.5-3.5v-5h5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* --- Kartu hari ini & terdekat --- */
.feature {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 24px;
  color: #fbf4df;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(227, 194, 106, .35), transparent 50%),
    linear-gradient(140deg, #0d4a3c 0%, #08342a 55%, #062820 100%);
  border: 1px solid rgba(227, 194, 106, .35);
  box-shadow: 0 24px 40px -22px rgba(6, 40, 32, .8);
  cursor: pointer;
  transition: transform .25s var(--ease);
}
.feature:active { transform: scale(.985); }
.feature::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 200px;
  height: 200px;
  opacity: .16;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23e3c26a' stroke-width='1.2'%3E%3Cpath d='M25 25h50v50H25z'/%3E%3Cpath d='M50 14.6 85.4 50 50 85.4 14.6 50z'/%3E%3Ccircle cx='50' cy='50' r='14'/%3E%3Ccircle cx='50' cy='50' r='46'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  animation: spin 80s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.feature.cat-syahadah {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(227, 194, 106, .22), transparent 50%),
    linear-gradient(140deg, #2a1418 0%, #1b0e12 60%, #120a0c 100%);
}
.feature.cat-id {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 226, 140, .5), transparent 55%),
    linear-gradient(140deg, #5a4210 0%, #3b2a08 60%, #2a1e06 100%);
}
.feature-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.feature h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 23px;
  margin: 14px 0 6px;
  position: relative;
  z-index: 1;
}
.feature .meta { font-size: 13.5px; color: rgba(251, 244, 223, .78); position: relative; z-index: 1; }
.countdown {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}
.countdown .num {
  font-family: var(--font-display);
  font-size: 54px;
  line-height: .9;
  color: #f1d58a;
}
.countdown .lbl { font-size: 13px; color: rgba(251, 244, 223, .8); padding-bottom: 4px; }
.feature .badge { background: rgba(255, 255, 255, .12); color: #f6e3a6; border-color: rgba(227, 194, 106, .35); }

.today-list { display: grid; gap: 12px; margin-top: 18px; }
.today-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 2px 10px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 12px;
}
.pulse {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold-2);
  box-shadow: 0 0 0 0 rgba(212, 175, 55, .6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .3px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}
.badge.cat-wiladah { color: var(--c-wiladah); background: color-mix(in srgb, var(--c-wiladah) 13%, transparent); }
.badge.cat-syahadah { color: var(--c-syahadah); background: color-mix(in srgb, var(--c-syahadah) 13%, transparent); }
.badge.cat-id { color: var(--c-id); background: color-mix(in srgb, var(--c-id) 15%, transparent); }
.badge.cat-peringatan { color: var(--c-peringatan); background: color-mix(in srgb, var(--c-peringatan) 13%, transparent); }

/* --- Timeline --- */
.timeline { display: grid; gap: 10px; }
.item {
  --c: var(--c-peringatan);
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 12px 14px 12px 12px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .2s var(--ease), border-color .2s;
  animation: rise .5s var(--ease) both;
}
.item:hover { border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.item:active { transform: scale(.985); }
.item.cat-wiladah { --c: var(--c-wiladah); }
.item.cat-syahadah { --c: var(--c-syahadah); }
.item.cat-id { --c: var(--c-id); }
.date-badge {
  position: relative;
  flex: none;
  width: 56px;
  height: 60px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 14px;
  background: color-mix(in srgb, var(--c) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  color: var(--c);
}
.date-badge b { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1; }
.date-badge small { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; }
.item-body { min-width: 0; flex: 1; }
.item-title { font-weight: 700; font-size: 14.5px; line-height: 1.35; }
.item-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.item-days {
  flex: none;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}
.item-days b { display: block; font-size: 19px; color: var(--text); font-weight: 800; }
.item-days.is-today b { color: var(--gold); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }

.empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ======================= KALENDER ======================= */
.cal-card { padding: 16px 14px 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.cal-title { text-align: center; min-width: 0; }
.cal-title h2 { font-family: var(--font-display); font-weight: 400; font-size: 22px; }
.cal-ar { font-family: var(--font-ar); color: var(--gold); font-size: 19px; line-height: 1.4; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-weekdays { margin-bottom: 6px; }
.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.cal-weekdays span:nth-child(6) { color: var(--emerald); }
.cell {
  position: relative;
  aspect-ratio: 1 / 1.08;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--surface-2);
  padding: 2px;
  transition: transform .15s var(--ease), background .2s;
}
.cell:active { transform: scale(.93); }
.cell.blank { background: transparent; pointer-events: none; }
.cell .h { font-family: var(--font-display); font-size: 18px; line-height: 1; }
.cell .g { font-size: 10px; color: var(--muted); margin-top: 3px; }
.cell .dots { position: absolute; top: 5px; right: 5px; display: flex; gap: 2px; }
.cell .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c-peringatan); }
.cell .dots i.cat-wiladah { background: var(--c-wiladah); }
.cell .dots i.cat-syahadah { background: var(--c-syahadah); }
.cell .dots i.cat-id { background: var(--c-id); }
.cell.has-event { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold-2) 35%, transparent); }
.cell.is-friday .h { color: var(--emerald); }
.cell.is-today {
  background: linear-gradient(160deg, #0f5a48, #083a2f);
  border-color: var(--gold-2);
  color: #fbf4df;
  box-shadow: 0 8px 18px -8px rgba(8, 58, 47, .8);
}
.cell.is-today .g, .cell.is-today .h { color: #fbf4df; }
.cell.selected { outline: 2px solid var(--gold-2); outline-offset: 1px; }
.cal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }

/* ======================= DAFTAR ======================= */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 50px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--muted);
  margin-top: 6px;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}
.search:focus-within { border-color: var(--gold-2); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: background .2s, color .2s, border-color .2s;
}
.chip.active { background: var(--emerald); border-color: var(--emerald); color: #fff; }
:root[data-theme="dark"] .chip.active { color: #04150f; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .chip.active { color: #04150f; } }

.month-group { margin-top: 22px; }
.month-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.month-head h3 { font-family: var(--font-display); font-weight: 400; font-size: 19px; }
.month-head h3 small { font-family: var(--font-body); font-size: 12px; color: var(--muted); margin-left: 6px; }
.month-head .ar { font-family: var(--font-ar); color: var(--gold); font-size: 18px; }

/* ======================= SETELAN ======================= */
.settings { padding: 6px 18px; }
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.setting h3 { font-size: 15px; font-weight: 700; }
.setting p { margin: 3px 0 0; }
.setting-actions { padding: 14px 0 10px; text-align: right; }
.stepper {
  display: flex;
  align-items: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
  flex: none;
}
.stepper button {
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  font-size: 20px;
  color: var(--gold);
}
.stepper button:active { background: var(--gold-soft); }
.stepper output { min-width: 40px; text-align: center; font-weight: 800; }
.select {
  flex: none;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}
.segmented {
  display: flex;
  flex: none;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.segmented button.active { background: var(--surface); color: var(--gold); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform .15s var(--ease), filter .2s;
}
.btn:active { transform: scale(.97); }
.btn .ico { width: 18px; height: 18px; }
.btn.primary {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #1d1505;
  box-shadow: 0 10px 22px -10px rgba(165, 124, 27, .7);
}
.btn.secondary { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }

.about { padding: 22px 20px; margin-top: 16px; }
.about-ar { font-family: var(--font-ar); font-size: 22px; color: var(--gold); text-align: center; line-height: 2; margin: 0; }

.foot { text-align: center; padding: 30px 16px 10px; }

/* ======================= SHEET ======================= */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 12, 9, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade .25s ease both;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed;
  z-index: 61;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88vh;
  overflow-y: auto;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -20px 50px -10px rgba(0, 0, 0, .4);
  animation: slideUp .35s var(--ease) both;
}
@keyframes slideUp { from { transform: translateY(100%); } }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 16px; }
.sheet-hero {
  text-align: center;
  padding: 6px 0 14px;
}
.sheet-hero .big-date {
  display: inline-grid;
  place-content: center;
  width: 92px;
  height: 92px;
  border-radius: 26px;
  margin: 10px 0 14px;
  color: #fbf4df;
  background: linear-gradient(150deg, #0f5a48, #062820);
  border: 1px solid rgba(227, 194, 106, .5);
  box-shadow: 0 16px 30px -14px rgba(6, 40, 32, .9);
}
.sheet-hero .big-date b { font-family: var(--font-display); font-weight: 400; font-size: 40px; line-height: 1; color: #f1d58a; }
.sheet-hero .big-date small { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.sheet-hero h2 { font-family: var(--font-display); font-weight: 400; font-size: 24px; margin-top: 10px; }
.sheet-rows { display: grid; gap: 2px; margin: 10px 0 18px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.sheet-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface-2); font-size: 14px; }
.sheet-row span:first-child { color: var(--muted); }
.sheet-row span:last-child { font-weight: 700; text-align: right; }
.sheet-desc { white-space: pre-line; font-size: 14.5px; line-height: 1.7; margin: 0 0 18px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-close { position: absolute; top: 14px; right: 14px; }

/* ======================= TOAST ======================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(100px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  z-index: 80;
  padding: 11px 18px;
  border-radius: 14px;
  background: #0d3a2f;
  color: #fbf4df;
  border: 1px solid rgba(227, 194, 106, .4);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s var(--ease);
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ======================= DESKTOP ======================= */
@media (min-width: 900px) {
  .app {
    display: grid;
    grid-template-columns: 400px 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 0 32px;
    padding: 24px 24px 24px;
  }
  .hero {
    grid-row: 1 / span 3;
    border-radius: 32px;
    align-self: start;
    position: sticky;
    top: 24px;
    min-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
  }
  .hero-inner { flex: 1; display: flex; flex-direction: column; padding: 22px 22px 30px; }
  .salawat { margin-top: auto; padding-top: 40px; }
  .today-card { flex-direction: column; text-align: center; padding: 28px 22px; margin-bottom: auto; }
  .today-hijri { justify-content: center; }
  .today-ar { text-align: center; }
  .moon { width: 110px; height: 110px; }
  .today-day { font-size: 72px; }
  .hero-ornament { display: none; }

  .tabs {
    position: sticky;
    top: 24px;
    left: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    max-width: none;
    grid-column: 2;
    margin-top: 0;
  }
  .tab { flex-direction: row; justify-content: center; gap: 8px; font-size: 14px; padding: 11px 8px; }
  .tab .ico { width: 19px; height: 19px; }
  .content { grid-column: 2; padding: 6px 0 0; }
  .foot { grid-column: 2; }
  .timeline { grid-template-columns: 1fr 1fr; }
  #view-calendar .timeline { grid-template-columns: 1fr 1fr; }
  .cell .h { font-size: 22px; }
  .cell .g { font-size: 11px; }
  .toast { bottom: 32px; }

  .sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: 460px;
    transform: translate(-50%, -50%);
    border-radius: 28px;
    border: 1px solid var(--line);
    animation: pop .3s var(--ease) both;
  }
  .sheet-grip { display: none; }
  @keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
}

@media (max-width: 340px) {
  .today-day { font-size: 46px; }
  .moon { width: 62px; height: 62px; }
  .setting { flex-direction: column; align-items: flex-start; }
}

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