/* /ll4 — guided companion. Scoped under .ll4; reuses app.css "Air" tokens. */
.ll4 { --ll4-maxw: 760px; --ll4-line: var(--hairline); --ll4-soft: var(--accent-soft); }
.ll4 .ll4-wrap { max-width: var(--ll4-maxw); margin: 0 auto; padding: 0 20px; }
.ll4 .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ll4 :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* hero */
.ll4 .hero-air { padding: 56px 20px 28px; }
.ll4 .hero-air h1 { font-size: clamp(2rem, 6vw, 3.4rem); max-width: 18ch; }
.ll4 .hero-air .sub { max-width: 52ch; margin-bottom: 22px; }
.ll4 .ll4-lang { display: inline-block; font-size: 13px; color: var(--ink-3); border: 1px solid var(--ll4-line); border-radius: var(--r-pill); padding: 3px 10px; margin-bottom: 14px; }
.ll4 .ll4-disclose { font-size: 14px; color: var(--ink-2); max-width: 60ch; margin: 0 auto 26px; line-height: 1.5; }
.ll4 .ll4-refrain { font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }

/* preview of the finished output */
.ll4 .ll4-preview { background: var(--bg-alt); border: 1px solid var(--ll4-line); border-radius: var(--r-card); padding: 22px; margin: 26px auto 0; max-width: 620px; text-align: left; }
.ll4 .ll4-preview .k { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.ll4 .ll4-preview blockquote { font-size: 15px; line-height: 1.55; color: var(--ink); }
.ll4 .ll4-preview blockquote p + p { margin-top: 10px; }
.ll4 .ll4-preview .meta { font-size: 13px; color: var(--ink-3); margin-top: 12px; line-height: 1.5; }

.ll4 .ll4-access { font-size: 14px; color: var(--ink-2); max-width: 620px; margin: 14px auto 0; text-align: left; background: #fff; border: 1px dashed #d2d2d7; border-radius: 14px; padding: 12px 16px; line-height: 1.5; }
.ll4 .cta-row { margin: 26px 0 0; }
.ll4 .cta-row .btn { font-size: 16px; }

/* sticky progress */
.ll4 .ll4-progress { position: sticky; top: var(--nav-h); z-index: 900; background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--ll4-line); }
.ll4 .ll4-progress .in { max-width: var(--ll4-maxw); margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 10px; }
.ll4 .ll4-progress .lbl { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.ll4 .ll4-progress .lbl b { color: var(--ink); }
.ll4 .ll4-steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex: 1; }
.ll4 .ll4-steps a { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #d2d2d7; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.ll4 .ll4-steps a[aria-current="step"] { border-color: var(--accent); color: var(--accent); background: var(--ll4-soft); }
.ll4 .ll4-steps a.done { background: var(--ink); color: #fff; border-color: var(--ink); }
.ll4 .ll4-progress .btn-sm { font-size: 13px; padding: 7px 14px; }
.ll4 .ll4-progress meter, .ll4 .ll4-progress progress { display: none; }
@media (max-width: 480px) {
  .ll4 .ll4-progress .lbl { display: none; }
  .ll4 .ll4-steps a { width: 28px; height: 28px; font-size: 12px; }
}

/* main flow */
.ll4 .ll4-main { padding: 12px 0 72px; }
.ll4 .ll4-step { padding: 40px 0 8px; border-top: 1px solid var(--ll4-line); scroll-margin-top: calc(var(--nav-h) + 56px); }
.ll4 .ll4-step:first-child { border-top: 0; }
.ll4 .ll4-marker { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.ll4 .ll4-marker .num { font-weight: 700; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
.ll4 .ll4-marker .stage { background: var(--bg-alt); border-radius: var(--r-pill); padding: 2px 10px; color: var(--ink-2); }
.ll4 .ll4-step h2 { font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 10px; }
.ll4 .ll4-step > p, .ll4 .ll4-card > p, .ll4 .ll4-step li { font-size: 16px; line-height: 1.6; color: var(--ink); }
.ll4 .ll4-step > p + p { margin-top: 12px; }
.ll4 .ll4-have { font-size: 14px; color: var(--ink-2); background: var(--bg-alt); border-radius: 12px; padding: 10px 14px; margin: 0 0 18px; }
.ll4 .ll4-have b { color: var(--ink); }
.ll4 .ll4-card { background: #fff; border: 1px solid var(--ll4-line); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 22px; margin: 18px 0; }
.ll4 .ll4-card h3 { font-size: 17px; margin-bottom: 8px; letter-spacing: -0.01em; }
.ll4 .ll4-card p + p { margin-top: 10px; }
.ll4 .ll4-card ul, .ll4 .ll4-card ol { padding-left: 22px; margin-top: 8px; }
.ll4 .ll4-card li + li { margin-top: 6px; }
.ll4 .ll4-note { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.ll4 .ll4-warn { border-left: 3px solid #f59e0b; background: #fffbeb; padding: 10px 14px; border-radius: 0 12px 12px 0; font-size: 14px; color: #7c2d12; margin-top: 12px; }
.ll4 .ll4-refrain-line { margin: 22px 0 8px; font-size: 17px; font-weight: 700; color: var(--accent); }
.ll4 details { border: 1px solid var(--ll4-line); border-radius: 14px; padding: 10px 14px; margin: 12px 0; background: #fff; }
.ll4 details summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.ll4 details[open] summary { margin-bottom: 8px; }
.ll4 details p, .ll4 details li { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.ll4 details ul { padding-left: 20px; }

/* role table */
.ll4 .ll4-roles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.ll4 .ll4-role { border: 1px solid var(--ll4-line); border-radius: 14px; padding: 12px 14px; background: #fff; }
.ll4 .ll4-role b { display: block; font-size: 15px; }
.ll4 .ll4-role .job { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ll4 .ll4-role p { font-size: 13px; color: var(--ink-2); margin-top: 4px; line-height: 1.45; }
.ll4 .ll4-role.you { background: var(--ll4-soft); border-color: #d9c8fb; }
@media (max-width: 520px) { .ll4 .ll4-roles { grid-template-columns: 1fr; } }

/* packet */
.ll4 .ll4-packet { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.ll4 .ll4-packet li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; font-size: 15px; line-height: 1.5; padding: 8px 10px; border-radius: 10px; background: var(--bg-alt); }
.ll4 .ll4-packet li code { font-weight: 700; color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; padding-top: 2px; }
.ll4 .ll4-packet li.i { background: #fdf4ff; }
.ll4 .ll4-packet li.i code { color: #a21caf; }
.ll4 .ll4-packet li.u { background: #fff7ed; }
.ll4 .ll4-packet li.u code { color: #c2410c; }
.ll4 .ll4-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--ink-2); }

/* prompt block */
.ll4 .ll4-prompt { border: 1px solid var(--ll4-line); border-radius: 16px; overflow: hidden; margin: 14px 0; background: #fff; }
.ll4 .ll4-prompt .bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--ll4-line); background: var(--bg-alt); font-size: 13px; color: var(--ink-2); }
.ll4 .ll4-prompt .bar b { color: var(--ink); }
.ll4 .ll4-prompt .bar .grow { flex: 1; }
.ll4 pre.ll4-raw { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; padding: 14px 16px; margin: 0; max-height: 420px; overflow: auto; color: var(--ink); background: #fff; }
.ll4 .ll4-copy-msg { font-size: 13px; padding: 8px 14px; border-top: 1px solid var(--ll4-line); color: var(--ok); }
.ll4 .ll4-copy-msg.err { color: #b45309; }
.ll4 .ll4-copy-msg[hidden] { display: none; }

/* figures / lightbox */
.ll4 .ll4-figs { display: grid; gap: 14px; margin: 14px 0; }
.ll4 .ll4-fig { margin: 0; border: 1px solid var(--ll4-line); border-radius: 16px; overflow: hidden; background: #fff; }
.ll4 .ll4-fig button { display: block; width: 100%; border: 0; padding: 0; background: var(--bg-alt); cursor: zoom-in; text-align: left; }
.ll4 .ll4-fig img { width: 100%; height: auto; display: block; }
.ll4 .ll4-fig figcaption { font-size: 13px; color: var(--ink-2); padding: 10px 14px; line-height: 1.5; border-top: 1px solid var(--ll4-line); }
.ll4 .ll4-fig figcaption b { color: var(--ink); }
.ll4 .ll4-fig .real { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: var(--ll4-soft); padding: 2px 8px; border-radius: var(--r-pill); margin-right: 6px; }
.ll4-lightbox { border: 0; border-radius: 16px; padding: 0; max-width: min(96vw, 1400px); max-height: 94vh; background: #fff; box-shadow: var(--shadow-pop); }
.ll4-lightbox::backdrop { background: rgba(0,0,0,.55); }
.ll4-lightbox .lb-in { display: flex; flex-direction: column; max-height: 94vh; }
.ll4-lightbox img { max-width: 100%; max-height: calc(94vh - 92px); width: auto; height: auto; object-fit: contain; display: block; margin: 0 auto; }
.ll4-lightbox .lb-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--hairline); font-size: 14px; color: var(--ink-2); }
.ll4-lightbox .lb-bar p { flex: 1; line-height: 1.4; }

/* output tabs */
.ll4 .ll4-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 0; }
.ll4 .ll4-tabs [role="tab"] { border: 1px solid #d2d2d7; background: #fff; border-radius: var(--r-pill); padding: 7px 14px; font-size: 14px; color: var(--ink-2); }
.ll4 .ll4-tabs [role="tab"][aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.ll4 .ll4-tabpanel { border: 1px solid var(--ll4-line); border-radius: 16px; margin-top: 10px; overflow: hidden; background: #fff; }
.ll4 .ll4-tabpanel .bar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--ll4-line); background: var(--bg-alt); font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.ll4 .ll4-tabpanel .bar .grow { flex: 1; }
.ll4 .ll4-tabpanel[hidden] { display: none; }

/* exercises */
.ll4 .ll4-ex { border: 1px solid #d9c8fb; background: linear-gradient(180deg, #faf7ff, #fff); border-radius: var(--r-card); padding: 22px; margin: 18px 0; }
.ll4 .ll4-ex .k { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.ll4 .ll4-ex h3 { font-size: 18px; margin-bottom: 6px; }
.ll4 .ll4-ex > p { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.ll4 .ll4-claim { border: 1px solid var(--ll4-line); border-radius: 14px; padding: 12px 14px; margin-top: 10px; background: #fff; }
.ll4 .ll4-claim .q { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.ll4 .ll4-claim .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ll4 .ll4-opt { border: 1px solid #d2d2d7; background: #fff; border-radius: var(--r-pill); padding: 7px 14px; font-size: 14px; color: var(--ink); }
.ll4 .ll4-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--ll4-soft); color: var(--accent); }
.ll4 .ll4-fb { font-size: 14px; line-height: 1.5; margin-top: 8px; padding: 8px 12px; border-radius: 10px; }
.ll4 .ll4-fb[hidden] { display: none; }
.ll4 .ll4-fb.ok { background: #ecfdf5; color: #065f46; }
.ll4 .ll4-fb.no { background: #fff7ed; color: #9a3412; }
.ll4 .ll4-fb .src { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; }
.ll4 .ll4-fb .btn-sm { margin-top: 6px; }
.ll4 .ll4-ex-done { margin-top: 12px; font-size: 15px; color: #065f46; font-weight: 600; }
.ll4 .ll4-ex-done[hidden] { display: none; }
.ll4 .ll4-fine { font-size: 12px; color: var(--ink-3); margin-top: 10px; line-height: 1.45; }
.ll4 .ll4-sentence { font-size: 18px; line-height: 1.9; margin: 10px 0; }
.ll4 .ll4-seg { display: inline; border: 1px solid #d2d2d7; background: #fff; border-radius: 8px; padding: 3px 8px; font: inherit; color: var(--ink); margin: 0 1px; }
.ll4 .ll4-seg[aria-pressed="true"] { border-color: var(--accent); background: var(--ll4-soft); color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent); }
.ll4 .ll4-seg.hit { border-color: var(--ok); background: #ecfdf5; color: #065f46; }
.ll4 .ll4-seg.miss { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.ll4 .ll4-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ll4 .ll4-why { list-style: none; padding: 0; margin-top: 8px; }
.ll4 .ll4-why li { font-size: 14px; padding: 4px 0; }
.ll4 .ll4-why b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* task builder */
.ll4 .ll4-form { display: grid; gap: 14px; margin-top: 12px; }
.ll4 .ll4-form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.ll4 .ll4-form input { width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid #d2d2d7; border-radius: 12px; background: #fff; color: var(--ink); }
.ll4 .ll4-form input:focus { border-color: var(--accent); }
.ll4 .ll4-form .cnt { font-size: 12px; color: var(--ink-3); text-align: right; margin-top: 2px; }
.ll4 .ll4-brief-out { margin-top: 14px; }
.ll4 .ll4-brief-out[hidden] { display: none; }
.ll4 .ll4-empty { color: #9a3412; font-size: 14px; margin-top: 8px; }
.ll4 .ll4-empty[hidden] { display: none; }

/* checklist + step footer */
.ll4 .ll4-check { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.ll4 .ll4-check label { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.5; cursor: pointer; }
.ll4 .ll4-check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.ll4 .ll4-donewhen { font-size: 14px; color: var(--ink-2); margin-top: 14px; }
.ll4 .ll4-donewhen b { color: var(--ink); }
.ll4 .ll4-stepfoot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 20px 0 28px; }
.ll4 .ll4-stepfoot .st { font-size: 13px; color: var(--ink-3); }
.ll4 .ll4-done-btn[aria-pressed="true"] { background: var(--ok); }

/* transfer table */
.ll4 table.ll4-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
.ll4 table.ll4-table th, .ll4 table.ll4-table td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--ll4-line); vertical-align: top; line-height: 1.45; }
.ll4 table.ll4-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.ll4 .ll4-table-wrap { overflow-x: auto; }

/* closing */
.ll4 .ll4-close { text-align: center; padding: 20px 0 0; }
.ll4 .ll4-close h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -0.02em; margin-bottom: 10px; }
.ll4 .ll4-close p { font-size: 16px; color: var(--ink-2); max-width: 56ch; margin: 0 auto; line-height: 1.55; }
.ll4 .ll4-close .ll4-btns { justify-content: center; }
.ll4 .ll4-refs { font-size: 13px; color: var(--ink-3); margin-top: 22px; line-height: 1.6; }
.ll4 .ll4-refs a { color: var(--ink-2); text-decoration: underline; }
.ll4 .ll4-storage { font-size: 13px; color: var(--ink-3); margin-top: 26px; text-align: center; line-height: 1.5; }
.ll4 .ll4-storage button { font-size: 13px; }
.ll4 .ll4-nostore { color: #9a3412; }
.ll4 .ll4-nostore[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .ll4 * { scroll-behavior: auto; transition: none !important; } }
@media (max-width: 640px) {
  .ll4 .ll4-card, .ll4 .ll4-ex { padding: 16px; }
  .ll4 .ll4-preview { padding: 16px; }
}

/* replaces inline styles (page CSP allows no inline style) */
.ll4 .ll4-cohort-lead{margin-top:28px}

/* member gate (2026-09-10): the lesson is fetched after sign-in, so the hero's
   preview/lanes/CTA now arrive with it and sit in .ll4-hero-more. */
.ll4 .ll4-hero-more { text-align: center; padding: 0 20px 28px; }
.ll4 .ll4-gate { background: var(--bg-alt); border: 1px solid var(--ll4-line); border-radius: var(--r-card); padding: 22px; margin: 26px auto 0; max-width: 620px; text-align: left; }
.ll4 .ll4-gate .k { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.ll4 .ll4-gate p { font-size: 15px; line-height: 1.55; color: var(--ink); }
.ll4 .ll4-gate .cta-row { margin-top: 16px; justify-content: flex-start; }
.ll4 .ll4-gate .meta { font-size: 13px; color: var(--ink-3); margin-top: 12px; }
.ll4 .ll4-status { margin: 22px auto 0; max-width: 620px; font-size: 15px; color: var(--ink-2); display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.ll4 .ll4-inside { padding: 8px 0 40px; }
.ll4 .ll4-inside h2 { font-size: 1.35rem; margin-bottom: 14px; }
.ll4 .ll4-inside-list { padding-left: 22px; display: grid; gap: 8px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.ll4 .ll4-inside-list b { color: var(--ink); }
.ll4 .ll4-inside .meta { font-size: 13px; color: var(--ink-3); margin-top: 14px; }
[hidden] { display: none !important; }

/* v4 (2026-09-10): provenance badges, glossary, click path, appendix */
.ll4 .real, .ll4 .doc, .ll4 .ill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: var(--r-pill); margin-right: 6px; vertical-align: middle; }
.ll4 .real { color: var(--accent); background: var(--ll4-soft); }
.ll4 .doc { color: #1d4ed8; background: #eff6ff; }
.ll4 .ill { color: #92400e; background: #fffbeb; }
.ll4 .ll4-card h3 .doc, .ll4 .ll4-card h3 .real { font-size: 10px; margin-left: 6px; }
.ll4 .ll4-glossary dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin-top: 10px; }
.ll4 .ll4-glossary dt { font-weight: 700; font-size: 15px; }
.ll4 .ll4-glossary dd { font-size: 15px; line-height: 1.55; color: var(--ink-2); margin: 0; }
@media (max-width: 520px) { .ll4 .ll4-glossary dl { grid-template-columns: 1fr; gap: 2px 0; } .ll4 .ll4-glossary dd { margin-bottom: 8px; } }
.ll4 .ll4-path { list-style: none; counter-reset: path; padding: 0; margin: 14px 0 6px; display: grid; gap: 8px; }
.ll4 .ll4-path li { counter-increment: path; display: grid; grid-template-columns: 26px max-content 1fr; gap: 10px; align-items: center; font-size: 14px; }
.ll4 .ll4-path li::before { content: counter(path); width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ll4 .ll4-path .chip { border: 1px solid #d2d2d7; border-radius: 10px; padding: 6px 12px; background: #fff; font-weight: 600; color: var(--ink); box-shadow: 0 1px 0 #d2d2d7; }
.ll4 .ll4-path .why { color: var(--ink-2); line-height: 1.4; }
@media (max-width: 520px) { .ll4 .ll4-path li { grid-template-columns: 26px 1fr; } .ll4 .ll4-path .why { grid-column: 2; font-size: 13px; } }
.ll4 .ll4-step > p code, .ll4 .ll4-card code, .ll4 .ll4-glossary code, .ll4 .ll4-ex code, .ll4 .ll4-preview code, .ll4 .ll4-note code, .ll4 details code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--bg-alt); padding: 1px 5px; border-radius: 6px; }
.ll4 .ll4-card .ll4-check { margin-top: 4px; }
.ll4 .ll4-check label b { color: var(--ink); }
.ll4 .ll4-check label > span { flex: 1 1 auto; min-width: 0; }
.ll4 .ll4-card .ll4-check + .ll4-note { margin-top: 14px; }
.ll4 details.ll4-appendix { background: var(--bg-alt); }
.ll4 details.ll4-appendix .ll4-figs { margin-top: 10px; }
.ll4 details.ll4-appendix .ll4-note a { color: var(--ink-2); text-decoration: underline; }
.ll4 .ll4-step .ll4-btns + .ll4-card { margin-top: 14px; }
