/* Layout: satu kolom sempit; kartu hari + garis waktu di atas, lalu lima kartu waktu ibadah yang bisa dilipat. */
:root {
  --bg: #f3ecdd;
  --card: #fbf7ee;
  --fg: #2f2a22;
  --muted: #7a705f;
  --accent: #1f5c4d;
  --accent-soft: rgba(31, 92, 77, 0.10);
  --line: rgba(31, 92, 77, 0.16);
  --warn: #9a3b2a;
  --warn-soft: rgba(154, 59, 42, 0.10);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-arab: "Amiri", "Noto Naskh Arabic", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14201c; --card: #1b2b26; --fg: #efe7d4; --muted: #a39b87;
    --accent: #d5b36a; --accent-soft: rgba(213, 179, 106, 0.12);
    --line: rgba(213, 179, 106, 0.22);
    --warn: #e59b82; --warn-soft: rgba(229, 155, 130, 0.12);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  padding-inline: 16px; padding-block: 0 48px; margin: 0; min-height: 100vh;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23a07d37' stroke-width='1' opacity='0.55'%3E%3Cpath d='M32 4l6 14 14-6-6 14 14 6-14 6 6 14-14-6-6 14-6-14-14 6 6-14-14-6 14-6-6-14 14 6z'/%3E%3Ccircle cx='32' cy='32' r='6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 64px 64px; opacity: 0.35;
}
@media (prefers-color-scheme: dark) { body::before { opacity: 0.18; } }

header {
  position: sticky; top: 0; z-index: 5;
  margin-inline: -16px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.bar { max-width: 640px; margin: 0 auto; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--accent); }
.who-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who { font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button:focus-visible, label:focus-within, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

main { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding-top: 28px; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px 20px; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 12px 32px -18px rgba(0,0,0,.35); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.day-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.seal { position: relative; width: 84px; height: 84px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 10px; }
.seal b { font-family: var(--font-display); font-size: 42px; font-weight: 700; line-height: 1; }
.seal span { position: absolute; bottom: -8px; background: var(--accent); color: var(--bg); font-size: 11px; padding: 1px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.seal.warn { background: var(--warn-soft); color: var(--warn); }
h1 { font-family: var(--font-display); font-size: 30px; font-weight: 500; margin: 0; text-wrap: balance; }
.sub { color: var(--muted); font-size: 14px; margin: 0; max-width: 38ch; text-wrap: balance; }

.seg { display: inline-flex; align-self: center; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--card); }
.seg button { border: 0; background: none; color: var(--muted); font: 500 13px var(--font-body); padding: 6px 18px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }

.dots { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.dot { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.dot.done { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.dot.today { border-color: var(--accent); color: var(--accent); border-width: 2px; }
.dot.miss { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }

.meter { display: flex; flex-direction: column; gap: 6px; }
.meter .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.meter .row strong { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.track { height: 10px; background: var(--accent-soft); border-radius: 999px; overflow: hidden; }
.track.thin { height: 6px; }
.fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .35s ease; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { flex: 1 1 140px; border: 1px solid var(--line); background: none; color: var(--fg); font: 500 13px var(--font-body); padding: 10px 14px; border-radius: 10px; cursor: pointer; }
.btn:hover { background: var(--accent-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--warn); color: var(--bg); border-color: var(--warn); }
.btn.danger:hover { filter: brightness(1.08); }
.notice { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.notice.warn { color: var(--warn); }

/* Form masuk / daftar */
.tabs { display: flex; gap: 6px; justify-content: center; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input { font: 15px var(--font-body); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; }
.field small { font-size: 12px; }
.error { margin: 0; font-size: 13px; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; }

.sec { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.locked .sec { opacity: .6; }
.sec-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.sec-head h2 { flex: 1; min-width: 0; margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.sec-head .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sec-head .ico { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--font-display); font-size: 16px; }
.fold { border: 0; background: none; color: var(--muted); cursor: pointer; width: 32px; height: 32px; border-radius: 8px; font-size: 14px; }
.sec.closed .items { display: none; }
.sec.closed .fold { transform: rotate(180deg); }
.items { list-style: none; margin: 0; padding: 0; }
.items li + li { border-top: 1px solid var(--line); }
.item { display: flex; gap: 14px; align-items: flex-start; padding: 14px; cursor: pointer; }
.item:hover { background: var(--accent-soft); }
.locked .item { cursor: default; }
.locked .item:hover { background: none; }
.item input { appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 2px 0 0; border: 1.5px solid var(--accent); border-radius: 6px; display: grid; place-items: center; cursor: pointer; background: transparent; }
.locked .item input { cursor: default; }
.item input:checked { background: var(--accent); }
.item input:checked::after { content: ""; width: 5px; height: 10px; border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.item .body { flex: 1; min-width: 0; }
.item .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item .name { font-weight: 500; }
.chip { font-size: 11px; background: var(--accent-soft); color: var(--accent); padding: 1px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.arab { font-family: var(--font-arab); font-size: 22px; line-height: 1.7; color: var(--muted); text-align: right; margin: 2px 0 0; }
.item.done .name { text-decoration: line-through; color: var(--muted); }
.hide-done li:has(.item.done) { display: none; }

.foot { text-align: center; padding: 8px 8px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.foot svg { width: 26px; height: 26px; color: var(--accent); opacity: .45; }
.quote { font-family: var(--font-display); font-style: italic; font-size: 19px; color: var(--muted); margin: 0; max-width: 30ch; text-wrap: balance; }
.linkbtn { border: 0; background: none; color: var(--muted); font: 13px var(--font-body); text-decoration: underline; cursor: pointer; padding: 4px; }
.full { width: 100%; }
@media (prefers-reduced-motion: reduce) { .fill { transition: none; } }
