/* assets/css/learn.css — the Learn tab in Orbit (Phase 240, board 2i "The voyage"; design-language.md).
   Every size, colour and string comes from the board's generator (.docs/proofs/phase240/gen.py: D2B, D2B_CSS,
   ART_CSS). The night panel IS the next lesson: the course and the chapter on top, the next step with the
   screen's one button, and today's reviews as a small note beside it. The trail and the side cards are below it.
   ⚠️ LINKED LIKE home.css (index.php): after it and before responsive.css on a signed-in page, deferred on a public
   one (a sign-in reaches /learn without a reload). The `.orbit-*` material it builds on is public.css's. */

/* ── The page: the board's ground, the voyage behind it, and the board's 1240 column ─────────────────── */
/* The board's ground (its `.app`): the page colour with one violet-to-peach glow high on the right, in place of the
   signed-in canvas. The art runs from the top of the PAGE, behind the clear bar (owner, 2026-11-02: the header and
   the background did not match the board), so both sit on <body>. The art is a background, never markup, so a screen
   reader skips it and it can never lengthen a short page. `max(100%,1440px) auto` from the top centre is the board's
   `xMidYMin slice` on a 1500px box: the 1440×1500 drawing at its own size up to 1440px, scaled beyond it. Out-ranks
   the canvas's body.cosmic-theme rule (variables.css) by its id. Practice, Speak and You stand on the same ground
   (owner, 2026-11-03: their boards drew only the glow), so switching tabs never moves it; they keep no rule of their
   own. Every tab's sheet loads on every signed-in page, so this one rule reaches all four. */
body:has(>main#app-root>:is(.lpanel,.pr-grid,.sp-grid,.you-page)){background:url("/assets/img/learn/voyage-page.svg") center 0/max(100%,1440px) auto no-repeat,radial-gradient(ellipse 620px 420px at 88% 60px,rgba(217,210,251,0.55) 0%,rgba(252,227,212,0.3) 50%,rgba(250,248,253,0) 78%),var(--orbit-page);}
/* The panel sits on the board's column: 1240 with 32px sides, so 1176px at 1280. Its top is the board's 92px down the
   page (a 72px bar and 20px): our bar is 70px and main#app-root's own margin is 20px, so 2px of its own. */
.lpanel{width:calc(100% - 64px);max-width:1176px;margin:2px auto 0;padding:26px 40px 34px;line-height:normal;background:url("/assets/img/learn/voyage-panel-wide.svg") center/cover no-repeat,linear-gradient(135deg,var(--orbit-night) 0%,var(--text-color) 55%,var(--orbit-night-high) 100%);}
/* ⚠️ THE GRID UNDER THE PANEL TAKES THE BOARD'S TRACKS, NOT THE SHARED ONES. Practice and Speak keep --lpage-main
   (800px) beside 340px; Learn's main column is the rest of the 1176px row, 32px from its cards. It stays a direct
   child of #app-root, so the shared rules that key on that (the view transitions, the empty-column collapse) still
   find it. The empty-column collapse does NOT apply here on purpose: the track holds still when the cards fail
   rather than widening the path under the learner's eyes. */
#app-root>.lpanel~.lpage-grid{box-sizing:border-box;max-width:1240px;margin:32px auto 0;padding:0 32px;grid-template-columns:minmax(0,1fr) 340px;gap:32px;justify-content:stretch;}
#app-root>.lpanel~.lpage-grid>.learn-page{padding:0 0 96px;}
#app-root>.lpanel~.lpage-grid>.lpage-side{padding:0 0 40px;}

/* ── The top row: the course, the chapter, how far, the bar ───────────────────────────────────────── */
.lpanel-top{display:flex;flex-wrap:wrap;align-items:center;gap:12px 18px;padding-bottom:22px;border-bottom:1px solid rgba(255,255,255,0.12);}
/* The course chip opens the course sheet. Drawn 40px high; the ::before lends it the house's 44px target without
   changing what is drawn. */
.lpanel-chip{position:relative;display:inline-flex;align-items:center;gap:10px;min-height:40px;padding:0 14px 0 6px;border:1px solid rgba(255,255,255,0.18);border-radius:999px;background:rgba(255,255,255,0.08);color:#FFFFFF;font:inherit;font-size:15px;font-weight:800;cursor:pointer;}
.lpanel-chip::before{content:"";position:absolute;inset:-2px 0;}
.lpanel-chip::after{content:"";width:7px;height:7px;margin-left:2px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg) translateY(-3px);}
.lpanel-chip:hover,.lpanel-chip[aria-expanded="true"]{border-color:rgba(255,255,255,0.34);background:rgba(255,255,255,0.14);}
.lpanel-chip-code{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:rgba(183,173,255,0.22);font-size:12px;font-weight:800;}
.lpanel-chip-code:empty{display:none;}
.lpanel-title{margin:0;font-family:var(--font-display),sans-serif;font-size:22px;font-weight:700;line-height:normal;letter-spacing:-.01em;color:#FFFFFF;}
.lpanel-count{color:var(--orbit-night-sub);font-size:15px;font-weight:700;}
/* No zeros (academy.md § Phase 155): nothing done yet, nothing stated, and the empty span takes no gap. */
.lpanel-count:empty{display:none;}
.lpanel-bar{flex:1 1 140px;max-width:260px;height:8px;overflow:hidden;border-radius:999px;background:rgba(255,255,255,0.14);}
.lpanel-bar>span,.lc-orbit-bar>span{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--orbit-stage-1),var(--orbit-stage-2),var(--orbit-stage-3),var(--orbit-stage-4),var(--orbit-stage-5));transition:width 0.35s ease;}

/* ── The next step and today's reviews ──────────────────────────────────────────────────────────── */
.lpanel-main{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:28px;padding-top:26px;}
.lpanel-next{min-width:0;}
.lpanel-eyebrow{margin:0;color:var(--orbit-night-eyebrow);font-size:13px;font-weight:800;letter-spacing:.16em;text-transform:uppercase;}
.lpanel-next-title{display:block;margin-top:6px;font-family:var(--font-display),sans-serif;font-size:46px;font-weight:700;line-height:1.04;letter-spacing:-.02em;color:#FFFFFF;overflow-wrap:anywhere;}
.lpanel-next-sub{display:block;margin-top:6px;color:var(--orbit-night-sub);font-size:17px;font-weight:700;}
.lpanel-next-sub:empty{display:none;}
.lpanel .orbit-btn{gap:10px;white-space:nowrap;}
.lpanel-rev{display:flex;align-items:center;gap:16px;padding:18px 22px;border:1px solid rgba(255,255,255,0.12);border-radius:20px;background:rgba(255,255,255,0.06);}
/* The sun: the screen's one coral thing (design-language.md rule 3). Text on coral is ink (white is 2.6:1). */
.lpanel-sun{flex:none;display:grid;place-items:center;width:56px;height:56px;border-radius:50%;background:radial-gradient(circle at 45% 40%,#FFE3C8,var(--orbit-stage-5) 55%,var(--secondary));box-shadow:0 0 0 9px rgba(255,154,110,0.12);color:var(--text-color);font-family:var(--font-display),sans-serif;font-size:22px;font-weight:700;}
.lpanel-rev-title{display:block;color:#FFFFFF;font-size:17px;font-weight:700;}
.lpanel-rev-sub{display:block;color:var(--orbit-night-sub);font-size:14px;font-weight:700;}
.lpanel-rev-sub:empty{display:none;}
.lpanel-link{display:inline-flex;align-items:center;min-height:44px;color:#FFFFFF;font-size:15px;font-weight:800;text-decoration:none;background:linear-gradient(var(--orbit-night-eyebrow),var(--orbit-night-eyebrow)) left calc(100% - 8px)/100% 2px no-repeat;}
.lpanel-link:hover{color:var(--orbit-night-eyebrow);}
/* The violet ring only just clears 3:1 on the panel's lightest stop; the night eyebrow is 6.6:1 on all of it. */
.lpanel :is(a,button):focus-visible{outline:2px solid var(--orbit-night-eyebrow);outline-offset:3px;}

/* Placeholders on night: the same frames as the light ones (academy.css § Phase 177b), in the panel's own tint. */
.lpanel .skeleton-bar{background:rgba(255,255,255,0.10);}
.lpanel .skeleton-bar::after{background:linear-gradient(90deg,transparent,rgba(255,255,255,0.16),transparent);}
.lpanel-sk-next{display:block;width:min(420px,70vw);}
.lpanel-sk-rev{display:flex;align-items:center;gap:16px;}
/* 51px, not the title's 46: the bar stands for the title's line box, and the whole next-step placeholder then
   reads the real block's height at 1536 (179px, measured). The phone block puts it back to 40. */
.lpanel-sk-title{width:min(420px,70vw);height:51px;margin-top:12px;border-radius:12px;}
.lpanel-sk-count{width:170px;height:21px;border-radius:8px;}
/* A course that failed to load writes its error into the path and never writes the count: drop the bar too. */
#app-root:has(#learn-path>.lp-empty) .lpanel-sk-count{display:none;}
.lpanel-sk-sub{width:min(260px,50vw);margin-top:14px;}
.lpanel-sk-btn{width:200px;height:54px;margin-top:24px;border-radius:14px;}
.lpanel-sk-sun{flex:none;width:56px;height:56px;border-radius:50%;}
.lpanel-sk-lines{display:flex;flex-direction:column;gap:10px;width:180px;}

/* ── "Your path": its head, and the one card the trail sits in (board 2i `.sech`, `.path`) ──────────── */
.learn-pathhead{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:14px;}
.learn-pathhead-text{min-width:0;}
/* The eyebrow keeps its line while learn.js has not written it, so the title and the card never move. */
.learn-pathhead-course{min-height:1.4em;line-height:1.4;}
.learn-pathhead-title{margin:6px 0 0;font-family:var(--font-display),sans-serif;font-size:32px;font-weight:700;line-height:1.08;letter-spacing:-.01em;}
.learn-pathjump{flex:none;display:inline-flex;align-items:center;min-height:44px;padding:0;border:0;background:linear-gradient(var(--orbit-night-eyebrow),var(--orbit-night-eyebrow)) left calc(100% - 8px)/100% 2px no-repeat;color:var(--text-color);font:inherit;font-size:16px;font-weight:800;cursor:pointer;}
.learn-pathjump:hover{color:var(--primary-hover);}
.learn-path{padding:10px 28px 18px;}
/* While the placeholder trail is in the card, the card holds the folded path's height (measured: 768px at 1536,
   940px at 390, for a course on its first chapter), so the trail landing does not grow it on screen. Only while:
   the card is a visible orbit-card, and a course with nothing published yet or a short last level is shorter. */
.learn-path{--learn-path-h:768px;}
.learn-path:has(>.sk-path){min-height:var(--learn-path-h);}
.learn-path :is(a,button):focus-visible,.lp-hint:focus-visible,.learn-pathjump:focus-visible{outline:2px solid var(--primary);outline-offset:2px;border-radius:12px;}

/* ── The trail: one numbered node per step on one rail ───────────────────────────────────────────── */
.lp-trail{margin:0;padding:0;list-style:none;}
.lp-trail>.lp-step{position:relative;display:flex;align-items:center;gap:16px;}
/* ⚠️ THE RAIL IS DRAWN PER STEP, so each step can say whether the line through it is walked. A trail's first and
   last segments stop at their node's centre; a trail of one step (the exam) has no line at all. */
.lp-trail>.lp-step::before{content:"";position:absolute;top:0;bottom:0;left:19px;width:2px;background:var(--orbit-control-edge);}
.lp-trail>.lp-step:first-child::before{top:50%;}
.lp-trail>.lp-step:last-child::before{bottom:50%;}
.lp-trail>.lp-step:only-child::before{content:none;}
/* `is-behind` is position, `is-done` is state (learn.js renderPath() says why both). */
.lp-trail>.lp-step:is(.is-behind,.is-done)::before{background:var(--primary);}
/* Where you are: a tinted row wider than the trail, so its segment reaches over the row's margins and is walked
   down to the node's centre. */
.lp-trail>.lp-step.is-current{margin:4px -14px;padding:0 14px;border-radius:16px;background:var(--orbit-violet-wash);}
.lp-trail>.lp-step.is-current::before{top:-4px;bottom:-4px;left:33px;background:linear-gradient(var(--primary) 50%,var(--orbit-control-edge) 50%);}
.lp-trail>.lp-step.is-current:first-child::before{top:50%;background:var(--orbit-control-edge);}
.lp-trail>.lp-step.is-current:last-child::before{bottom:50%;background:var(--primary);}
.lp-rail{position:relative;z-index:1;flex:none;display:grid;}
.lp-node{box-sizing:border-box;display:grid;place-items:center;width:40px;height:40px;border:2px solid var(--orbit-control-edge);border-radius:50%;background:#FFFFFF;color:var(--text-muted);font-size:15px;font-weight:800;}
/* The milestones are squares, gold until done: the house's gold chip (public.css `.orbit-chip--gold`) edged in gold. */
.lp-node--square{border-radius:12px;}
.lp-node--gold{border-color:var(--accent);background:#FDEFD9;color:#9A5A0A;}
.lp-node--done{border-color:var(--primary);background:var(--primary);color:#FFFFFF;}
.lp-node--current{border-color:var(--primary);color:var(--primary-hover);box-shadow:0 0 0 6px var(--orbit-violet-tint);}
.learn-path .lp-trail .lp-row{display:flex;align-items:center;gap:12px;flex:1;min-width:0;padding:13px 0;color:var(--text-color);text-decoration:none;}
.learn-path .lp-row-title{font-size:17px;font-weight:800;}
.learn-path .lp-row-sub{overflow:visible;font-size:14px;font-weight:600;white-space:normal;}
.learn-path a.lp-row:hover .lp-row-title{color:var(--primary-hover);}
.lp-state{flex:none;color:var(--text-muted);font-size:13px;font-weight:800;white-space:nowrap;}
.lp-state.is-ok{color:var(--orbit-violet-ink);}
.lp-hint{display:grid;place-items:center;flex:0 0 34px;width:34px;min-height:44px;color:var(--text-muted);font-size:13px;cursor:help;}

/* ── The rows between trails: a chapter, the finished chapters, the rest of the level ─────────────── */
/* A hairline marks a row (design-language.md rule 6): above every chapter-level row but the card's first. */
.learn-path :is(.lp-step--chapter,.lp-step--history,.lp-step--fold),.learn-path .lp-trail--exam{margin-top:8px;border-top:1px solid var(--orbit-hairline);}
.learn-path>:first-child{margin-top:0;border-top:0;}
.learn-path :is(.lp-row--chapter,.lp-row--history,.lp-row--fold){display:flex;align-items:center;gap:12px;width:100%;min-height:44px;padding:16px 0 4px;border:0;background:none;color:var(--text-color);font:inherit;text-align:left;cursor:pointer;}
.learn-path :is(.lp-row--chapter,.lp-row--history,.lp-row--fold) .lp-row-title{font-size:16px;}
.learn-path :is(.lp-row--chapter,.lp-row--history,.lp-row--fold):hover .lp-row-title{color:var(--primary-hover);}
/* An OPEN chapter's head is ONE label row over its trail, the board's `.chap`: "CHAPTER 11 · MY DAILY ROUTINE" on
   the left, how many lessons are done on the right (owner, 2026-11-02: the two-line head did not match). The name
   the board has no fixture for rides in the same eyebrow, so the panel's heading can be the number alone. */
.learn-path .lp-step--chapter.is-open .lp-row--chapter{align-items:baseline;padding:14px 0 8px;}
.lp-chap-name,.lp-chap-title{color:var(--primary-hover);font-size:13px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;white-space:nowrap;}
.lp-chap-name{flex:none;}
.lp-chap-title{flex:1 1 auto;min-width:0;margin-left:-4px;overflow:hidden;text-overflow:ellipsis;}
.lp-chap-title::before{content:"· " / "";}
.lp-step--chapter.is-open .lp-state{margin-left:auto;font-size:14px;font-weight:700;}
.lp-chevron-toggle{transition:transform 0.18s ease;}
.lp-step.is-open .lp-chevron-toggle{transform:rotate(90deg);}

/* The placeholder trail's rows sit like the trail's (its rail and nodes: academy.css `.sk-path`). */
.learn-path .sk-path .sk-row{gap:16px;min-height:0;padding:13px 0;}

/* ── The side cards (board TODAY and WORDS): context beside the path, never a second action ─────────── */
/* (Their column at desktop widths is the min-width:1025px block at the end of this file.) */
.lc-orbit{padding:22px 24px;}
/* 28px whether or not the streak chip is there, so a first streak does not move the card under it. */
.lc-orbit-head{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:28px;}
.lc-orbit-title{margin:0;font-family:var(--font-display),sans-serif;font-size:20px;font-weight:700;letter-spacing:-.01em;line-height:1.3;}
.lc-orbit-state{color:var(--text-muted);font-size:13px;font-weight:800;white-space:nowrap;}
.lc-orbit-big{display:flex;align-items:baseline;gap:8px;margin:14px 0 0;color:var(--text-color);font-size:16px;}
.lc-orbit-n{font-family:var(--font-display),sans-serif;font-size:40px;font-weight:700;line-height:1;}
.lc-orbit-u{color:var(--text-secondary);font-weight:700;}
.lc-orbit-bar{display:block;height:8px;margin-top:12px;overflow:hidden;border-radius:999px;background:var(--orbit-card-edge);}
.lc-orbit-sub{margin:8px 0 0;color:var(--text-secondary);font-size:14px;font-weight:700;}
/* The rings, each as wide as its count; the 3px gaps show the card through. Empty, it is a plain track. */
.lc-stagebar{display:flex;gap:3px;height:12px;margin-top:16px;overflow:hidden;border-radius:999px;}
.lc-stagebar:empty{background:var(--orbit-card-edge);}
.lc-stagebar>i{display:block;min-width:3px;}
.lc-stage-1{background:var(--orbit-stage-1);}
.lc-stage-2{background:var(--orbit-stage-2);}
.lc-stage-3{background:var(--orbit-stage-3);}
.lc-stage-4{background:var(--orbit-stage-4);}
.lc-stage-5{background:var(--orbit-stage-5);}
.lc-legend{display:flex;justify-content:space-between;gap:12px;margin-top:8px;color:var(--text-muted);font-size:13px;font-weight:800;}
/* The placeholders keep the cards' heights (178 and 183 at 340px), so nothing under them moves when they fill: each
   bar sits where its line will, a 12px bar centred in a 22px line. */
.lc-orbit.sk-card{gap:0;}
.lc-orbit.sk-card>.sk-head{min-height:28px;}
.skeleton-bar.lc-sk-big{width:46%;height:40px;margin-top:14px;}
.skeleton-bar.lc-sk-bar{width:100%;height:8px;margin-top:12px;}
.skeleton-bar.lc-sk-stages{width:100%;height:12px;margin-top:16px;}
.lc-orbit.sk-card>.lc-sk-legend{min-height:12px;margin:12px 0 5px;}
.skeleton-bar.lc-sk-line{height:12px;margin:13px 0 5px;}
.skeleton-bar.lc-sk-line+.lc-sk-line{margin-top:5px;}

/* ── The view transitions (academy.css § Phase 177b): one name per piece, none on a `swap` ──────────── */
main#app-root>.lpanel{view-transition-name:learn-panel;}
main#app-root>.lpanel~.lpage-grid{view-transition-name:page-learn;}
html.vt-swap main#app-root>.lpanel,html.vt-swap main#app-root>.lpanel~.lpage-grid{view-transition-name:none;}

/* ── Below the cards' breakpoint the column is the path alone (responsive.css removes the cards) ──── */
@media (max-width:1024px){
    #app-root>.lpanel~.lpage-grid{grid-template-columns:minmax(0,1fr);}
    /* ⚠️ A CLOSED CHAPTER STATES ITS SHAPE FROM 1024 DOWN, NOT AT THE UTILITIES' OWN 600 (components.css): three
       lesson titles need the room a desk has; narrower they are one ellipsis. Scoped: the utilities are shared. */
    .learn-path .lp-row--chapter .lp-only-wide{display:none;}
    .learn-path .lp-row--chapter .lp-only-narrow{display:inline;}
}
/* ── The phone (the board at 390): 16px sides, the narrow voyage, the button across the panel ───────── */
@media (max-width:640px){
    body:has(>main#app-root>:is(.lpanel,.pr-grid,.sp-grid,.you-page)){background-size:max(100%,1152px) auto,auto;}
    .lpanel{width:calc(100% - 32px);margin-top:4px;padding:20px 20px 24px;border-radius:28px;background-image:url("/assets/img/learn/voyage-panel-narrow.svg"),linear-gradient(135deg,var(--orbit-night) 0%,var(--text-color) 55%,var(--orbit-night-high) 100%);}
    #app-root>.lpanel~.lpage-grid{padding:0 16px;}
    .lpanel-top{gap:10px 12px;padding-bottom:16px;}
    .lpanel-main{gap:20px;padding-top:20px;}
    .lpanel-next{flex:1 1 100%;}
    .lpanel-next-title{font-size:36px;}
    .lpanel .orbit-btn{width:100%;}
    .lpanel-rev{flex:1 1 100%;padding:14px 16px;}
    .learn-pathhead-title{font-size:26px;}
    .learn-path{--learn-path-h:940px;padding:6px 18px 14px;}
    .lpanel-sk-title{height:40px;}
    /* The state drops under the title, so the node lines up with the title rather than the whole row, and the
       rail's ends follow it: 13px of padding plus half the node. */
    .lp-trail>.lp-step{align-items:flex-start;gap:14px;}
    .lp-rail{margin-top:13px;}
    .lp-trail>.lp-step:first-child::before{top:33px;}
    .lp-trail>.lp-step:last-child::before{bottom:calc(100% - 33px);}
    .lp-trail>.lp-step.is-current{margin:4px -10px;padding:0 10px;}
    .lp-trail>.lp-step.is-current::before{left:29px;background:linear-gradient(var(--primary) 37px,var(--orbit-control-edge) 37px);}
    .lp-trail>.lp-step.is-current:first-child::before{top:33px;}
    .lp-trail>.lp-step.is-current:last-child::before{bottom:calc(100% - 33px);}
    .learn-path .lp-trail .lp-row{flex-wrap:wrap;row-gap:8px;}
    .learn-path .lp-trail .lp-row-text{flex:1 1 100%;}
    .lp-hint{margin-top:13px;}
    /* ⚠️ A CHAPTER'S NAME WRAPS, A LESSON'S DOES NOT: a chapter head is read, a lesson row glanced at, and at 375px
       an ellipsis took a real chapter's last word ("My daily rout…"). */
    .learn-path :is(.lp-row--chapter .lp-row-title,.lp-chap-title){overflow:visible;text-overflow:clip;white-space:normal;}
    /* The open chapter's name drops under its number: between the number and the count it wrapped three lines deep. */
    .learn-path .lp-step--chapter.is-open .lp-row--chapter{flex-wrap:wrap;row-gap:2px;}
    .lp-chap-title{order:1;flex-basis:100%;margin-left:0;}
    .lp-chap-title::before{content:none;}
}

/* ⚠️ THE SIDE CARDS ARE A COLUMN, NOT THE SHARED TWO-UP. Between 1025 and 1240 responsive.css folds `.lpage-side`
   into a two-card grid under a single track; Learn keeps its 340px track at those widths (the grid rule at the top),
   so its cards would be 170px each. Scoped to the cards' own widths: below them responsive.css removes the column,
   and this must not out-specify that. */
@media (min-width:1025px){#app-root>.lpanel~.lpage-grid>.lpage-side{display:flex;flex-direction:column;align-items:stretch;gap:20px;}}

@media (prefers-reduced-motion:reduce){.lp-chevron-toggle{transition:none;}}
