/* The learner app. Colours and fonts come from tokens.css, which every page loads first. */
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg); color:var(--ink); font-family:var(--ui); font-size:16px; line-height:1.5; -webkit-font-smoothing:antialiased; font-variant-numeric:tabular-nums}
h1,h2,h3,h4{margin:0; line-height:1.2; font-weight:800}
p{margin:0}
a{color:inherit}
button{font:inherit; color:inherit}
:focus-visible{outline:3px solid var(--brand); outline-offset:2px; border-radius:6px}
@media (prefers-reduced-motion: reduce){ *{animation:none !important; transition:none !important} }

/* header */
.top{position:sticky; top:0; z-index:5; background:var(--surface); border-bottom:1px solid var(--line)}
.top .in{max-width:1100px; margin:0 auto; display:flex; align-items:center; gap:18px; padding:12px 20px}
.brand{display:flex; align-items:center; gap:10px; font-weight:800; text-decoration:none; font-size:1.05rem; letter-spacing:-.01em}
/* The Crescova mark is always Crescova green. An institution's initials sit on its own colour (.mark.init). */
.mark{width:28px; height:28px; border-radius:9px; background:var(--cres); position:relative; flex:none; overflow:hidden}
.mark:after{content:""; position:absolute; left:5px; bottom:5px; width:18px; height:18px; border-radius:50%;
  border:3.5px solid var(--brand-ink); border-top-color:transparent; border-right-color:transparent; transform:rotate(-45deg)}
.nav{margin-left:auto; display:flex; gap:4px; align-items:center}
.nav a{padding:8px 12px; border-radius:8px; text-decoration:none; font-weight:600; color:var(--ink2); font-size:.92rem}
.nav a.on{background:var(--soft); color:var(--ink)}
.nav a.cta{background:var(--brand); color:var(--brand-ink); font-weight:800; margin-left:6px}
@media (max-width:760px){ .nav a:not(.cta){display:none} }

/* layout */
.wrap{max-width:1100px; margin:0 auto; padding:26px 20px 96px; display:grid; grid-template-columns:240px 1fr; gap:36px}
@media (max-width:900px){ .wrap{grid-template-columns:1fr; padding-top:18px} .side{display:none} }
.side{position:sticky; top:76px; align-self:start}
.side h4{font-size:.78rem; color:var(--ink2); margin:14px 0 6px; font-weight:700}
.side a{display:flex; justify-content:space-between; align-items:center; gap:8px; padding:8px 10px; border-radius:8px; text-decoration:none; color:var(--ink); font-size:.9rem; font-weight:600}
.side a.on{background:var(--soft)}
.side .p{font-size:.75rem; color:var(--ink2); font-weight:700; flex:none}
.bottom{display:none; position:fixed; bottom:0; left:0; right:0; background:var(--surface); border-top:1px solid var(--line); z-index:5}
@media (max-width:900px){ .bottom{display:flex} }
.bottom a{flex:1; text-align:center; padding:10px 4px 12px; font-size:.72rem; font-weight:700; text-decoration:none; color:var(--ink2)}
.bottom a.on{color:var(--brand)}

/* home */
.hero h1{font-size:2.5rem; line-height:1.08; letter-spacing:-.02em; max-width:620px}
@media (max-width:600px){ .hero h1{font-size:2rem} }
.hero .sub{color:var(--ink2); font-size:1.1rem; max-width:560px; margin-top:14px}
.live{margin-top:26px; background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:22px; box-shadow:var(--shadow); display:grid; grid-template-columns:1fr 1fr; gap:22px; align-items:center}
@media (max-width:700px){ .live{grid-template-columns:1fr} }
.live .num{font-size:3rem; font-weight:800; letter-spacing:-.02em; line-height:1; color:var(--down)}
.live .num .lbl{display:block; font-size:.88rem; color:var(--ink2); font-weight:700; letter-spacing:0; margin-bottom:10px; line-height:1.3}
.live .num small{display:block; font-size:.88rem; color:var(--ink2); font-weight:600; letter-spacing:0; margin-top:10px; line-height:1.4}
.ctl{display:flex; flex-direction:column; gap:4px; margin-bottom:12px}
.ctl label{display:flex; justify-content:space-between; gap:10px; font-size:.88rem; font-weight:600; color:var(--ink2)}
.ctl label b{font-weight:800; color:var(--ink)}
input[type=range]{width:100%; accent-color:var(--brand); margin:0}
section.block{margin-top:44px}
h2.sec{font-size:1.45rem; letter-spacing:-.01em}
.sec-sub{color:var(--ink2); margin-top:6px}
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:14px; margin-top:16px}
.card{background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:18px; text-decoration:none; color:var(--ink); display:flex; flex-direction:column; gap:8px; min-height:170px}
.card .n{font-size:.78rem; font-weight:700; color:var(--ink2)}
.card h3{font-size:1.05rem; line-height:1.25}
.card p{color:var(--ink2); font-size:.9rem; flex:1}
.bar{height:6px; background:var(--soft); border-radius:3px; overflow:hidden}
.bar i{display:block; height:100%; background:var(--brand)}
.three{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; margin-top:16px}
.three div{background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:18px}
.three h3{margin-bottom:6px; font-size:1rem}
.three p{color:var(--ink2); font-size:.92rem}
.strip{margin-top:44px; background:var(--soft); border-radius:16px; padding:22px; display:flex; gap:16px; align-items:center; justify-content:space-between; flex-wrap:wrap}
.strip p{color:var(--ink2); max-width:560px}

/* module + lesson */
.crumb{font-size:.85rem; color:var(--ink2); margin-bottom:12px}
.crumb a{text-decoration:none; color:var(--ink2)}
h1.t{font-size:2rem; letter-spacing:-.02em; line-height:1.15; max-width:680px}
.meta{color:var(--ink2); font-size:.9rem; margin-top:8px}
.intro{color:var(--ink2); font-size:1.05rem; max-width:640px; margin-top:12px}
.lesson-list{margin-top:18px; max-width:680px}
.lrow{display:flex; align-items:center; gap:12px; padding:12px 6px; border-top:1px solid var(--line); text-decoration:none; color:var(--ink)}
.lrow:last-child{border-bottom:1px solid var(--line)}
.lrow .i{width:26px; height:26px; border-radius:50%; border:2px solid var(--line); flex:none; display:flex; align-items:center; justify-content:center; font-size:.72rem; font-weight:800; color:var(--ink2)}
.lrow .i.ok{background:var(--up); border-color:var(--up); color:#fff}
.lrow .t{flex:1; font-weight:600}
.lrow .m{font-size:.8rem; color:var(--ink2); flex:none}
.body{font-family:var(--serif); font-size:1.12rem; line-height:1.65; max-width:640px; margin-top:22px}
.body p{margin:0 0 18px}
/* Blocks a lesson can have since Phase 07a (crescova2's lessons had paragraphs only): a heading, a key fact
   and a picture. Each is made from what the lesson page already had: the page's own heading weight, the
   "Remember" box in the neutral colour, and the video's frame. */
.body h2{font-family:var(--ui); font-size:1.18rem; letter-spacing:-.01em; line-height:1.3; margin:26px 0 10px}
.body h2:first-child{margin-top:0}
.body p.fact{font-family:var(--ui); font-size:1rem; line-height:1.5; font-weight:600; background:var(--soft); border-left:4px solid var(--brand); border-radius:0 12px 12px 0; padding:12px 16px}
.body figure{margin:4px 0 20px}
.body figure img{display:block; max-width:100%; height:auto; border:1px solid var(--line); border-radius:14px}
.body figcaption{font-family:var(--ui); font-size:.85rem; color:var(--ink2); margin-top:8px}
.video{margin:22px 0; border:1px solid var(--line); border-radius:14px; overflow:hidden; background:var(--surface); max-width:640px}
.screen{aspect-ratio:16/9; background:linear-gradient(135deg,var(--soft),var(--line)); position:relative; display:flex; align-items:center; justify-content:center}
.play{width:56px; height:56px; border-radius:50%; background:var(--ink); color:var(--bg); display:flex; align-items:center; justify-content:center; font-size:1.1rem; padding-left:4px}
.dur{position:absolute; right:10px; bottom:10px; background:var(--ink); color:var(--bg); font-size:.75rem; font-weight:700; padding:2px 7px; border-radius:5px}
.tbd{position:absolute; left:10px; top:10px; font-size:.72rem; font-weight:700; color:var(--ink2)}
.video video.screen{display:block; width:100%; background:#000}
.vmeta{padding:12px 14px}
.vmeta details{margin-top:6px; font-size:.88rem; color:var(--ink2)}
.vmeta summary{cursor:pointer; font-weight:600}
.vmeta ol{margin:8px 0 0; padding-left:18px}
.vmeta li{margin-bottom:4px}
.sim{margin:22px 0; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:20px; max-width:640px}
.sim h3{margin-bottom:4px; font-size:1.05rem}
.sim .d{color:var(--ink2); font-size:.9rem; margin-bottom:14px}
.sim .ins{display:grid; grid-template-columns:1fr 1fr; gap:6px 18px}
@media (max-width:520px){ .sim .ins{grid-template-columns:1fr} }
.kv{display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; margin:12px 0 4px}
.kv div{background:var(--soft); border-radius:10px; padding:10px 12px}
.kv b{display:block; font-size:1.25rem; font-weight:800; line-height:1.15}
.kv span{font-size:.78rem; color:var(--ink2)}
.kv .down b{color:var(--down)} .kv .up b{color:var(--up)} .kv .gold b{color:var(--gold-ink)} .kv .mid b{color:var(--mid)}
.note{font-size:.85rem; color:var(--ink2); margin-top:10px}
.say{margin-top:10px; font-weight:600}
.takeaway{background:var(--soft); border-left:4px solid var(--gold); border-radius:10px; padding:14px 16px; margin:24px 0; max-width:640px; font-weight:600}
.takeaway small{display:block; font-size:.75rem; color:var(--ink2); font-weight:700; margin-bottom:4px}
.lnav{display:flex; justify-content:space-between; gap:12px; margin-top:20px; max-width:640px; flex-wrap:wrap}
.btn{border:0; border-radius:10px; padding:12px 16px; font-weight:800; cursor:pointer; text-decoration:none; display:inline-block; text-align:center}
.btn.primary{background:var(--brand); color:var(--brand-ink)}
.btn.line{background:transparent; border:1px solid var(--line); color:var(--ink)}
.btn.done{background:var(--up); color:#fff}
.btn.small{padding:8px 12px; font-size:.85rem}
.check{list-style:none; padding:0; margin:14px 0; max-width:640px}
.check li{display:flex; gap:10px; align-items:center; padding:9px 0; border-top:1px solid var(--line); font-weight:600}
.check input{width:20px; height:20px; accent-color:var(--brand); margin:0}

/* charts */
.chart{width:100%; height:auto; display:block; margin-top:10px}
.gl{stroke:var(--line); stroke-width:1}
.tick{fill:var(--ink2); font-size:10px; font-family:var(--ui)}
.ln{fill:none; stroke-width:2.5; stroke-linejoin:round; stroke-linecap:round}
.c-up{stroke:var(--up)} .c-down{stroke:var(--down)} .c-mid{stroke:var(--mid)} .c-gold{stroke:var(--gold)} .c-ink{stroke:var(--ink2); stroke-dasharray:4 4}
.legend{display:flex; gap:14px; flex-wrap:wrap; font-size:.8rem; color:var(--ink2); margin-top:8px}
.legend i{display:inline-block; width:14px; height:3px; border-radius:2px; margin-right:6px; vertical-align:middle}
.legend i.c-up{background:var(--up)} .legend i.c-down{background:var(--down)} .legend i.c-mid{background:var(--mid)} .legend i.c-gold{background:var(--gold)} .legend i.c-ink{background:var(--ink2)}
.brow{margin:12px 0}
.brow .h{display:flex; justify-content:space-between; gap:10px; font-size:.9rem; font-weight:700}
.brow .h span{color:var(--ink2); font-weight:600; font-size:.82rem}
.track{position:relative; height:22px; background:var(--soft); border-radius:6px; margin:6px 0 4px}
.band{position:absolute; top:6px; height:10px; border-radius:5px; opacity:.32; background:var(--brand)}
.mark2{position:absolute; top:2px; width:4px; height:18px; background:var(--brand); border-radius:2px; transform:translateX(-2px)}
.rng{display:flex; justify-content:space-between; font-size:.8rem; color:var(--ink2)}
.rng b{color:var(--ink); font-weight:800; font-size:.92rem}
.stackbar{display:flex; height:22px; border-radius:6px; overflow:hidden; margin:12px 0 6px}
.stackbar i{display:block; height:100%}
.stackbar .a{background:var(--ink2)} .stackbar .b{background:var(--brand)} .stackbar .c{background:var(--gold)}
table{width:100%; border-collapse:collapse; font-size:.9rem; margin-top:10px}
th,td{text-align:left; padding:8px 8px; border-top:1px solid var(--line)}
th{font-weight:700; color:var(--ink2); border-top:0; font-size:.82rem}
td.r,th.r{text-align:right}
.ltable{margin-top:22px; overflow-x:auto}
.ltable table{margin-top:0}

/* diagnostic + partners + progress */
.diag .q{margin:18px 0; max-width:640px}
.diag .q h3{margin-bottom:8px; font-size:1.05rem; font-weight:600}
.choice{display:flex; gap:8px}
.choice button{flex:1; border:1px solid var(--line); background:transparent; border-radius:10px; padding:12px; font-weight:700; cursor:pointer}
.choice button[aria-pressed="true"]{background:var(--ink); color:var(--bg); border-color:var(--ink)}
.res{background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:20px; margin-top:22px; max-width:640px; box-shadow:var(--shadow)}
.res h3{margin-bottom:6px}
.res p{color:var(--ink2); margin-bottom:14px}
.prow{display:flex; align-items:center; gap:14px; padding:12px 0; border-top:1px solid var(--line); max-width:640px}
.prow .t{flex:1; font-weight:600}
.prow .bar{width:140px; flex:none}
.prow .p{font-size:.82rem; color:var(--ink2); width:52px; text-align:right; flex:none}
.simcard{display:block; background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:16px 18px; text-decoration:none; color:var(--ink)}
.simcard h3{font-size:1rem; margin-bottom:4px}
.simcard p{color:var(--ink2); font-size:.88rem}
.toast{position:fixed; left:50%; bottom:70px; transform:translateX(-50%); background:var(--ink); color:var(--bg); padding:10px 16px; border-radius:10px; font-weight:600; font-size:.9rem; opacity:0; pointer-events:none; transition:opacity .2s; z-index:9; max-width:90vw}
.toast.show{opacity:1}
.lang:empty{display:none}
.lang{display:flex; border:1px solid var(--line); border-radius:999px; overflow:hidden; margin-left:8px; flex:none}
.lang button{border:0; background:transparent; padding:5px 10px; font-size:.78rem; font-weight:800; cursor:pointer; color:var(--ink2)}
.lang button[aria-pressed="true"]{background:var(--ink); color:var(--bg)}
@media (max-width:760px){ .nav .cta{display:none} .lang{margin-left:auto} }

/* partner branding */
.top{top:0}
.mark.init{background:var(--brand); display:flex; align-items:center; justify-content:center; color:var(--brand-ink); font-size:.78rem; font-weight:800; letter-spacing:-.02em}
.mark.init:after{display:none}
#skinnote{font-size:.72rem; color:var(--ink2); font-weight:600; margin-left:10px; white-space:nowrap}
@media (max-width:760px){ #skinnote{display:none} }

/* wealth model */
.plan .pfs{display:grid; grid-template-columns:repeat(auto-fit,minmax(168px,1fr)); gap:14px 18px; margin-bottom:4px}
.pf{display:flex; flex-direction:column; gap:5px; min-width:0}
.pf label{font-size:.82rem; font-weight:600; color:var(--ink2); line-height:1.35}
.pin{display:flex; align-items:center; border:1px solid var(--line); border-radius:10px; background:var(--bg); padding:0 11px}
.pin input{border:0; background:transparent; width:100%; min-width:0; padding:10px 0; font:inherit; font-weight:800; font-size:1.05rem; color:var(--ink)}
.pin input:focus{outline:none}
.pin:focus-within{border-color:var(--brand)}
.padv{margin-top:18px; border-top:1px solid var(--line); padding-top:14px}
.padv summary{cursor:pointer; font-weight:700; font-size:.88rem; color:var(--ink2)}
.padv[open] summary{margin-bottom:14px}
.plan .out{margin-top:20px; border-top:1px solid var(--line); padding-top:4px}
.plan-head{margin:16px 0 2px}
.plan-head b{display:block; font-size:3.4rem; font-weight:800; letter-spacing:-.03em; line-height:1; color:var(--brand)}
.plan-head.miss b{font-size:1.9rem; color:var(--down); line-height:1.15}
.plan-head small{display:block; font-size:.92rem; color:var(--ink2); font-weight:600; margin-top:10px; line-height:1.45}
.plan-sub{font-size:.85rem; color:var(--ink2); margin-top:12px}
.plan-h{font-size:.95rem; margin:22px 0 2px}
.plan .chips{margin-top:8px}
.chips{display:flex; gap:6px; flex-wrap:wrap}
.chip{border:1px solid var(--line); background:transparent; border-radius:999px; padding:7px 14px; font-weight:700; font-size:.85rem; cursor:pointer; color:var(--ink2)}
.chip[aria-pressed="true"]{background:var(--ink); color:var(--bg); border-color:var(--ink)}

/* home: video + invest-now calculator */
.hero .video{max-width:760px; margin-top:22px}
.hcalc{max-width:none; margin-top:16px; box-shadow:var(--shadow)}
.hc-head{margin:16px 0 4px}
.hc-head span{display:block; font-size:.9rem; font-weight:700; color:var(--ink2)}
.hc-head b{display:block; font-size:3.2rem; font-weight:800; letter-spacing:-.03em; line-height:1.05; color:var(--down); margin-top:4px}
.hc-head small{display:block; font-size:.95rem; color:var(--ink2); font-weight:600; margin-top:8px; line-height:1.45}
@media (max-width:600px){ .hc-head b{font-size:2.5rem} }
@media (max-width:600px){ .plan-head b{font-size:2.7rem} }

/* Inside the learner shell (public/app/), the shell provides the header and the navigation, as in crescova2. */
.embedded .top,.embedded .bottom,.embedded #app>.crumb{display:none !important}
.embedded .wrap{padding-top:26px !important; padding-bottom:56px !important}
.embedded .side{top:18px !important}
@media (max-width:900px){ .embedded .wrap{padding-bottom:40px !important} }
/* "Try a lesson": the public preview keeps this page's own header, with two lessons to choose from. */
.preview #app>.crumb{display:none}
.preview .lnav>span:first-child:empty{display:none}
.preview .lnav{justify-content:flex-end}
