/* Learn (#38). Layout follows LearnView, LearningViews (CoachCard, DebriefView, QuizSection), ReadingViews and ScenarioViews. */
.panel-body.learn { container-type: inline-size; }
.ln-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 9px; background: rgba(118,118,128,.24); }
.ln-seg button { padding: 6px; border-radius: 7px; font-size: 13px; font-weight: 500; }
.ln-seg button.on { background: rgba(99,99,102,.9); font-weight: 600; }
.ln-search { width: 100%; padding: 9px 12px; border-radius: 10px; border: 0; background: rgba(118,118,128,.24); color: #fff; font: inherit; }
.ln-view { display: grid; gap: 12px; align-content: start; }
.ln-intro { font-size: 13px; color: rgba(235,235,245,.6); }
.ln-intro b { color: #fff; }
.ln-head, .ln-letter { margin: 4px 0 0 16px; font: 400 13px/1.2 system-ui, sans-serif; color: rgba(235,235,245,.6); text-transform: uppercase; }
.ln-items, .ln-rows { background: var(--paper); border-radius: 12px; overflow: hidden; display: grid; }
.ln-item, .ln-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; width: 100%; text-align: left; }
.ln-item + .ln-item, .ln-row + .ln-row { border-top: .5px solid rgba(255,255,255,.12); }
.ln-item .ic { color: var(--accent); padding-top: 2px; }
.ln-item .tx, .ln-row .tx { flex: 1; display: grid; gap: 2px; min-width: 0; }
.ln-item .tx b { font-size: 16px; font-weight: 600; font-family: system-ui, sans-serif; }
.ln-item .tx span, .ln-row .tx span { font-size: 12px; color: rgba(235,235,245,.6); }
.ln-row .tx b { font-size: 14px; font-weight: 600; }
.ln-item .chev, .ln-row .chev { color: rgba(235,235,245,.3); align-self: center; }
.ln-locked { display: flex; align-items: center; gap: 6px; font-size: 13px; color: rgba(235,235,245,.3); padding: 0 4px; }
.ln-empty { padding: 4px 16px; }
/* A wide panel shows the lessons as a grid of cards. */
@container (min-width: 600px) {
  .ln-view.concepts .ln-items { background: none; border-radius: 0; overflow: visible; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
  .ln-view.concepts .ln-head { display: none; }
  .ln-view.concepts .ln-item { flex-direction: column; background: var(--paper); border-radius: 16px; padding: 14px; min-height: 104px; border-top: 0; gap: 8px; }
  .ln-view.concepts .ln-item .ic { padding: 0; }
  .ln-view.concepts .ln-item .chev { display: none; }
  .ln-view.concepts .ln-item .tx span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .ln-view.concepts .ln-item .tx b { font-family: var(--din); font-size: 19px; }
}

/* The lesson card. */
.ln-card { gap: 20px; }
.ln-big { color: var(--accent); }
.ln-summary { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.25; }
.ln-detail { font-size: 17px; line-height: 1.4; }
.ln-ingame, .ln-read { display: grid; gap: 6px; }
.ln-ingame { padding: 16px; border-radius: 14px; background: rgba(242,165,65,.08); }
.ln-ingame p { font-size: 15px; color: rgba(235,235,245,.6); }
.ln-ingame h4, .ln-read h4, .ln-quiz h4 { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 600; }
.ln-read { gap: 8px; }
.ln-link { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--paper); border: 1px solid rgba(243,235,216,.2); color: inherit; text-decoration: none; }
.ln-link .ico { color: var(--accent); width: 28px; display: grid; place-items: center; }
.ln-link .tx { flex: 1; display: grid; gap: 2px; }
.ln-link .tx b { font-size: 15px; } .ln-link .tx span { font-size: 12px; color: rgba(235,235,245,.6); }
.ln-link > .sf:last-child { color: rgba(235,235,245,.6); }
.ln-quiz { position: relative; display: grid; gap: 10px; padding: 16px; border-radius: 14px; background: rgba(255,159,10,.08); overflow: hidden; }
.ln-quiz .head { display: flex; justify-content: space-between; align-items: center; }
.ln-quiz .q { font-size: 16px; }
.ln-quiz .opt { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 10px; border-radius: 10px; background: rgba(242,165,65,.08); }
.ln-quiz .opt.right { background: rgba(52,199,89,.18); }
.ln-quiz .opt.wrong { background: rgba(255,69,58,.15); }
.ln-quiz .opt.right .sf { color: var(--good); }
.ln-quiz .opt.wrong .sf { color: #ff453a; }
.ln-quiz .opt.dim { opacity: .5; }
.ln-quiz .opt:disabled { cursor: default; }
.ln-quiz .head .dots { display: flex; gap: 5px; }
.ln-quiz .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(235,235,245,.3); }
.ln-quiz .dot.right { background: var(--good); }
.ln-quiz .dot.wrong { background: #ff453a; }
.ln-quiz .dot.current { background: var(--accent); }
.ln-quiz .fb { font-size: 13px; display: grid; gap: 4px; }
.ln-quiz .fb b { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.ln-quiz .fb.right b, .ln-quiz .fb.answer b { color: var(--good); }
.ln-quiz .fb.wrong b { color: #ff453a; }
.ln-quiz .fb p { margin: 0; }
.ln-quiz .score { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.ln-quiz .score b { font-size: 21px; color: inherit; }
.ln-quiz .note { margin: 0; font-size: 16px; }
.ln-quiz .rev { display: flex; align-items: flex-start; gap: 8px; text-align: left; width: 100%; font-size: 13px; }
.ln-quiz .rev .sf:first-child { color: var(--good); flex: none; }
.ln-quiz .rev span { flex: 1; }
.ln-quiz .earned { display: flex; align-items: center; gap: 5px; margin: 0; font-size: 12px; color: var(--good); }
.ln-quiz .teacher { display: flex; align-items: center; gap: 6px; margin: 0; }
.ln-quiz .again { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 8px; background: rgba(118,118,128,.24); }
/* How Marginal works (the three intro cards). */
.ln-how { margin: 3px 0 0; font-size: 21px; font-weight: 400; }
.ln-steps { display: grid; grid-template-columns: 1fr; gap: 12px; }
@container (min-width: 600px) { .ln-steps { grid-template-columns: repeat(3, 1fr); } }
.ln-step { display: flex; gap: 14px; padding: 14px; border-radius: 16px; background: var(--paper); align-items: flex-start; }
.ln-step .art { position: relative; flex: none; width: 44px; height: 44px; border-radius: 12px; background: rgba(15,25,30,.7); color: var(--accent); display: grid; place-items: center; }
.ln-step .art .n { position: absolute; top: -6px; left: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #000; font: 13px/20px var(--din); text-align: center; }
.ln-step .tx { display: grid; gap: 3px; min-width: 0; }
.ln-step .tx b { font-size: 19px; font-weight: 400; padding-top: 3px; }
.ln-step .tx span { font-size: 12px; color: rgba(235,235,245,.6); }
.ln-quiz .foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.ln-quiz .foot .done { color: var(--good); }
.ln-quiz .next { font-size: 13px; font-weight: 600; color: var(--accent); }
.ln-quiz.shake { animation: ln-shake .35s linear; }
@keyframes ln-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.ln-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ln-confetti i { position: absolute; top: -8px; width: 7px; height: 11px; border-radius: 2px; animation: ln-fall 1.8s ease-in forwards; }
@keyframes ln-fall { to { transform: translate(var(--dx), 340px) rotate(var(--r)); opacity: 0; } }

/* The five-day recap and the challenge brief. */
.ln-dhead { display: flex; align-items: center; gap: 12px; }
.ln-dhead h3 { margin: 0; font-size: 30px; line-height: 1.1; padding-top: 4px; }
.ln-fico { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font: 700 22px var(--din); color: var(--accent); }
.ln-debrief .small, .ln-scenario .small { font-size: 12px; } .ln-debrief .tiny { font-size: 11px; }
.ln-total { display: flex; justify-content: space-between; align-items: baseline; }
.ln-total b { font-size: 40px; } .good { color: var(--good); } .bad { color: var(--stamp); }
.ln-growth { font: 600 12px/1 var(--num); padding: 4px 8px; border-radius: 999px; }
.ln-growth.good { background: rgba(52,199,89,.16); } .ln-growth.bad { background: rgba(232,85,62,.16); }
.ln-chart { position: relative; display: flex; gap: 8px; height: 134px; padding-bottom: 20px; }
.ln-chart .col { flex: 1; display: grid; grid-template-rows: 1fr 20px; justify-items: center; }
.ln-chart .plot { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; }
.ln-chart .zero { position: absolute; left: 0; right: 0; height: 1px; background: rgba(243,235,216,.3); margin-top: 0; z-index: 0; }
.ln-chart .bar { position: absolute; width: min(26px, 70%); border-radius: 4px; background: var(--accent); }
.ln-chart .bar.best { background: var(--good); } .ln-chart .bar.loss { background: var(--stamp); }
.ln-chart em { position: absolute; font: 700 11px/1 system-ui, sans-serif; font-style: normal; color: rgba(243,235,216,.7); } .ln-chart em.good { color: var(--good); }
.ln-chart .num { font-size: 11px; color: rgba(235,235,245,.6); padding-top: 4px; }
.ln-cost { display: flex; gap: 6px; align-items: center; }
.ln-tipshead { margin: 2px 0 0; font-size: 20px; }
.ln-tip { grid-template-columns: auto 1fr auto; align-items: start; }
.ln-tip.go { cursor: pointer; }
.ln-tip .dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); background: rgba(242,165,65,.15); }
.ln-tip .dot.warn { color: var(--orange); background: rgba(255,159,10,.15); }
.ln-tip > div { display: grid; gap: 8px; justify-items: start; } .ln-tip p { font-family: var(--round); font-size: 15px; }
.ln-exp { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: rgba(63,167,160,.12); }
.ln-exp > .sf { color: var(--teal); flex: none; margin-top: 2px; }
.ln-exp h4 { margin: 2px 0 0; font-size: 17px; } .ln-exp .act { font-size: 15px; font-weight: 600; } .ln-exp > div { display: grid; gap: 3px; }
.ln-scenario .card p { font-family: var(--round); }
.ln-scenario .goal, .ln-scenario .card p.secondary, .ln-scenario .hintline { display: flex; align-items: center; gap: 8px; }
.ln-debrief #lnback { position: sticky; bottom: 0; z-index: 1; box-shadow: 0 -12px 20px 4px var(--deep); }
.ln-btns { display: flex; gap: 10px; justify-content: space-between; }
.ln-btns.col { flex-direction: column; } .ln-btns.col .link { padding: 10px; color: var(--accent); font-size: 17px; }
.ln-btns .primarybtn, .ln-btns .secondarybtn { padding: 8px 14px; border-radius: 999px; font-weight: 600; }
.ln-btns .secondarybtn { background: rgba(118,118,128,.32); }
.ln-challenges .strong { font-weight: 600; font-size: 17px; }
.ln-chal { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; }
.ln-chal .tx { flex: 1; display: grid; } .ln-chal .tx b { font-size: 17px; } .ln-chal .tx span { font-size: 12px; color: rgba(235,235,245,.6); }
.ln-chal > .sf:last-child { color: var(--accent); } .ln-chal .ln-fico { width: 34px; height: 34px; font-size: 18px; }

/* Under the top bar: the tour's coach card and the challenge bar. */
#learnbar { border-radius: 20px; color: #fff; }
#learnbar.tour { display: grid; gap: 8px; padding: 16px; border-radius: 24px; border: 1.5px solid rgba(242,165,65,.55); }
#learnbar.tour .head { display: flex; align-items: center; gap: 10px; } #learnbar.tour .head b { flex: 1; font: 700 15px/1.2 var(--round); }
#learnbar.tour .head .ico { color: var(--accent); } #learnbar.tour .head .num { font-size: 12px; }
#learnbar.tour p { font: 13px/1.35 var(--round); }
#learnbar.tour .foot { display: flex; justify-content: space-between; align-items: center; }
#learnbar.tour .skip { font-size: 12px; color: rgba(235,235,245,.6); }
#learnbar.tour .turn { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--accent); }
#learnbar.tour .next { font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px; }
#learnbar:not(.tour) { display: flex; align-items: center; gap: 10px; padding: 8px 14px; }
#learnbar .ln-flag { color: var(--accent); }
#learnbar .mid { flex: 1; min-width: 0; display: grid; } #learnbar .mid b { font-size: 17px; padding-top: 2px; }
#learnbar .mid span { font: 12px var(--round); color: rgba(235,235,245,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#learnbar .right { display: grid; justify-items: end; gap: 1px; } #learnbar .right b { font-size: 15px; }
#learnbar progress { width: 64px; height: 4px; accent-color: var(--accent); }
#learnbar .info { color: #fff; display: grid; place-items: center; }
.ln-hint { position: fixed; z-index: 3; transform: translate(-50%, -50%); border-radius: 50%; border: 3px solid var(--accent); background: rgba(242,165,65,.18); pointer-events: none; animation: ln-pulse 1s ease-in-out infinite alternate; }
@keyframes ln-pulse { from { transform: translate(-50%, -50%) scale(1); } to { transform: translate(-50%, -50%) scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .ln-hint, .ln-quiz.shake { animation: none; } }

/* The tour's pointer on a control (iOS TourRing): a pulsing ring and a nudging finger. */
.tour-ring { position: relative; outline: 3px solid var(--accent); outline-offset: 4px; animation: tourring .7s ease-in-out infinite alternate; }
.tour-ring::after { content: "👆"; position: absolute; right: -14px; bottom: -22px; font-size: 22px; pointer-events: none; animation: tourfinger .7s ease-in-out infinite alternate; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
@keyframes tourring { to { outline-offset: 8px; outline-color: rgba(242,165,65,.45); } }
@keyframes tourfinger { to { transform: translate(-6px, -6px); } }

.ln-scenario .ln-score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.ln-scenario .ln-score b { font-size: 22px; } .ln-scenario .ln-score span { font-size: 14px; }
