/* Practitioner app ("Bana Pele Journey Partner"): warm, mobile-first.
   Colours taken from the UC3 demo video's Naledi screens. */
:root {
  --bg: #fdf7f2; --surface: #ffffff; --soft: #f6eee6; --line: #efe3d8; --line-2: #e6d6c8;
  --text: #2b1d16; --muted: #85766c; --primary: #b9502b; --primary-2: #a3431f; --on-primary: #ffffff;
  --peach: #fbeee3; --peach-ink: #8a4b2a; --amber: #ffe9ce; --amber-ink: #a8591a;
  --green: #e3f0e2; --green-ink: #3a7347; --violet: #ece6f8; --violet-ink: #5e4aa8;
  --blue: #e6eef6; --blue-ink: #3f5f7c; --red: #fbe5e0; --red-ink: #a33a25;
  --radius: 16px; --font: "Plus Jakarta Sans", "Outfit", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1512; --surface: #251d18; --soft: #2f2620; --line: #3a2f28; --line-2: #463830;
    --text: #f3e9e2; --muted: #b6a397; --primary: #e0774f; --primary-2: #ef8a62; --on-primary: #1b1512;
    --peach: #3a2a20; --peach-ink: #f0b48f; --amber: #3d2c15; --amber-ink: #f2b267;
    --green: #1f3324; --green-ink: #8fd19c; --violet: #2c2640; --violet-ink: #c2b4f2;
    --blue: #1f2a36; --blue-ink: #a9c4de; --red: #3c211b; --red-ink: #f0a090;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
@media (min-width: 520px) { body { background: var(--soft); } .app { box-shadow: 0 0 0 1px var(--line); } }

/* App bar */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.logo { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; flex: none; }
img.logo { width: 100px; height: auto; max-width: 40vw; background: none; border-radius: 0; }
.bar h1 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: -.01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.dot { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 9px 16px; background: var(--primary); color: var(--on-primary); font-weight: 700; cursor: pointer; }

main { flex: 1; padding: 16px 16px 96px; }
h2 { font-size: 17px; margin: 22px 0 10px; font-weight: 700; }
h2:first-child { margin-top: 4px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Bottom navigation */
nav.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
nav.tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 12px; color: var(--muted); cursor: pointer; position: relative; }
nav.tabbar button[aria-current="page"] { color: var(--primary); font-weight: 700; }
nav.tabbar .dot { top: 0; right: calc(50% - 22px); }

/* Segmented control and chips */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--soft); padding: 4px; border-radius: 14px; margin-bottom: 14px; }
.seg button { border: 0; background: transparent; border-radius: 10px; padding: 10px 6px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.seg .n { font-size: 12px; margin-left: 4px; opacity: .8; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--peach); color: var(--peach-ink); white-space: nowrap; }
.chip.green { background: var(--green); color: var(--green-ink); }
.chip.amber { background: var(--amber); color: var(--amber-ink); }
.chip.violet { background: var(--violet); color: var(--violet-ink); }
.chip.blue { background: var(--blue); color: var(--blue-ink); }
.chip.red { background: var(--red); color: var(--red-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 12px; }
.card.hl { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.row { display: flex; gap: 12px; align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.tile { width: 44px; height: 44px; border-radius: 12px; background: var(--peach); color: var(--peach-ink); display: grid; place-items: center; flex: none; }
.tile.violet { background: var(--violet); color: var(--violet-ink); }
.tile.blue { background: var(--blue); color: var(--blue-ink); }
.card h3 { margin: 0; font-size: 16px; font-weight: 700; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.reason { display: flex; align-items: center; gap: 6px; color: var(--green-ink); font-weight: 600; font-size: 13.5px; margin: 6px 0 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 12px 16px; font-weight: 700; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; }
.btn.block { width: 100%; margin-top: 12px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }
.btn-row .btn.back { flex: 0 0 auto; }
.link { border: 0; background: none; color: var(--primary); font-weight: 700; padding: 0; cursor: pointer; }

/* Forms */
label.f { display: block; font-size: 13.5px; font-weight: 600; margin: 14px 0 6px; }
input.in, select.in { width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
input.in:focus, select.in:focus, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Onboarding */
.brand { text-align: center; padding: 26px 16px 8px; }
.brand .logo { width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 10px; }
.brand img.logo { width: 176px; height: auto; max-width: 70vw; margin: 0 auto 10px; background: none; border-radius: 0; }
.brand h1 { font-size: 22px; margin: 0; }
.brand .role { color: var(--primary); font-weight: 600; }
.steps { padding: 0 16px; }
.steps .lbl { font-size: 13.5px; color: var(--muted); margin: 14px 0 6px; }
.steps .lbl b { color: var(--text); }
.bars { display: grid; grid-auto-flow: column; gap: 6px; }
.bars i { height: 4px; border-radius: 2px; background: var(--line-2); }
.bars i.on { background: var(--green-ink); }

/* Sharing cards */
.share { border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; margin: 10px 0; }
.share.on { border-color: color-mix(in srgb, var(--green-ink) 45%, var(--line-2)); }
.share .top { display: flex; align-items: center; gap: 10px; }
.share h4 { margin: 0; font-size: 15.5px; flex: 1; }
.share .state { font-size: 13px; font-weight: 700; color: var(--muted); }
.share.on .state { color: var(--green-ink); }
.share dl { margin: 8px 0 0; font-size: 13.5px; }
.share dt { display: inline; font-weight: 700; }
.share dd { display: inline; margin: 0; }
.share dd::after { content: ""; display: block; margin-bottom: 3px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: var(--line-2); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green-ink); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Timeline */
ol.tl { list-style: none; margin: 10px 0 0; padding: 0 0 0 4px; border-left: 2px solid var(--line-2); }
ol.tl li { position: relative; padding: 0 0 10px 16px; font-size: 14px; }
ol.tl li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }
ol.tl time { display: block; color: var(--muted); font-size: 12px; }
details > summary { cursor: pointer; color: var(--primary); font-weight: 700; font-size: 14px; margin-top: 10px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Progress */
.prog { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; margin-top: 6px; }
.prog i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }

/* Sheet (bottom dialog) */
.scrim { position: fixed; inset: 0; background: rgba(30, 18, 10, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 12px; }
.sheet h3 { margin: 0 0 4px; font-size: 18px; }

.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty .tile { margin: 0 auto 10px; }
.error { color: var(--red-ink); font-size: 14px; margin-top: 8px; }
.notice { display: flex; gap: 8px; align-items: flex-start; background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; color: var(--muted); }
.notice .ic { flex: none; margin-top: 1px; }
[hidden] { display: none !important; }
button.card { display: block; width: 100%; text-align: left; cursor: pointer; color: inherit; }
.card .card { background: var(--bg); margin: 12px 0 0; padding: 14px; }
.card > p.small { margin: 12px 0 0; }
.card > .notice { margin-top: 12px; }
.sheet .share { background: var(--surface); }
.sheet .notice { margin-top: 12px; }
.tile b { font-size: 15px; }
details .when-open, details[open] .when-closed { display: none; }
details[open] .when-open { display: inline; }
