/* ============================================================================
   ADDED: /learn hub + guides (ported from live algodelta.com/learn)
   Uses the shared tokens from base.css, so light / dark themes just work.
   ============================================================================ */
.ln-wrap { max-width: var(--wrap-narrow); }
.ln-hero { padding-bottom: clamp(16px, 3vw, 28px); }
.ln-hero h1 { margin: 10px 0 12px; }
/* base.css makes .hero-standard .lead inline-flex, which splits text + links into columns */
.ln-hero .lead { display: block; }
.ln-hero .lead a { color: var(--head); text-decoration: underline; text-underline-offset: 3px; }
.ln-meta { color: var(--muted); font-size: .92rem; margin: 0 auto; max-width: 640px; }
.ln-body { padding-top: clamp(8px, 2vw, 20px); }

/* ---- prose ---- */
.ln-prose { color: var(--text); font-size: 1.04rem; line-height: 1.75; }
.ln-prose > h2 { margin: 2.1em 0 .6em; font-size: clamp(1.3rem, 2.4vw, 1.6rem); color: var(--head); scroll-margin-top: calc(var(--header-h) + 16px); }
.ln-prose > p, .ln-prose > ul, .ln-prose > ol { margin: 0 0 1.1em; }
.ln-prose ul, .ln-prose ol { padding-left: 1.3em; }
.ln-prose > ul { list-style: disc; }
.ln-prose > ol { list-style: decimal; }
.ln-toc ol { list-style: decimal; padding-left: 1.2em; }
.ln-prose li { margin: .35em 0; }
.ln-prose li::marker { color: var(--brand-b); }
.ln-prose a { color: var(--brand-b); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.ln-prose a:hover { color: var(--brand-a); }
.ln-prose strong { color: var(--head); }
.ln-prose code { font-size: .9em; background: var(--chip); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

/* "short answer" box (also what AI answer engines quote) */
.ln-answer { margin: 0 0 1.6em; padding: 18px 22px; border: 1px solid var(--line); border-left: 4px solid var(--brand-a); border-radius: var(--r); background: var(--surface); }
.ln-answer p { margin: 0; }
blockquote.ln-answer { border-left-color: var(--brand-b); font-style: italic; }

.ln-small { display: block; color: var(--muted); font-size: .86rem; line-height: 1.55; margin: 12px 0 0; font-style: normal; }

/* table of contents */
.ln-toc { margin: 0 0 1.6em; padding: 16px 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-light); }
.ln-toc p { margin: 0 0 6px; font-weight: 700; color: var(--head); font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }
.ln-toc ol { margin: 0; columns: 2; column-gap: 28px; }
.ln-toc a { text-decoration: none; }
@media (max-width: 640px) { .ln-toc ol { columns: 1; } }

/* tables */
.ln-table { margin: 0 0 1.4em; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); -webkit-overflow-scrolling: touch; }
.ln-table table { width: 100%; border-collapse: collapse; font-size: .94rem; line-height: 1.5; min-width: 520px; }
.ln-table th, .ln-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.ln-table th { background: var(--surface); color: var(--head); font-weight: 700; }
.ln-table tr:last-child td { border-bottom: 0; }
.ln-pill { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.ln-pill.ok { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.ln-pill.warn { color: var(--brand-b); background: color-mix(in srgb, var(--brand-b) 14%, transparent); }

/* ---- illustrations (pure HTML/CSS, ~0 KB, no images) ---- */
.ln-viz, .ln-bcloud { margin: 1.4em 0 1.8em; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.ln-viz-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; font-size: .82rem; color: var(--muted); }
.ln-live { color: var(--head); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.ln-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 25%, transparent); }

.ln-lanes { display: grid; gap: 10px; }
.ln-lane { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 12px; font-size: .86rem; color: var(--muted); }
.ln-lane-bar { height: 10px; border-radius: var(--r-pill); background: var(--chip); overflow: hidden; }
.ln-lane-bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--grad); transform-origin: left; animation: ln-fill 2.4s ease-out infinite; }
@keyframes ln-fill { 0% { transform: scaleX(0); } 45%, 100% { transform: scaleX(1); } }

.ln-cf { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; }
.ln-cf-master, .ln-cf-kids, .ln-bf-dst { padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-light); }
.ln-cf-label { margin: 0 0 8px; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ln-cf-order { margin: 0 0 8px; font-size: 1.1rem; font-weight: 700; color: var(--head); }
.ln-side { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 6px; font-size: .78rem; color: var(--on-brand); background: var(--green); vertical-align: middle; }
.ln-cf-meta { display: flex; gap: 8px; font-size: .82rem; }
.ln-cf-meta span { padding: 2px 8px; border-radius: 6px; background: var(--chip); border: 1px solid var(--line); }
.ln-cf-kid { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; padding: 6px 0; font-size: .88rem; border-bottom: 1px dashed var(--line); }
.ln-cf-kid:last-child { border-bottom: 0; }
.ln-cf-kid b { color: var(--brand-b); font-weight: 600; margin-left: 4px; }
.ln-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.ln-st { color: var(--green); font-size: .8rem; font-weight: 600; }
@media (max-width: 640px) { .ln-cf { grid-template-columns: 1fr; } }

.ln-bf { display: grid; grid-template-columns: 1fr auto 1.3fr; gap: 14px; align-items: center; }
.ln-bf-src { display: grid; gap: 6px; }
.ln-bf-src span { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--surface-light); font-size: .84rem; text-align: center; }
.ln-bf-core { display: grid; place-items: center; gap: 2px; padding: 16px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--chip); text-align: center; }
.ln-bf-core small { color: var(--muted); font-size: .76rem; }
.ln-code { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--r-xs); background: var(--chip); border: 1px solid var(--line); font: .82rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; }
.ln-code b { color: var(--brand-b); font-weight: 600; }
@media (max-width: 720px) { .ln-bf { grid-template-columns: 1fr; } .ln-bf-src { grid-template-columns: repeat(3, 1fr); } }

.ln-bcloud-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.ln-bcloud-grid .broker-chip { padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-light); }
.ln-bcloud-grid .broker-chip strong { font-size: .86rem; }
.ln-bcloud-grid .broker-ico, .ln-bcloud-grid .broker-ini { width: 26px; height: 26px; }

/* ---- risk notice ---- */
.ln-notice { display: flex; gap: 10px; margin: clamp(24px, 4vw, 40px) 0 clamp(40px, 6vw, 64px); padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r); color: var(--muted); font-size: .86rem; line-height: 1.6; }
.ln-notice .icon { flex: none; margin-top: 3px; color: var(--brand-b); }
.ln-notice a { color: var(--text); }

/* ---- /learn hub tiles ---- */
.ln-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ln-tile { display: flex; flex-direction: column; gap: 8px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .2s, transform .2s; }
.ln-tile:hover { border-color: var(--brand-b); transform: translateY(-2px); }
.ln-tile h2 { margin: 0; font-size: 1.15rem; color: var(--head); }
.ln-tile p { margin: 0; color: var(--muted); font-size: .94rem; line-height: 1.6; flex: 1; }
.ln-more { color: var(--brand-b); font-weight: 600; font-size: .9rem; }

@media (prefers-reduced-motion: reduce) { .ln-lane-bar i { animation: none; } .ln-tile { transition: none; } }
