/* Bukcha at home: phone first. Colours: the "Zellige garden" palette (bukcha/brand.py, owner 2026-11-30).
   Pastels are fills; text is ink or the deep shade of its fill's family. */
:root {
  --bk-paper: #FBFAF6; --bk-mint: #CFE8DD; --bk-turquoise: #7CC0B8; --bk-saffron: #F4C95D; --bk-rose: #F3B8B2;
  --bk-ink: #23406B; --bk-mint-deep: #1E4D45; --bk-saffron-deep: #5A4210; --bk-rose-deep: #6B2D27;
  --bk-ink-soft: #5C6F8C; --bk-line: #D8DEE3;
  --card: #ffffff; --radius: 16px; --nav-h: 68px; --shadow: 0 1px 2px rgba(35, 64, 107, .08), 0 4px 14px rgba(35, 64, 107, .06);
  --font: "Andika", "Noto Naskh Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "Noto Naskh Arabic", "Andika", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bk-paper); color: var(--bk-ink); font: 17px/1.45 var(--font);
  overflow-x: hidden; min-height: 100vh;
}
[dir="rtl"] body, body[dir="rtl"], .ar { font-family: var(--font-ar); }
[dir="rtl"] body { font-size: 19px; line-height: 1.7; }
.ar { font-size: 1.08em; }
a { color: var(--bk-mint-deep); }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 700; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: .4em 0; }
.muted { color: var(--bk-ink-soft); }
.small { font-size: .88rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--bk-turquoise); outline-offset: 2px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; background: rgba(251, 250, 246, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--bk-line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.langsw { display: flex; border: 1px solid var(--bk-line); border-radius: 999px; overflow: hidden; flex: none; background: #fff; }
.langsw button { min-width: 44px; min-height: 40px; border: 0; background: transparent; font-weight: 700; padding: 0 8px; }
.langsw button.on { background: var(--bk-ink); color: #fff; }

/* ---------- main column ---------- */
main { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 96px); }
.stack > * + * { margin-top: 14px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border: 1px solid rgba(216, 222, 227, .6); }
.lbl { font-size: .8rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--bk-ink-soft); }
[dir="rtl"] .lbl { text-transform: none; letter-spacing: 0; font-size: .9rem; }
.chip { display: inline-block; font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: var(--bk-mint); color: var(--bk-mint-deep); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 14px; border: 1.5px solid var(--bk-line); background: #fff; color: var(--bk-ink); font-weight: 700; text-decoration: none;
}
.btn.big { min-height: 60px; font-size: 1.15rem; width: 100%; }
.btn.primary { background: var(--bk-mint-deep); border-color: var(--bk-mint-deep); color: #fff; }
.btn.soft { background: var(--bk-mint); border-color: var(--bk-mint); color: var(--bk-mint-deep); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--bk-rose-deep); border-color: var(--bk-rose); }
.btn.on { background: var(--bk-mint); border-color: var(--bk-mint-deep); color: var(--bk-mint-deep); }
.btn.primary.on { background: var(--bk-mint-deep); color: #fff; box-shadow: inset 0 0 0 3px var(--bk-turquoise); }
.btn:disabled { opacity: .55; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link { background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--bk-mint-deep); text-decoration: underline; font-weight: 700; }

/* ---------- Today ---------- */
.hello h1 { font-size: 1.5rem; }
.dots { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.dot {
  width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--bk-turquoise); background: #fff; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; color: #fff; position: relative;
}
.dot::after { content: ""; position: absolute; inset: -8px; } /* 46 px touch target */
.dot.done { background: var(--bk-mint-deep); border-color: var(--bk-mint-deep); }
.dot.now { box-shadow: 0 0 0 3px var(--bk-saffron); }
.dots .count { margin-inline-start: 4px; }

.now-card { border-top: 6px solid var(--bk-saffron); padding: 18px; }
.now-card h2 { font-size: 1.35rem; margin: 4px 0 8px; }
.items { list-style: none; margin: 0; padding: 0; }
.items li { padding: 8px 0; border-top: 1px dashed var(--bk-line); }
.items li:first-child { border-top: 0; }
.items .meta { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.needs { font-size: .8rem; color: var(--bk-ink-soft); }
.note { font-size: .9rem; background: var(--bk-paper); border-radius: 10px; padding: 8px 10px; margin-top: 8px; }
.now-card .actions { margin-top: 14px; }
.now-card .btn-row { margin-top: 10px; }
.done-mark { color: var(--bk-mint-deep); font-weight: 700; }

.moment { padding: 0; overflow: hidden; }
.moment > summary {
  list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 60px; cursor: pointer;
}
.moment > summary::-webkit-details-marker { display: none; }
.moment .tick {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--bk-turquoise); display: inline-flex;
  align-items: center; justify-content: center; color: #fff; font-size: .85rem;
}
.moment.done .tick { background: var(--bk-mint-deep); border-color: var(--bk-mint-deep); }
.moment .when { font-size: .8rem; color: var(--bk-ink-soft); }
.moment .chev { flex: none; transition: transform .15s; color: var(--bk-ink-soft); }
.moment[open] .chev { transform: rotate(90deg); }
[dir="rtl"] .moment .chev { transform: scaleX(-1); }
[dir="rtl"] .moment[open] .chev { transform: rotate(90deg); }
.moment .body { padding: 0 16px 16px; }

.slot-special { --accent: var(--bk-rose); } .slot-book { --accent: var(--bk-saffron); } .slot-area { --accent: var(--bk-mint); }
.slot-move { --accent: var(--bk-turquoise); } .slot-dinner { --accent: var(--bk-rose); } .slot-bath { --accent: var(--bk-turquoise); }
.slot-bedtime { --accent: var(--bk-ink-soft); } .slot-nanny { --accent: var(--bk-saffron); } .slot-weekend { --accent: var(--bk-mint); }
.moment { border-inline-start: 6px solid var(--accent, var(--bk-mint)); }
.now-card { border-inline-start: 0; }

.game { background: #fff; border: 2px solid var(--bk-mint); }
.game .q { font-size: 1.12rem; margin: 6px 0; }
.know { background: linear-gradient(180deg, #fff, #fff), var(--bk-mint); border: 2px solid var(--bk-turquoise); }
.bar { height: 10px; background: var(--bk-line); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.bar > i { display: block; height: 100%; background: var(--bk-mint-deep); border-radius: 999px; }
.know .g { border-top: 1px dashed var(--bk-line); padding-top: 12px; margin-top: 12px; }

/* ---------- Week ---------- */
.weeknav { display: flex; align-items: center; gap: 8px; }
.weeknav h1 { flex: 1; text-align: center; font-size: 1.2rem; }
.arrow { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--bk-line); background: #fff; font-size: 1.4rem; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--bk-ink); flex: none; }
.day { display: block; text-decoration: none; color: inherit; }
.day.today { border: 2.5px solid var(--bk-saffron); }
.day h2 { display: flex; justify-content: space-between; gap: 8px; }
.day .slots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.day .slots span { font-size: .82rem; background: var(--bk-paper); border: 1px solid var(--bk-line); border-radius: 999px; padding: 2px 10px; }

/* ---------- Progress ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--bk-paper); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font-size: 1.5rem; line-height: 1.1; }
.area-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; background: #fff; border: 0; border-top: 1px solid var(--bk-line);
  padding: 12px 4px; min-height: 64px;
}
.area-row:first-of-type { border-top: 0; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.steps { display: flex; gap: 3px; margin: 6px 0 2px; }
.steps i { flex: 1; height: 8px; border-radius: 3px; background: var(--bk-line); }
.steps i.past { background: var(--bk-turquoise); }
.steps i.cur { background: var(--bk-mint-deep); }
.rung { border-inline-start: 4px solid var(--bk-line); }
.rung.cur { border-inline-start-color: var(--bk-mint-deep); background: #F4FAF7; }
.rung ul { margin: 6px 0; padding-inline-start: 20px; }
.badge { display: inline-block; background: var(--bk-mint-deep); color: #fff; border-radius: 999px; padding: 3px 12px; font-size: .85rem; font-weight: 700; }

/* ---------- More ---------- */
.list { padding: 0; }
.list a, .list button.item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 60px; text-decoration: none; color: inherit; border: 0;
  border-top: 1px solid var(--bk-line); background: none; width: 100%; text-align: start; font-weight: 700;
}
.list > :first-child { border-top: 0; }
.list .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--bk-mint); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.list .ico svg { width: 20px; height: 20px; }
.field { display: block; margin-bottom: 14px; }
.field label, .field .lab { display: block; font-weight: 700; margin-bottom: 6px; font-size: .95rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; border: 1.5px solid var(--bk-line); border-radius: 12px; padding: 10px 12px; background: #fff;
}
.field textarea { min-height: 96px; resize: vertical; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choices button { min-height: 48px; border-radius: 12px; border: 1.5px solid var(--bk-line); background: #fff; font-weight: 700; }
.choices button.on { background: var(--bk-mint); border-color: var(--bk-mint-deep); color: var(--bk-mint-deep); }
ol.rules { padding-inline-start: 22px; margin: 8px 0 0; }
ol.rules li { margin-bottom: 6px; }

/* ---------- bottom nav, FAB, sheet, toast ---------- */
nav.tabs {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border-top: 1px solid var(--bk-line); padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--nav-h);
  text-decoration: none; color: var(--bk-ink-soft); font-size: .8rem; font-weight: 700;
}
nav.tabs a svg { width: 26px; height: 26px; }
nav.tabs a.on { color: var(--bk-mint-deep); }
nav.tabs a.on svg { background: var(--bk-mint); border-radius: 12px; padding: 2px 10px; width: 46px; box-sizing: content-box; }
[dir="rtl"] nav.tabs a { font-size: .9rem; }
.fab {
  position: fixed; z-index: 31; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); inset-inline-end: 16px;
  width: 62px; height: 62px; border-radius: 50%; border: 0; background: var(--bk-saffron); color: var(--bk-saffron-deep);
  font-size: 2rem; line-height: 1; box-shadow: 0 6px 16px rgba(35, 64, 107, .25); display: flex; align-items: center; justify-content: center;
}
.fab[hidden] { display: none; }
@media (min-width: 700px) { .fab { inset-inline-end: calc(50% - 320px + 16px); } }

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(35, 64, 107, .35); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--bk-paper); border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(35, 64, 107, .2);
}
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--bk-line); margin: 0 auto 12px; }
.sheet h2 { margin-bottom: 12px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick button { min-height: 92px; border-radius: 16px; border: 1.5px solid var(--bk-line); background: #fff; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; }
.quick button .e { font-size: 1.6rem; }
.sheet .foot { display: flex; gap: 10px; margin-top: 10px; }
.sheet .foot .btn { flex: 1; }
.toast-box { position: fixed; z-index: 50; inset-inline: 16px; bottom: calc(var(--nav-h) + 92px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--bk-ink); color: #fff; border-radius: 14px; padding: 12px 18px; max-width: 520px; box-shadow: var(--shadow); font-weight: 700; animation: up .2s ease-out; }
.toast.move { background: var(--bk-mint-deep); }
.toast.err { background: var(--bk-rose-deep); }
@keyframes up { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .moment .chev { transition: none; } }

.loading { padding: 40px 0; text-align: center; color: var(--bk-ink-soft); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: 100%; max-width: 400px; }
.login .logo { display: flex; justify-content: center; margin-bottom: 12px; }
.login .logo svg { width: 64px; height: 64px; }
.login h1 { text-align: center; margin-bottom: 4px; }
.login .err { background: #FCEDEB; color: var(--bk-rose-deep); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-weight: 700; }
.login .ok { background: var(--bk-mint); color: var(--bk-mint-deep); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-weight: 700; }
.login .langsw { margin: 0 auto 18px; width: max-content; }
