/* Chat lesson page: stage on the left (lesson cards), Clara panel on the right, the same frame as the video pages */
[hidden] { display: none !important; }
body.on-lesson { overflow: hidden; }
#view.view-lesson { height: 100vh; max-width: none; margin: 0; padding: 14px 22px 14px; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(700px 300px at 90% 0%, rgba(61,140,132,.08), transparent), radial-gradient(520px 260px at 0% 100%, rgba(160,132,92,.07), transparent); }
.ls { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; width: 100%; }
.ls-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 22px; background: rgba(255,255,255,.72); backdrop-filter: blur(14px); box-shadow: 0 10px 40px rgba(30,60,60,.08), 0 0 0 1px rgba(0,0,0,.05); overflow: hidden; }
.ls-feed { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 6px; display: flex; flex-direction: column; gap: 14px; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16px); mask-image: linear-gradient(180deg, transparent 0, #000 16px); }
.ls-item { animation: materialize .45s cubic-bezier(.16,1,.3,1) both; flex: none; } .ls-item.skipped { opacity: .6; pointer-events: none; }
.lnote { display: flex; gap: 12px; align-items: flex-start; background: #fff; border-radius: 16px; padding: 12px 16px; box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 6px 20px rgba(30,60,60,.06); } .lnote .orb { width: 26px; height: 26px; margin-top: 2px; }
.lc-goals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; } .lc-goals span { font-size: 11.5px; padding: 4px 11px; border-radius: 99px; background: var(--teal-soft); color: var(--teal-d); }

/* topic stepper pills */
.ts-pill { display: flex; align-items: center; gap: 7px; padding: 4px 11px 4px 5px; border-radius: 99px; border: 1px solid var(--ln2); background: var(--card); font-size: 12px; color: var(--t2); transition: .15s; white-space: nowrap; }
.ts-pill b { width: 21px; height: 21px; border-radius: 50%; background: var(--tint); display: grid; place-items: center; font-size: 10.5px; font-weight: 600; color: var(--t2); flex: none; }
.ts-pill b svg { width: 12px; height: 12px; }
.ts-pill .ts-k { display: none; }
.ts-pill:hover { border-color: var(--teal); }
.ts-pill.asm { background: transparent; }
.ts-pill.next { border-style: dashed; border-color: var(--teal); color: var(--teal-d); }
.ts-pill.prog b { background: rgba(196,137,10,.16); color: var(--amber); }
.ts-pill.done b { background: var(--green); color: #fff; }
.ts-pill.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-d); font-weight: 500; box-shadow: 0 2px 10px rgba(61,140,132,.18); }
.ts-pill.on b { background: var(--teal); color: #fff; }
.ts-sep { width: 8px; height: 1.5px; background: var(--ln2); }
.ts-soon { font-size: 11px; color: var(--t3); padding: 0 6px; cursor: help; }

/* topic complete */
.tdone { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: rgba(61,140,106,.09); border: 1px solid rgba(61,140,106,.3); }
.td-ic { width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 14px; flex: none; }
.td-t { flex: 1; min-width: 0; } .td-k { font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--green); } .td-s { font-size: 12.5px; color: var(--t2); }
.tdone .btn { display: inline-flex; align-items: center; gap: 8px; flex: none; } .tdone .btn svg { width: 14px; height: 14px; }
.tdone.in { animation: materialize .5s both; }
.tdone.mini { padding: 6px 8px 6px 10px; border-radius: 99px; } .tdone.mini .td-s { display: none; } .tdone.mini .td-ic { width: 22px; height: 22px; font-size: 12px; }

/* context card */
.spine { background: rgba(255,255,255,.8); border: 1px solid var(--ln); border-radius: 16px; backdrop-filter: blur(12px); overflow: hidden; flex: none; box-shadow: 0 4px 18px rgba(30,60,60,.05); }
.sp-h { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 14px; border: 0; background: none; text-align: left; font-size: 12.5px; }
.sp-case { font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-d); flex: none; }
.sp-goal { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--t1); font-weight: 500; }
.sp-goal::before { content: 'Goal: '; color: var(--t3); font-weight: 400; }
.sp-t { color: var(--t3); font-size: 17px; line-height: 1; }
.sp-b { display: none; grid-template-columns: auto 1fr 1.2fr; gap: 18px; align-items: start; padding: 2px 14px 10px; border-top: 1px solid var(--ln); padding-top: 9px; }
.spine.open .sp-b { display: grid; }
.sp-facts { display: flex; flex-wrap: wrap; gap: 5px; max-width: 250px; }
.sp-blocks { display: flex; flex-wrap: wrap; gap: 6px 14px; align-content: start; }
.sp-blk { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--t3); } .sp-blk i { width: 8px; height: 8px; border-radius: 50%; background: var(--ln2); transition: .35s; }
.sp-blk.on { color: var(--teal-d); font-weight: 600; } .sp-blk.on i { background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.sp-trail { min-width: 0; } .sp-lab { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--t3); display: block; margin-bottom: 3px; }
.sp-ev { display: flex; gap: 6px; font-size: 11.5px; color: var(--t2); line-height: 1.4; } .sp-ev span { color: var(--gold); }

/* runner controls */
.ls-ctl { display: flex; align-items: center; gap: 16px; padding: 10px 22px 12px; flex-wrap: wrap; border-top: 1px solid var(--ln); background: rgba(255,255,255,.6); flex: none; }
.lgo { display: inline-flex; align-items: center; gap: 8px; padding: 9px 22px; border-radius: 99px; box-shadow: 0 4px 14px rgba(61,140,132,.3); } .lgo svg { width: 15px; height: 15px; } .lgo:disabled { box-shadow: none; }
.ldots { display: flex; gap: 5px; } .ldots i { width: 6px; height: 6px; border-radius: 99px; background: var(--ln2); transition: all .35s cubic-bezier(.22,1,.36,1); } .ldots i.on { width: 16px; background: var(--teal); }
.lskip { border: 0; background: none; color: var(--t3); font-size: 12px; text-decoration: underline; margin-left: auto; } .lskip:hover { color: var(--teal-d); }
.ls-ask { display: none; }

/* lesson cards in the stage */
.lcard { background: #fff; border-radius: 18px; padding: 14px 18px 16px; box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 8px 26px rgba(30,60,60,.08); position: relative; overflow: hidden; }
.lcard.plain { background: transparent; box-shadow: none; padding: 0; overflow: visible; }
.lcard.tone-teal { border-left: 4px solid var(--teal); } .lcard.tone-gold { border-left: 4px solid #C9A24A; }

/* The knowledge check and practical share the topic header and sit in the same frame */
#view.view-assess .thead, #view.view-practical .thead { max-width: 900px; margin: 0 auto 18px; }
#view.view-assess, #view.view-practical { padding: 14px 22px 80px; }
#view.view-assess .narrow, #view.view-practical .narrow { max-width: 900px; }
@media (max-width: 1250px) { body.clara-open .prac-grid { grid-template-columns: 1fr !important; } body.clara-open .prac-grid > section { position: static !important; } }
.lc-k { font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-d); margin-bottom: 4px; } .lc-k.gold { color: var(--gold); }
.lcard h4 { margin: 0 0 8px; font: 500 21px/1.25 'Cormorant Garamond', Georgia, serif; color: var(--t1); }
.lc-body { font-size: 14px; line-height: 1.6; color: var(--t1); } .lc-body p { margin: 0 0 6px; } .lc-body ul { margin: 4px 0 6px 18px; padding: 0; } .lc-body li { margin: 3px 0; }
.lc-cap { font-size: 13px; color: var(--t2); line-height: 1.5; margin: 8px 0 0; }
.lc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.lc-it { padding: 10px 12px; border-radius: 12px; background: var(--tint); border-left: 3px solid var(--teal); display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--t2); line-height: 1.4; opacity: 0; transform: translateY(6px); animation: lcin .5s cubic-bezier(.22,1,.36,1) forwards; animation-delay: calc(var(--i) * .1s); } .lc-it b { color: var(--t1); font-size: 13px; }
@keyframes lcin { to { opacity: 1; transform: none; } }
.lc-it.tone-amber { border-color: var(--amber); } .lc-it.tone-purple { border-color: var(--purple); } .lc-it.tone-gold { border-color: #C9A24A; } .lc-it.tone-green { border-color: var(--green); }
.lc-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .lc-split > div { padding: 10px 14px; border-radius: 12px; background: var(--tint); border-top: 3px solid var(--teal); font-size: 13px; } .lc-split > div.tone-amber { border-color: var(--amber); }
.lc-split b { font-size: 13.5px; } .lc-split ul { list-style: none; margin: 6px 0 0; padding: 0; } .lc-split li { margin: 4px 0; line-height: 1.4; color: var(--t2); }
.lopts { display: flex; flex-direction: column; gap: 8px; }
.lopt { display: flex; align-items: flex-start; gap: 10px; text-align: left; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--ln2); background: #fff; font-size: 13.5px; line-height: 1.4; transition: .15s; } .lopt b { width: 22px; height: 22px; border-radius: 50%; background: var(--tint); display: grid; place-items: center; font-size: 11px; flex: none; }
.lopt:hover:not(:disabled) { border-color: var(--teal); transform: translateX(2px); } .lopt:disabled { cursor: default; }
.lopt.ok { border-color: var(--green); background: rgba(61,140,106,.08); } .lopt.ok b { background: var(--green); color: #fff; } .lopt.bad { border-color: var(--red); background: rgba(196,75,75,.07); } .lopt.bad b { background: var(--red); color: #fff; }
.lc-res { margin-top: 12px; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; background: var(--teal-soft); animation: materialize .4s both; } .lc-res.good { background: rgba(61,140,106,.1); } .lc-res.warn { background: rgba(196,137,10,.1); }
.lc-res > b { margin-right: 10px; } .lc-res .cdelta { margin-left: 0; } .lc-res p { margin: 4px 0 0; } .lc-res .score { font: 600 26px 'Cormorant Garamond', serif; }

/* sort activity */
.so-pool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 36px; margin-bottom: 10px; }
.so-chip { padding: 7px 13px; border-radius: 99px; border: 1px solid var(--ln2); background: #fff; font-size: 12.5px; transition: .15s; box-shadow: 0 2px 6px rgba(0,0,0,.04); } .so-chip:hover { border-color: var(--teal); }
.so-chip.sel { background: var(--teal); border-color: var(--teal); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(61,140,132,.3); }
.so-chip.miss { animation: shake .4s; border-color: var(--red); } .so-chip.placed { background: var(--teal-soft); border-color: transparent; color: var(--teal-d); box-shadow: none; cursor: default; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.so-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.so-col { text-align: left; padding: 8px 10px 10px; border-radius: 14px; border: 1.5px dashed var(--ln2); background: rgba(240,243,243,.6); min-height: 96px; transition: .15s; cursor: pointer; } .so-col:hover { border-color: var(--teal); background: var(--teal-soft); }
.so-col.miss { border-color: var(--red); background: rgba(196,75,75,.07); } .so-col h5 { margin: 0 0 6px; font: 600 10.5px 'JetBrains Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--t2); }
.so-drop { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }

/* risk rating grid */
.rt { display: flex; gap: 8px; align-items: stretch; max-width: 380px; }
.rt-y { display: grid; place-items: center; width: 16px; } .rt-y span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--t3); }
.rt-grid { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.rt-c { aspect-ratio: 1.25; border-radius: 8px; border: 2px solid transparent; font-size: 11px; font-family: 'JetBrains Mono', monospace; color: rgba(0,0,0,.45); transition: .15s; }
.rt-c.low { background: rgba(61,140,106,.22); } .rt-c.med { background: rgba(226,182,90,.4); } .rt-c.high { background: rgba(196,75,75,.3); }
.rt-c:hover { transform: scale(1.06); } .rt-c.pick { border-color: var(--t1); font-weight: 700; color: var(--t1); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.rt-c.ans { outline: 3px solid var(--teal); outline-offset: 1px; position: relative; } .rt-c.ans::after { content: 'Analyst'; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font: 600 8.5px 'Inter', sans-serif; background: var(--teal); color: #fff; padding: 1px 5px; border-radius: 99px; }
.rt-x { margin: 5px 0 0 24px; max-width: 356px; text-align: center; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--t3); }
.rt-ctl { display: flex; align-items: center; gap: 12px; margin-top: 10px; } .rt-sel { font-size: 12.5px; color: var(--t2); flex: 1; }

/* open answer */
.lta { width: 100%; min-height: 84px; font: inherit; font-size: 13.5px; padding: 10px 12px; border: 1px solid var(--ln2); border-radius: 12px; resize: vertical; background: #fff; } .lta:focus { outline: 2px solid var(--teal-soft); border-color: var(--teal); }

@media (max-width: 900px) { .sp-b { grid-template-columns: 1fr; gap: 8px; } .lc-grid, .lc-split, .so-cols { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .prac-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .prac-grid > section { position: static !important; }
}
/* Medium screens: with the Clara panel open the stage is narrow, so stack the wider activities */
@media (min-width: 901px) and (max-width: 1250px) { body.clara-open .lc-split, body.clara-open .so-cols { grid-template-columns: 1fr; } .sp-b { grid-template-columns: 1fr; gap: 8px; } }
@media (max-width: 640px) {
  #view.view-lesson { height: calc(100dvh - var(--mobile-nav-h)); padding: 10px 10px 8px; }
  .ls { gap: 8px; } .th-t h2 { font-size: 22px; } .lcard { padding: 12px 14px 14px; } .ls-feed { padding: 14px 12px 6px; } .ls-ctl { padding: 8px 12px 8px; }
  .th-r1 { flex-wrap: wrap; } .th-right { order: 3; }
  .ts-pill span { max-width: 78px; overflow: hidden; text-overflow: ellipsis; } .rt, .rt-x { max-width: 100%; }
  .tdone { flex-wrap: wrap; } .tdone .btn { width: 100%; justify-content: center; }
  #view.view-assess, #view.view-practical { padding: 12px 12px 90px; }
  .prac-grid #note { min-height: 240px !important; }
  .lc-grid, .lc-split, .so-cols { grid-template-columns: minmax(0, 1fr); }
  .lopt, .so-chip, .sp-h, .ls-ctl button { min-height: 44px; }
  .sp-h { flex-wrap: wrap; gap: 6px; }
  .sp-goal { flex-basis: 70%; white-space: normal; }
  .ls-stage { min-height: 0; }
  .ls-ctl { gap: 8px; }
  body.on-lesson #fab { display: none; }
  .ls-ask { display: block; }
  .ldots { flex-wrap: wrap; }
  .lnote { padding: 12px; gap: 8px; }
  .lnote > .lc-body { min-width: 0; }
  .rt-ctl { flex-wrap: wrap; }
}
@media (max-width: 640px) and (max-height: 500px) {
  body.on-lesson { overflow: auto; }
  #view.view-lesson { height: auto; min-height: calc(100dvh - var(--mobile-nav-h)); }
  .ls-feed { flex: none; max-height: 65dvh; min-height: 180px; }
}
