/* Tamu — gaya tampilan. Tanpa CDN luar: font Plus Jakarta Sans (OFL) disimpan di assets/fonts. */
@font-face {
  font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("../assets/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("../assets/fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #FFF8FA;
  --surface: #FFFFFF;
  --surface-2: #FDF0F4;
  --text: #2B1B23;
  --muted: #7C6872;
  --line: #F0DDE5;
  --track: #F5E6EC;
  --accent: #E8558C;          /* pink utama */
  --accent-strong: #C93A72;
  --accent-soft: #FCE4ED;
  --fill: #D23F78;            /* isi tombol utama (teks putih) */
  --haid: #C62828;
  --haid-soft: #FDE4E4;
  --nifas: #D23F78;
  --green: #1F8A68;
  --green-soft: #DFF3EA;
  --amber: #A86A0C;
  --amber-soft: #FCF0D8;
  --danger: #C2364A;
  --ph-mens: #D93434;
  --ph-foli: #2FA58A;
  --ph-ovu: #E3A12F;
  --ph-lute: #8E6CC8;
  --late: #D9B8C6;
  /* alias nama lama */
  --pink: var(--accent); --pink-strong: var(--accent-strong); --pink-soft: var(--accent-soft);
  --shadow: none;
  --radius: 14px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --arab: "Amiri", "Scheherazade New", "Traditional Arabic", "Noto Naskh Arabic", "Geeza Pro", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171013; --surface: #221920; --surface-2: #2B1F27; --text: #F7E9EF; --muted: #BCA6B1; --line: #3A2B33; --track: #33252D;
    --accent: #F27AA6; --accent-strong: #F590B5; --accent-soft: #43202F; --fill: #C23A6F; --haid: #D24545; --haid-soft: #3F1C1E; --nifas: #C23A6F;
    --green: #5CC79A; --green-soft: #173229; --amber: #F0B95A; --amber-soft: #3A2B12; --danger: #FF7D8E;
    --ph-mens: #EF5B5B; --ph-foli: #4CC3A5; --ph-ovu: #F0B95A; --ph-lute: #AE90E6; --late: #5A4450;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171013; --surface: #221920; --surface-2: #2B1F27; --text: #F7E9EF; --muted: #BCA6B1; --line: #3A2B33; --track: #33252D;
    --accent: #F27AA6; --accent-strong: #F590B5; --accent-soft: #43202F; --fill: #C23A6F; --haid: #D24545; --haid-soft: #3F1C1E; --nifas: #C23A6F;
    --green: #5CC79A; --green-soft: #173229; --amber: #F0B95A; --amber-soft: #3A2B12; --danger: #FF7D8E;
    --ph-mens: #EF5B5B; --ph-foli: #4CC3A5; --ph-ovu: #F0B95A; --ph-lute: #AE90E6; --late: #5A4450;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body.noscroll { overflow: hidden; }
a { color: var(--pink-strong); text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.015em; font-weight: 700; }
h1 { font-size: 1.55rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; } h4 { font-size: .9rem; font-weight: 600; color: var(--muted); margin-bottom: .35em; }
p { margin: 0 0 .75em; }
ul, ol { margin: 0 0 .75em; padding-left: 1.2em; }
li { margin: .2em 0; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.err { color: var(--danger); font-size: .9rem; min-height: 1.2em; margin: .4em 0 0; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Kerangka ---------- */
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg);
  
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 750; font-size: 1.15rem; letter-spacing: -.02em; }
.brand img { border-radius: 9px; }
main { padding: 4px 16px 16px; outline: none; }
body.bare .top, body.bare .tabbar { display: none; }
body.bare .app { padding-bottom: 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: space-around; max-width: 560px; margin: 0 auto;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line);
}
.tab { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 4px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600; }
.tab .ic { width: 22px; height: 22px; }
.tab .ic { box-sizing: content-box; padding: 4px 16px; border-radius: 999px; transition: background .18s ease, color .18s ease; }
.tab:active .ic { background: var(--surface-2); }
.tab.on { color: var(--accent-strong); font-weight: 700; }
.tab.on .ic { background: var(--accent-soft); color: var(--accent-strong); }
.tab:focus-visible { outline: none; }
.tab:focus-visible .ic { box-shadow: 0 0 0 2px var(--accent); }

.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover, .icon-btn.on { background: var(--surface-2); }

/* ---------- Status interaksi (tekan & fokus keyboard) ---------- */
.btn:focus-visible, .chip:focus-visible, .cell:focus-visible, .icon-btn:focus-visible, .link:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary:active { background: var(--accent-strong); }
.btn-soft:active, .btn-ghost:active { background: var(--accent-soft); }
.chip:active { border-color: var(--accent); }
.cell:active { background: var(--accent-soft); }

/* ---------- Kartu ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; margin: 0 0 14px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card-t { display: flex; align-items: center; gap: 8px; margin-bottom: .6em; }
.page-h { padding: 6px 2px 8px; }
.page-h h1 { margin-bottom: .2em; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; } .row.wrap { flex-wrap: wrap; }
.lead { font-weight: 600; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; color: var(--text); background: var(--surface-2);
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--fill); color: #fff; }
.btn-primary:hover { filter: brightness(.94); }
.btn-green { background: var(--green); color: #fff; }
.btn-soft { background: var(--pink-soft); color: var(--pink-strong); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-big { width: 100%; min-height: 52px; font-size: 1.02rem; border-radius: 12px; }
.btn.danger { color: var(--danger); }
.btn.danger-bg { background: var(--danger); color: #fff; }
.btn.icon-only { padding: 0; width: 48px; flex: none; }
.btn.small { min-height: 36px; font-size: .85rem; }
.link { background: none; border: 0; color: var(--pink-strong); font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; padding: 0 4px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-green { color: #0d2219; } }
:root[data-theme="dark"] .btn-green { color: #0d2219; }

/* ---------- Beranda ---------- */
.greet { padding: 4px 2px 12px; }
.greet-hi { font-size: 1.5rem; font-weight: 700; letter-spacing: -.025em; }
.greet-date { color: var(--muted); font-size: .9rem; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 22px; }
.ring { position: relative; width: min(232px, 70vw); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-small { font-size: .9rem; font-weight: 600; color: var(--accent); }
.ring-big { font-size: 2.1rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.ring-sub { font-size: .88rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ph-mens { background: var(--ph-mens); } .ph-foli { background: var(--ph-foli); } .ph-ovu { background: var(--ph-ovu); } .ph-lute { background: var(--ph-lute); }
.empty { text-align: center; padding: 28px 20px; }
.empty img { border-radius: 18px; margin-bottom: 8px; }

.banner { display: flex; gap: 10px; align-items: flex-start; }
.banner .ic { margin-top: 2px; }
.tone-soft { background: var(--surface-2); }

.status { border-left: 4px solid var(--green); }
.status .st-head { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.status .st-head .ic { width: 16px; height: 16px; }
.status .st-title { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; }
.status .st-sub { color: var(--muted); margin-bottom: 8px; }
.status.tone-pink { border-left-color: var(--haid); }
.status.tone-amber { border-left-color: var(--amber); background: var(--amber-soft); }
.st-lines { font-size: .92rem; }
.st-note { display: flex; gap: 8px; font-size: .9rem; background: var(--surface-2); padding: 10px 12px; border-radius: 12px; margin: 8px 0; }
.st-note .ic { margin-top: 2px; color: var(--muted); }
.rules { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.rules summary { cursor: pointer; font-weight: 650; font-size: .92rem; color: var(--pink-strong); padding: 4px 0; }
.rules ul { font-size: .9rem; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }

.phase-tag.ph-ovu { color: #3A2600; }
.phase-tag { display: inline-block; color: #fff; font-weight: 600; font-size: .82rem; padding: 3px 10px; border-radius: 6px; margin-bottom: 10px; }
.phase ul { font-size: .9rem; }
.ibadah { display: flex; gap: 8px; background: var(--green-soft); padding: 10px 12px; border-radius: 12px; font-size: .9rem; margin: 6px 0 0; }
.ibadah .ic { color: var(--green); margin-top: 2px; }
.pred { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.pred div { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; }
.pred .k { font-size: .76rem; color: var(--muted); }
.pred .v { font-weight: 700; }
.log-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.log-cta p { margin: 0; font-size: .9rem; }

/* ---------- Kalender ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-title { text-align: center; display: flex; flex-direction: column; }
.cal-title small { color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid.wk div { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cell {
  position: relative; aspect-ratio: 1; border: 0; border-radius: 9px; background: transparent; color: var(--text); font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; padding: 0; min-width: 0;
}
.cell.blank { cursor: default; }
.cell .n { font-weight: 650; font-size: .95rem; line-height: 1; }
.cell .hj { font-family: var(--arab); font-size: .72rem; color: var(--muted); line-height: 1; margin-top: 5px; }
.cell:hover { background: var(--surface-2); }
.cell.is-haid { background: var(--haid); color: #fff; }
.cell.is-haid .hj, .cell.is-nifas .hj { color: rgba(255, 255, 255, .85); }
.cell.is-nifas { background: var(--nifas); color: #fff; }
.cell.is-pred { box-shadow: inset 0 0 0 2px var(--haid); border-radius: 12px; background: var(--haid-soft); }
.cell.is-haid-pred { background: color-mix(in srgb, var(--haid) 55%, var(--surface)); color: #fff; }
.cell.is-haid-pred .hj { color: rgba(255, 255, 255, .85); }
.cell.is-late { background: var(--amber-soft); border: 2px dashed var(--amber); }
.cell.is-fertile { background: var(--green-soft); }
.cell.is-ovu::after { content: ""; position: absolute; inset: 3px; border-radius: 10px; border: 2px solid var(--ph-foli); }
.cell.is-today .n { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cell.is-sel { outline: 2px solid var(--text); outline-offset: 1px; }
.logdot { position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .7; }
.cal-legend { margin-top: 12px; }
.sw { width: 14px; height: 14px; border-radius: 5px; display: inline-block; }
.sw-haid { background: var(--haid); } .sw-nifas { background: var(--nifas); } .sw-pred { background: var(--haid-soft); box-shadow: inset 0 0 0 2px var(--haid); } .sw-haid-pred { background: color-mix(in srgb, var(--haid) 55%, var(--surface)); } .sw-late { background: var(--amber-soft); outline: 2px dashed var(--amber); outline-offset: -2px; }
.sw-fertile { background: var(--green-soft); } .sw-ovu { box-shadow: inset 0 0 0 2px var(--ph-foli); }
.day-status { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 10px 12px; margin: 0 0 10px; background: var(--surface-2); }
.day-status > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.day-status small { color: var(--muted); font-size: .82rem; }
.day-status .ic { margin-top: 2px; }
.ds-haid { background: var(--haid-soft); } .ds-haid > .ic, .ds-haid b:first-child { color: var(--haid); }
.ds-nifas { background: var(--pink-soft); } .ds-nifas > .ic, .ds-nifas b:first-child { color: var(--nifas); }
.ds-pred { box-shadow: inset 0 0 0 1.5px var(--haid); background: var(--haid-soft); } .ds-pred > .ic { color: var(--haid); }
.ds-late { background: var(--amber-soft); } .ds-late > .ic { color: var(--amber); }
.ds-fertile { background: var(--green-soft); } .ds-fertile > .ic { color: var(--green); }
.cal-src { margin: 10px 0 0; text-align: center; }
.gps-btn { width: 100%; margin-top: 10px; }
.day-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.tag { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.tag-pink { background: var(--fill); color: #fff; } .tag-haid { background: var(--haid); color: #fff; } .tag-nifas { background: var(--nifas); color: #fff; } .tag-late { background: var(--amber-soft); color: var(--amber); } .tag-green { background: var(--green-soft); color: var(--green); } .tag-line { box-shadow: inset 0 0 0 1.5px var(--haid); color: var(--haid); }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.hist li:first-child { border-top: 0; }
.hist-dates { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge.tone-pink { background: var(--haid-soft); color: var(--haid); }
.badge.tone-amber { background: var(--amber-soft); color: var(--amber); }
.badge.tone-green { background: var(--green-soft); color: var(--green); }

/* ---------- Fikih ---------- */
.qadha-top { display: flex; justify-content: space-between; gap: 12px; }
.qadha-num { text-align: center; background: var(--pink-soft); color: var(--pink-strong); border-radius: 16px; padding: 8px 14px; min-width: 84px; }
.qadha-num b { display: block; font-size: 2rem; line-height: 1; }
.qadha-num span { font-size: .75rem; font-weight: 650; }
.qadha-bar { height: 8px; background: var(--track); border-radius: 999px; overflow: hidden; margin: 12px 0 8px; }
.qadha-bar i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.paid { font-size: .9rem; }
.result { border-radius: 14px; padding: 12px 14px; margin: 10px 0; font-size: .92rem; background: var(--surface-2); }
.result > b { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.result p:last-child, .result ul:last-child { margin-bottom: 0; }
.result.tone-pink { background: var(--pink-soft); }
.result.tone-amber { background: var(--amber-soft); }
.result.tone-green { background: var(--green-soft); }
.pt { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; margin-bottom: 8px; }
.pt div { background: var(--surface-2); border-radius: 12px; padding: 8px 2px; display: flex; flex-direction: column; }
.pt span { font-size: .72rem; color: var(--muted); }
.src { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; font-weight: 650; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin: 4px 0 0; }
.src .ic { margin-top: 1px; color: var(--muted); }
.src span { display: flex; flex-direction: column; gap: 2px; }
.src small { font-weight: 500; color: var(--muted); }
.src.ok { background: var(--green-soft); } .src.ok .ic { color: var(--green); }
.src.warn { background: var(--amber-soft); } .src.warn .ic { color: var(--amber); }
.kmg-form { display: flex; gap: 8px; }
.kmg-form input { flex: 1; }
.kmg-res { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tools { display: flex; flex-direction: column; gap: 8px; }
.tool { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-decoration: none; }
.tool:hover { background: var(--surface-2); }
.tool[disabled] { opacity: .5; pointer-events: none; }
.tool .ic { width: 26px; height: 26px; color: var(--pink-strong); margin-top: 2px; }
.tool span { display: flex; flex-direction: column; }
.tool small { color: var(--muted); }
.links { padding-left: 1.1em; }

/* ---------- Edukasi ---------- */
.arts { display: grid; gap: 8px; }
.art { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); text-decoration: none; color: var(--text); }
.art small { color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 650; margin: 4px 0 10px; }
.article { font-size: 1rem; line-height: 1.65; }
.article h1 { font-size: 1.45rem; margin-top: .2em; }
.article h3 { margin-top: 1.2em; }
.article .note { background: var(--green-soft); padding: 10px 12px; border-radius: 12px; font-size: .92rem; }
.article .warn { background: var(--amber-soft); padding: 10px 12px; border-radius: 12px; font-size: .92rem; }
.arab { font-family: var(--arab); font-size: 1.55rem; line-height: 2; text-align: right; display: block; margin: .3em 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; margin: .5em 0 1em; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; }
.tbl th { color: var(--muted); font-weight: 650; font-size: .8rem; }

/* ---------- Tanya ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.msg { max-width: 92%; padding: 12px 14px; border-radius: 18px; font-size: .95rem; }
.msg p:last-child { margin-bottom: 0; }
.msg.bot { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; align-self: flex-start; box-shadow: var(--shadow); }
.msg.me { background: var(--fill); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.msg .q { font-weight: 700; color: var(--pink-strong); }
.msg .arab { font-size: 1.35rem; }
.more { display: inline-block; margin-top: 6px; font-weight: 650; font-size: .9rem; }
.rel { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.rel small { width: 100%; color: var(--muted); }
.sugg { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.sugg .chip { white-space: nowrap; }
.ask-bar { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); display: flex; gap: 8px; background: var(--bg); padding: 6px 0; }
.ask-bar input { flex: 1; }

/* ---------- Form ---------- */
.lbl { display: block; font-weight: 650; font-size: .88rem; margin: 14px 0 6px; }
.lbl small { font-weight: 500; color: var(--muted); }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; min-height: 46px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft); }
input[type="file"] { padding: 10px; }
textarea { resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .86rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--fill); border-color: var(--fill); color: #fff; }
.chip.c-hitam::before, .chip.c-merahtua::before, .chip.c-merah::before, .chip.c-pink::before, .chip.c-kuning::before, .chip.c-keruh::before, .chip.c-bening::before {
  content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
}
.c-hitam::before { background: #2a1416; } .c-merahtua::before { background: #7d1225; } .c-merah::before { background: #d3263f; } .c-pink::before { background: #f08aa0; }
.c-kuning::before { background: #e8c547; } .c-keruh::before { background: #9b7653; } .c-bening::before { background: #f4f4f4; }
.stepper { display: flex; gap: 8px; }
.stepper input { text-align: center; }
.ok-line { display: flex; align-items: center; gap: 8px; color: var(--green); font-weight: 650; }
.form .btn + .btn.danger { margin-top: 12px; }
.form > .btn.danger { margin-top: 12px; }

/* ---------- Tentang ---------- */
.about-h { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.about-h img { border-radius: 12px; }
.promise { list-style: none; padding: 0; }
.promise li { display: flex; gap: 8px; align-items: flex-start; }
.promise .ic { color: var(--green); margin-top: 2px; }
.promise.big li { background: var(--surface); border: 1px solid var(--line); padding: 12px; border-radius: 14px; margin-bottom: 8px; text-align: left; }
.promise.big .ic { width: 24px; height: 24px; color: var(--pink-strong); }

/* ---------- Onboarding & kunci ---------- */
.ob { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: calc(24px + env(safe-area-inset-top)) 4px 24px; text-align: center; }
.ob.form { text-align: left; justify-content: flex-start; padding-top: calc(40px + env(safe-area-inset-top)); }
.ob h1 { font-size: 2.2rem; margin: 6px 0 0; letter-spacing: -.03em; }
.ob-logo { align-self: center; border-radius: 28px; box-shadow: var(--shadow); }
.ob-tag { color: var(--muted); font-size: 1.05rem; margin-bottom: 14px; }
.ob-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.ob-dots i { width: 8px; height: 8px; border-radius: 999px; background: var(--line); transition: width .2s; }
.ob-dots i.on { width: 22px; background: var(--pink); }
.ob .btn-big { margin-top: 10px; }
.ob-actions { display: flex; gap: 8px; margin-top: 22px; }
.ob-actions .btn-primary { flex: 1; }
.lock-form { display: flex; flex-direction: column; gap: 10px; max-width: 320px; width: 100%; align-self: center; }
.lock-form input { text-align: center; font-size: 1.6rem; letter-spacing: .5em; }
.lock .btn-ghost { align-self: center; border: 0; }

/* ---------- Sheet & toast ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 20; display: none; }
.sheet-root.open { display: block; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(30, 10, 20, .45); animation: fade .18s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 90vh; max-height: 90dvh; overflow-y: auto;
  background: var(--surface); border-radius: 18px 18px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .22s ease; box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
}
.sheet-grip { width: 40px; height: 4px; border-radius: 99px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { margin-top: 4px; }
.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; position: sticky; bottom: 0; background: var(--surface); padding-top: 8px; }
.sheet-actions .btn-primary { flex: 1; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 30; max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: .9rem; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Tanya: 4 mazhab, kutipan kitab, AI ---------- */
.ai-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; }
.ai-toggle.flat { border: 0; padding: 0; background: none; margin: 0; }
.ai-toggle b { display: flex; align-items: center; gap: 6px; }
.ai-toggle small { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.switch { position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px; border: 0; background: var(--line); cursor: pointer; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"] i { transform: translateX(20px); }

.mzb { display: inline-block; flex: none; font-size: .7rem; font-weight: 800; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; color: #fff; vertical-align: 1px; }
.mz-hanafi { background: #3B7DD8; } .mz-maliki { background: #B7791F; } .mz-syafii { background: var(--green); } .mz-hanbali { background: #8E4FC4; } .mz-muqaran { background: #6B6B6B; }
.mz, .kutip { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.mz > summary, .kutip > summary { cursor: pointer; font-weight: 700; font-size: .9rem; color: var(--pink-strong); padding: 2px 0 6px; }
.mz-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mz-row:last-of-type { border-bottom: 0; }
.mz-row .mzb { min-width: 64px; text-align: center; margin-top: 2px; }
.mz-row p { margin: 0; font-size: .9rem; }
.ijma { display: flex; gap: 8px; background: var(--green-soft); border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.ijma .ic { color: var(--green); margin-top: 2px; }
.kq { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 6px 0; background: var(--surface-2); }
.kq > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.kq > summary::-webkit-details-marker { display: none; }
.kq summary b { font-size: .85rem; }
.kq summary small { width: 100%; color: var(--muted); font-size: .75rem; }
.kq-n { font-size: .72rem; font-weight: 700; color: var(--muted); }
.kq[open] .ar-peek { display: none; }
.ar { font-family: var(--arab); font-size: 1.2rem; line-height: 2; text-align: right; margin: 4px 0 0; color: var(--text); }
.ar-peek { width: 100%; font-size: 1.05rem; line-height: 1.8; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ar.big { font-size: 1.35rem; background: var(--surface-2); border-radius: 12px; padding: 10px 14px; }
.kitab-ar { font-family: var(--arab); font-size: 1.3rem; margin: -4px 0 4px; color: var(--muted); }
.kq.flash { outline: 2px solid var(--pink); }
.sheet p, .kq summary small { overflow-wrap: anywhere; }

.ai { margin-top: 10px; border-radius: 12px; padding: 12px 14px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--pink) 25%, var(--line)); font-size: .93rem; }
.ai-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 6px; color: var(--pink-strong); }
.ai-h small { color: var(--muted); font-size: .76rem; }
.ai-body p { margin: 0 0 .5em; }
.ai-body ul { margin: 0 0 .5em; padding-left: 1.1em; }
.ai.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); background: var(--surface-2); }
.ai.err { background: var(--amber-soft); border-color: transparent; }
.ai.err p { margin: 0 0 8px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--pink); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.cite { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; margin: 0 1px; border: 0; border-radius: 6px; background: var(--fill); color: #fff; font: inherit; font-size: .7rem; font-weight: 800; cursor: pointer; vertical-align: 2px; }
.ai-hint { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; color: var(--muted); margin: 10px 0 0; }
.ai-hint .ic { margin-top: 2px; }


/* ---------- Panduan awal & dasar prediksi ---------- */
.setup { border-left: 4px solid var(--accent); }
.setup-h { display: flex; gap: 10px; align-items: flex-start; }
.setup-h .ic { color: var(--pink-strong); width: 24px; height: 24px; margin-top: 1px; }
.setup-h b { display: block; font-size: 1.02rem; }
.setup-h small { color: var(--muted); }
.setup-bar { height: 6px; background: var(--track); border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.setup-bar i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.setup-list { list-style: none; padding: 0; margin: 0; }
.setup-list li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.setup-list li > div { flex: 1; display: flex; flex-direction: column; }
.setup-list small { color: var(--muted); font-size: .8rem; }
.setup-ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line); flex: none; }
.setup-ic .ic { width: 14px; height: 14px; color: var(--muted); }
.setup-list li.done .setup-ic { background: var(--green); border-color: var(--green); }
.setup-list li.done .setup-ic .ic { color: #fff; }
.setup-list li.done b { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.setup-list .btn { flex: none; }
.setup-skip { display: block; margin: 8px auto 0; }
.basis { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 12px; padding: 8px 10px; font-size: .85rem; color: var(--muted); }
.basis .ic { flex: none; }
.basis span { flex: 1; }
.basis .btn { flex: none; min-height: 34px; padding: 6px 12px; }
.cal-basis { margin-top: 12px; }
.icon-btn.has-dot { position: relative; }
.icon-btn.has-dot::after { content: ""; position: absolute; top: 5px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--haid); box-shadow: 0 0 0 2px var(--bg); }

/* ---------- Keadaan kosong (belum ada data haid) ---------- */
.empty-hero .ring-small.muted-small { color: var(--muted); }
.empty-hero .ring-big { color: var(--muted); }
.empty-hero > p { margin: 0; }
.empty-pred .v { color: var(--muted); }

/* ---------- Tombol & kartu data haid ---------- */
.hero-edit { width: 100%; margin-top: -4px; }
.empty .hero-edit { margin-top: 8px; }
.hd-card .btn { width: 100%; margin-top: 8px; }
.hd-last { display: flex; flex-direction: column; gap: 2px; background: var(--haid-soft); border-radius: 14px; padding: 10px 12px; margin: 0 0 4px; }
.hd-last span { font-size: .8rem; color: var(--muted); }
.hd-last b { color: var(--haid); }

/* ---------- Formulir data awal haid ---------- */
.dt { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; }
.in-prev { margin-top: 16px; padding: 12px; border: 1px dashed var(--line); border-radius: 14px; }
.in-prev p { margin: 2px 0 8px; }
.prev-row { display: grid; grid-template-columns: 22px 1fr 1fr 40px; gap: 8px; align-items: end; margin-bottom: 8px; }
.prev-row .lbl { margin: 0 0 4px; font-size: .78rem; }
.prev-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--haid-soft); color: var(--haid); font-size: .75rem; font-weight: 800; margin-bottom: 12px; }
#in-sum { margin-top: 14px; }
.in-warn { font-size: .82rem; color: var(--amber); margin: 10px 0 0; }
.err.small { font-size: .82rem; }

/* ---------- Reset catatan & toast dengan aksi ---------- */
.hist-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hist-head .card-t { margin: 0; }
.checks { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: .92rem; }
.check input { width: 20px; height: 20px; min-height: 0; margin: 1px 0 0; flex: none; accent-color: var(--haid); }
.check small { color: var(--muted); }
.toast.has-action { pointer-events: auto; display: flex; align-items: center; gap: 14px; }
.toast-btn { background: none; border: 0; color: inherit; font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px 2px; flex: none; }

/* ---------- Pasang aplikasi ---------- */
.install-banner { display: flex; gap: 12px; align-items: flex-start; background: var(--green-soft); border-color: transparent; }
.install-banner > .ic { width: 28px; height: 28px; color: var(--green); flex: none; margin-top: 2px; }
.install-banner > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.install-banner small { color: var(--muted); }
.install-banner .row { margin-top: 6px; }
.install-steps { padding-left: 1.3em; }
.install-steps li { margin: 6px 0; }
.install-steps .ic { width: 16px; height: 16px; vertical-align: -3px; }

/* ---------- Footer hak cipta ---------- */
.app-footer { text-align: center; color: var(--muted); font-size: .74rem; line-height: 1.5; padding: 18px 8px 8px; margin-top: 6px; border-top: 1px solid var(--line); }
.app-footer p { margin: 0 0 4px; }
.app-footer b { color: var(--text); font-weight: 700; }
body.bare .app-footer { border-top: 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.ob + .app-footer, .lock + .app-footer { margin-top: -12px; }

/* ---------- Splash pembuka ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg); transition: opacity .4s ease, visibility .4s ease;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-logo { border-radius: 28px; box-shadow: none; animation: splash-pop .7s cubic-bezier(.2, .9, .3, 1.25) both; }
.splash-name { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; margin-top: 14px; animation: splash-up .5s .25s ease both; }
.splash-tag { color: var(--muted); font-size: .95rem; animation: splash-up .5s .38s ease both; }
@keyframes splash-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes splash-up { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 380px) {
  .two, .rules-grid, .pred { grid-template-columns: 1fr; }
  .pt { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
