/* Tampilan sederhana, huruf besar, kontras tinggi — ramah orang tua */
:root {
  --bg: #fbf7ef;
  --card: #ffffff;
  --text: #1c180f;
  --muted: #5b5141;
  --line: #ddd0b8;
  --green: #2f5d1e;
  --green-soft: #e4efd9;
  --brown: #8a4b10;
  --red-soft: #fbe3df;
  --red: #9b1c12;
  --yellow-soft: #fdf0cf;
  color-scheme: light;
}
html { font-size: 19px; -webkit-text-size-adjust: 100%; }
html[data-size="2"] { font-size: 22px; }
html[data-size="3"] { font-size: 25px; }

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 500 1rem/1.65 "Plus Jakarta Sans", system-ui, sans-serif;
  padding-bottom: calc(5.2rem + env(safe-area-inset-bottom));
}
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 800; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

/* ---------- atas ---------- */
.top { background: var(--green); color: #fff; }
.top-inner { max-width: 760px; margin: 0 auto; padding: .7rem 16px; display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.05rem; }
.size-btn { min-height: 2.6rem; padding: 0 .9rem; border-radius: 999px; border: 2px solid #fff; background: #fff; color: var(--green); font-weight: 800; font-size: .85rem; }
.size-ctl { display: flex; align-items: center; gap: .3rem; font-size: .8rem; }
.size-ctl button { min-width: 2.6rem; height: 2.3rem; border-radius: .6rem; border: 2px solid rgba(255,255,255,.6); background: transparent; color: #fff; font-weight: 800; }
.size-ctl button.on { background: #fff; color: var(--green); }

main { max-width: 760px; margin: 0 auto; padding: 1.1rem 16px 1.5rem; outline: none; }

/* ---------- navigasi bawah ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--card); border-top: 2px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(0,0,0,.06);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 4.4rem; text-decoration: none; font-weight: 800; font-size: .85rem; color: var(--muted); }
.bottom-nav a span { font-size: 1.6rem; line-height: 1; }
.bottom-nav a.on { color: var(--green); background: var(--green-soft); }

/* ---------- teks & umum ---------- */
.title { font-size: 1.5rem; margin: .3rem 0 .4rem; }
.lead { color: var(--muted); margin: 0 0 1rem; }
.section-title { font-size: 1.2rem; margin: 1.6rem 0 .7rem; }
.back {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 3rem; padding: 0 1.1rem; margin-bottom: 1rem;
  border-radius: 999px; border: 2px solid var(--line); background: var(--card); font-weight: 800;
}

/* ---------- pencarian ---------- */
.search { display: flex; align-items: center; gap: .6rem; background: var(--card); border: 3px solid var(--green); border-radius: 1rem; padding: 0 1rem; }
.search span { font-size: 1.3rem; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: .9rem 0; font-weight: 700; }
.search input::placeholder { color: #8a7f6c; font-weight: 500; }

/* ---------- tombol kotak besar ---------- */
.big-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.big-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; text-align: center;
  min-height: 7rem; padding: .8rem .5rem; border-radius: 1.1rem; background: var(--card); border: 2px solid var(--line);
  text-decoration: none; font-weight: 800; font-size: 1rem; box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
.big-btn .e { font-size: 2.3rem; line-height: 1; }
.big-btn small { font-weight: 600; color: var(--muted); font-size: .78rem; }
.big-btn:active { transform: scale(.98); }

/* ---------- daftar resep ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.item {
  display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem; min-height: 4.4rem;
  background: var(--card); border: 2px solid var(--line); border-radius: 1rem; text-decoration: none;
}
.item .e { font-size: 2rem; flex: none; width: 2.6rem; text-align: center; }
.item .t { flex: 1; min-width: 0; }
.item b { display: block; font-size: 1.02rem; }
.item small { color: var(--muted); font-size: .82rem; }
.item .chev { font-size: 1.6rem; color: var(--muted); }
.count { color: var(--muted); font-weight: 700; margin: 1rem 0 .6rem; }
.more { width: 100%; min-height: 3.4rem; margin-top: .8rem; border-radius: 1rem; border: 2px solid var(--green); background: var(--card); color: var(--green); font-weight: 800; }

/* ---------- kotak info ---------- */
.box { border-radius: 1rem; padding: 1rem 1.1rem; margin: 1rem 0; }
.box h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.box ul { margin: .3rem 0 0; padding-left: 1.3rem; }
.box li { margin-bottom: .35rem; }
.box p { margin: 0; }
.box.green { background: var(--green-soft); }
.box.red { background: var(--red-soft); }
.box.yellow { background: var(--yellow-soft); }
.box.plain { background: var(--card); border: 2px solid var(--line); }

/* ---------- halaman resep ---------- */
.r-head { text-align: center; padding: .4rem 0; }
.r-head .e { font-size: 4.5rem; line-height: 1; }
.r-head h1 { font-size: 1.55rem; margin-top: .5rem; }
.r-info { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem 1rem; color: var(--muted); font-weight: 700; margin-top: .5rem; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 1.1rem 0; }
.act {
  min-height: 3.6rem; border-radius: 1rem; border: 2px solid var(--line); background: var(--card); font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: .4rem; padding: 0 .5rem;
}
.act.wa { background: #e7f6ea; border-color: #25a244; color: #135c25; }
.act.main { grid-column: 1 / -1; background: var(--green); border-color: var(--green); color: #fff; font-size: 1.1rem; }
.act.playing { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.act { text-decoration: none; }
.bahan { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.bahan li { padding: .75rem 1rem; border-radius: .9rem; background: var(--card); border: 2px solid var(--line); }
.bahan label { display: flex; gap: .8rem; align-items: flex-start; padding: .75rem .9rem; border-radius: .9rem; background: var(--card); border: 2px solid var(--line); cursor: pointer; }
.bahan input { width: 1.5rem; height: 1.5rem; flex: none; margin-top: .15rem; accent-color: var(--green); }
.bahan input:checked + span { text-decoration: line-through; opacity: .5; }
.q { font-weight: 800; color: var(--brown); }
.langkah { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.langkah li { display: flex; gap: .9rem; padding: .9rem 1rem; border-radius: .9rem; background: var(--card); border: 2px solid var(--line); }
.langkah li.done { opacity: .45; }
.num { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 800; }
.tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.tag { padding: .35rem .8rem; border-radius: 999px; background: var(--green-soft); font-weight: 700; font-size: .88rem; }
.hint { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* ---------- doa ---------- */
.doa { background: var(--card); border: 2px solid var(--line); border-radius: 1.1rem; padding: 1.1rem; margin-bottom: .9rem; }
.doa h3 { font-size: 1.08rem; }
.arab { font-family: "Amiri", serif; font-size: 2rem; line-height: 2.1; text-align: right; color: var(--green); margin: .5rem 0; }
.latin { font-style: italic; color: var(--brown); margin: 0 0 .5rem; }
.doa .arti { margin: 0 0 .4rem; }
.doa small { color: var(--muted); }
.adab { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.adab li { display: flex; gap: .8rem; align-items: center; padding: .8rem 1rem; background: var(--card); border: 2px solid var(--line); border-radius: 1rem; font-weight: 700; }
.adab li span { font-size: 1.6rem; flex: none; }
.adab small { display: block; color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.empty .e { font-size: 3rem; }
.footnote { color: var(--muted); font-size: .8rem; margin-top: 2rem; }

#toast {
  position: fixed; left: 50%; bottom: calc(6rem + env(safe-area-inset-bottom)); transform: translate(-50%, 1rem); opacity: 0; visibility: hidden;
  background: var(--text); color: #fff; padding: .8rem 1.3rem; border-radius: 999px; font-weight: 700; transition: transform .25s, opacity .25s, visibility .25s; z-index: 30; pointer-events: none; max-width: 90vw; text-align: center;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

@media (min-width: 640px) {
  .big-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .big-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* =================== FOTO =================== */
/* Emoji tampil dulu; bila foto/<nomor>.jpg ada, foto menutupinya */
.pic { position: relative; display: grid; place-items: center; overflow: hidden; flex: none; }
.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.pic.adafoto img { opacity: 1; }
.pic.adafoto .e { visibility: hidden; }
.pic.thumb { width: 3.4rem; height: 3.4rem; border-radius: .8rem; background: #f2ebdc; }
.pic.thumb .e { font-size: 2rem; width: auto; }
.pic.hero { width: 100%; max-width: 520px; margin: 0 auto; border-radius: 1.2rem; }
.pic.hero.adafoto { aspect-ratio: 4 / 3; }
.pic.hero .e { font-size: 4.5rem; line-height: 1; }

/* =================== MODE MEMASAK =================== */
body.masak .top, body.masak .bottom-nav { display: none; }
body.masak { padding-bottom: 0; }
body.ada-timer main { padding-top: 4.4rem; }
.m-wrap { min-height: calc(100dvh - 2.2rem); display: flex; flex-direction: column; gap: .8rem; }
.m-top { display: flex; justify-content: space-between; gap: .5rem; }
.m-btn { white-space: nowrap; min-height: 3rem; padding: 0 1rem; border-radius: 999px; border: 2px solid var(--line); background: var(--card); font-weight: 800; }
.m-prog { height: .7rem; background: var(--line); border-radius: 999px; overflow: hidden; }
.m-prog span { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.m-nama { color: var(--muted); font-weight: 700; }
.m-judul { font-size: 1.35rem; color: var(--green); }
.m-isi { flex: 1; display: flex; flex-direction: column; gap: 1rem; }
.m-teks { font-size: 1.6rem; line-height: 1.45; font-weight: 700; margin: 0; }
.m-teks.center { text-align: center; }
.m-bahan { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; font-size: 1.12rem; font-weight: 700; }
.m-bahan li { padding: .7rem .9rem; border-radius: .9rem; background: var(--card); border: 2px solid var(--line); }
.m-timer { width: 100%; min-height: 4.2rem; border-radius: 1rem; border: 3px solid var(--brown); background: #fff4e0; color: var(--brown); font-weight: 800; font-size: 1.1rem; }
.m-ulang { align-self: flex-start; min-height: 3rem; padding: 0 1.1rem; border-radius: 999px; border: 2px solid var(--line); background: var(--card); font-weight: 800; }
.m-nav { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1.7fr; gap: .6rem; padding: .7rem 0 calc(.9rem + env(safe-area-inset-bottom)); background: var(--bg); }
.m-prev, .m-next { white-space: nowrap; min-height: 4.6rem; border-radius: 1.1rem; font-weight: 800; }
.m-prev { border: 2px solid var(--line); background: var(--card); }
.m-next { border: 0; background: var(--green); color: #fff; font-size: 1.3rem; }

/* =================== TIMER & ALARM =================== */
#timerBar { white-space: nowrap;
  position: fixed; top: calc(.6rem + env(safe-area-inset-top, 0px)); left: 50%; transform: translate(-50%, -250%); z-index: 40; display: flex; align-items: center; gap: .9rem;
  background: var(--brown); color: #fff; border-radius: 999px; padding: .45rem .5rem .45rem 1.2rem; font-weight: 800; font-size: 1.35rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: transform .25s; font-variant-numeric: tabular-nums;
}
#timerBar.on { transform: translate(-50%, 0); }
#timerBar button { border: 0; border-radius: 999px; background: #fff; color: var(--brown); font-weight: 800; padding: .45rem 1rem; font-size: .85rem; }
.alarm { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.alarm > div { background: #fff; border-radius: 1.4rem; padding: 2rem 1.5rem; text-align: center; width: 100%; max-width: 380px; }
.alarm .big { font-size: 4.5rem; animation: goyang .4s infinite alternate; }
.alarm h2 { font-size: 1.6rem; margin-top: .5rem; }
.alarm p { color: var(--muted); }
.alarm button { width: 100%; min-height: 4.2rem; border: 0; border-radius: 1rem; background: var(--green); color: #fff; font-weight: 800; font-size: 1.4rem; }
@keyframes goyang { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) { .alarm .big { animation: none; } }
