:root {
  --blue: #2196f3;
  --blue-d: #0b79c9;
  --pill: #e8f2fc;
  --green: #1db954;
  --text: #111;
  --muted: #667085;
  --card: #f1f6fc;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #eef2f6; font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); }
a { color: var(--blue-d); }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: #fff; display: flex; flex-direction: column; position: relative; }
.content { flex: 1; padding: 0 16px 28px; }
.with-nav .content { padding-bottom: 100px; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 16px; position: sticky; top: 0; background: #fff; z-index: 5; }
.topbar h1 { font-size: 19px; margin: 0; flex: 1; font-weight: 600; }
.back { display: grid; place-items: center; width: 32px; height: 32px; color: #000; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--pill); color: var(--blue); display: grid; place-items: center; cursor: pointer; }

/* ---------- Stage (panah & kompas) ---------- */
.stage { position: relative; width: 100%; max-width: 340px; aspect-ratio: 1 / 1; margin: 6px auto 0; }
.stage svg { width: 100%; height: 100%; display: block; overflow: visible; }
.marker { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 24px solid #9ad0fa; transition: border-color .2s; }
.stage.aligned .marker { border-top-color: var(--green); }
.badge { fill: #2196f3; stroke: #0b79c9; stroke-width: 6; transition: stroke .2s, fill .2s; }
.stage.aligned .badge { stroke: var(--green); fill: #43c97a; }
.ring { fill: #fff; stroke: #1db954; stroke-width: 6; }
.dial-top { fill: #9ad0fa; transition: fill .2s; }
.stage.aligned .dial-top { fill: var(--green); }

/* ---------- Info arah ---------- */
.info { text-align: center; }
.info-label { margin-top: 10px; font-size: 17px; }
.info-deg { font-size: 50px; font-weight: 700; margin: 4px 0 2px; }
.status { min-height: 22px; color: var(--muted); font-size: 14px; margin-bottom: 14px; padding: 0 6px; }
.status.ok { color: var(--green); font-weight: 600; }
.pills { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pill { background: var(--pill); border-radius: 22px; padding: 10px 6px; display: flex; flex-direction: column; gap: 2px; }
.pill small { color: var(--blue); font-size: 14px; }
.pill b { font-weight: 500; font-size: 15px; }
.locbar { display: flex; gap: 12px; margin-top: 12px; }
.loc-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; background: var(--blue); color: #fff; border: 0; border-radius: 26px; padding: 14px 18px; font-size: 16px; text-align: left; cursor: pointer; }
.loc-main svg { flex: none; }
.loc-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 1px solid rgba(255, 255, 255, .45); padding-left: 14px; }
.loc-sensor { width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--pill); color: var(--blue); cursor: pointer; display: grid; place-items: center; flex: none; }

/* ---------- Peta ---------- */
#map { width: 100%; height: 48vh; min-height: 280px; border-radius: 18px; margin: 4px 0 8px; z-index: 1; }

/* ---------- Bottom nav ---------- */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: #fff; border-top: 1px solid #e5e9ee; display: flex; justify-content: space-around; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); z-index: 6; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: #667085; font-size: 15px; min-width: 90px; }
.bottom-nav .c { width: 54px; height: 54px; border-radius: 50%; background: var(--pill); color: #6b8bb0; display: grid; place-items: center; }
.bottom-nav a.on { color: var(--blue); font-weight: 600; }
.bottom-nav a.on .c { background: var(--blue); color: #fff; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center; z-index: 40; padding: 20px; }
.modal[hidden] { display: none; }
.sheet { background: #fff; border-radius: 20px; padding: 20px; width: 100%; max-width: 380px; }
.sheet h3 { margin: 0 0 8px; }
.sheet p { margin: 0 0 8px; color: #445; font-size: 15px; line-height: 1.5; }
.sheet label { display: block; font-size: 14px; color: var(--muted); margin-top: 10px; }
.sheet input { width: 100%; padding: 12px; border: 1px solid #cfd8e3; border-radius: 12px; font-size: 16px; margin-top: 4px; }
.btn { border: 0; border-radius: 14px; padding: 12px 16px; font-size: 16px; cursor: pointer; background: var(--blue); color: #fff; }
.btn.sec { background: var(--pill); color: var(--blue); }
.row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.err-text { color: #c0392b; font-size: 14px; min-height: 18px; margin-top: 8px; }
.eight { display: block; margin: 8px auto; color: var(--blue); animation: sway 2.2s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-18deg); } 50% { transform: rotate(18deg); } }

/* ---------- Beranda ---------- */
.hero { position: relative; height: 270px; background: linear-gradient(165deg, #0b3d2e, #1b6b4f 55%, #c9a24b); overflow: hidden; display: flex; align-items: flex-start; }
.hero h1 { margin: 22px 20px; color: #fff; font-size: 22px; font-weight: 700; position: relative; z-index: 2; }
.hero img { position: absolute; left: 50%; top: 56px; width: 170px; transform: translateX(-50%); filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .45)); }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff); }
.pad { padding: 0 16px 30px; margin-top: -14px; position: relative; z-index: 3; }
.menu-card { display: flex; align-items: center; gap: 18px; background: linear-gradient(90deg, #dbe9f8, #eef3f8); border-radius: 22px; padding: 20px; margin-bottom: 14px; text-decoration: none; color: #111; font-size: 19px; }
.menu-card .chev { margin-left: auto; color: #667085; }
.badge-ico { width: 48px; height: 48px; flex: none; border-radius: 50%; border: 4px solid #2196f3; background: #fff; display: grid; place-items: center; }
.badge-ico img { width: 26px; height: 26px; }
.section-label { color: var(--muted); margin: 18px 4px 8px; }
.card-outline { border: 2px solid #d3ece0; border-radius: 22px; padding: 16px; display: flex; align-items: center; gap: 16px; text-decoration: none; color: #111; background: #fff; }
.card-outline .ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font-size: 28px; color: #17b57a; }
.card-outline .chev { margin-left: auto; color: #667085; }
.sholat-card { font-size: 19px; }
.sholat-card small { display: block; color: #17b57a; font-size: 17px; margin-top: 2px; }
.sholat-card .cd { font-size: 17px; color: #222; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.grid2 .card-outline { font-size: 19px; line-height: 1.2; }
.allah { font-family: "Amiri", "Noto Naskh Arabic", serif; font-size: 20px; background: #17b57a; color: #fff; border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; flex: none; }

/* ---------- Splash ---------- */
.splash { position: fixed; inset: 0; background: #fff; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; transition: opacity .45s; }
.splash.hide { opacity: 0; pointer-events: none; }
.splash svg { width: 190px; height: 190px; }
.splash h2 { font-size: 38px; margin: 0; }
.splash .bar { position: absolute; bottom: 56px; left: 15%; right: 15%; height: 4px; background: #cfe8fb; border-radius: 2px; overflow: hidden; }
.splash .bar i { display: block; height: 100%; width: 0; background: var(--blue); animation: load 1.3s ease forwards; }
@keyframes load { to { width: 100%; } }

/* ---------- Daftar (doa, asmaul husna, waktu sholat) ---------- */
.search { width: 100%; padding: 13px 18px; border-radius: 26px; border: 1px solid #cfd8e3; font-size: 16px; margin: 4px 0 12px; background: #f7fafd; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; }
.chip { flex: none; border: 0; background: var(--pill); color: var(--blue); padding: 8px 15px; border-radius: 18px; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--blue); color: #fff; }
.item { background: var(--card); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.item h3 { margin: 0 0 6px; font-size: 16px; display: flex; align-items: center; }
.ar { font-family: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif; font-size: 26px; line-height: 1.9; direction: rtl; text-align: right; }
.latin { color: var(--blue-d); font-style: italic; font-size: 14px; margin: 6px 0; }
.arti { font-size: 14px; color: #334; margin: 0; }
.no { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 13px; margin-right: 10px; flex: none; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }

.pt-head { text-align: center; margin: 6px 0 14px; }
.pt-head b { display: block; font-size: 18px; }
.pt-head span { color: var(--muted); font-size: 14px; }
.next-card { background: var(--blue); color: #fff; border-radius: 22px; padding: 18px; text-align: center; margin-bottom: 14px; }
.next-card small { opacity: .85; }
.next-card .n { font-size: 26px; font-weight: 700; margin: 2px 0; }
.next-card .t { font-size: 34px; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.prow { display: flex; justify-content: space-between; padding: 16px 18px; border-radius: 16px; background: var(--card); margin-bottom: 10px; font-size: 18px; }
.prow.next { outline: 3px solid var(--blue); background: #e3f1fe; font-weight: 600; }
.prow.dim { color: var(--muted); font-size: 16px; }
.note { color: var(--muted); font-size: 13px; text-align: center; margin-top: 14px; }

/* ---------- Kompas digital ---------- */
.big-deg { text-align: center; font-size: 54px; font-weight: 700; margin: 10px 0 0; font-variant-numeric: tabular-nums; }
.big-dir { text-align: center; color: var(--muted); margin-bottom: 14px; }

/* ---------- Tasbeh ---------- */
.tas-wrap { text-align: center; }
.tas-arab { font-family: "Amiri", "Noto Naskh Arabic", serif; font-size: 38px; margin: 16px 0 2px; }
.tas-nama { color: var(--muted); margin-bottom: 14px; }
.tas-ring { --p: 0; width: 250px; height: 250px; margin: 0 auto; border-radius: 50%; background: conic-gradient(var(--blue) calc(var(--p) * 1%), #e1ecf8 0); display: grid; place-items: center; }
.tas-btn { width: 222px; height: 222px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 6px 22px rgba(33, 150, 243, .25); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; user-select: none; touch-action: manipulation; }
.tas-btn:active { transform: scale(.97); }
.tas-btn b { font-size: 64px; font-variant-numeric: tabular-nums; line-height: 1; }
.tas-btn span { color: var(--muted); font-size: 15px; }
.tas-total { margin: 16px 0 6px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 14px; z-index: 70; opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.show { opacity: 1; }
