/* v1.19.1 — Learn index (bottom of the Learn page): four layouts. */
.lx { --ink: #14231f; --mut: #5c6b60; --line: #e1e5d8; margin-top: 18px; color: var(--ink); overflow-x: clip; }
.lx button { font: inherit; }
.lx h3, .lx h4 { margin: 0; }
.lx ol, .lx ul { margin: 0; padding: 0; list-style: none; }

/* toolbar */
.lx-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.lx-find { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--mut); }
.lx-find:focus-within { border-color: #6e853b; box-shadow: 0 0 0 3px #dfefa8; }
.lx-find input { flex: 1; min-width: 0; border: none; background: none; outline: none; font: inherit; font-size: 14px; color: var(--ink); }
.lx-btn { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.lx-btn:hover { border-color: #6e853b; }
.lx-btn[data-lx-rand] { background: #173c35; border-color: #173c35; color: #dfefa8; }
.lx-btn[data-lx-rand]:hover { background: #0f2b26; }

/* topic nav (tabs by default) */
.lx-nav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; margin-bottom: 14px; }
.lx-nav::-webkit-scrollbar { display: none; }
.lx-nav button { flex: none; display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px 7px 7px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-align: left; }
.lx-nav i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); }
.lx-nav span { display: flex; align-items: baseline; gap: 6px; }
.lx-nav b { font-size: 14px; }
.lx-nav small { font-size: 11.5px; font-weight: 800; color: var(--mut); font-variant-numeric: tabular-nums; }
.lx-nav button[aria-selected="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.lx-nav button[aria-selected="true"] i { background: rgba(255, 255, 255, 0.18); color: #fff; }
.lx-nav button[aria-selected="true"] small { color: rgba(255, 255, 255, 0.8); }

/* groups */
.lx-g { --c: #173c35; position: relative; }
.lx-gh h3 { display: flex; align-items: baseline; gap: 8px; font: 600 28px/1.05 Cormorant, Georgia, serif !important; letter-spacing: -0.01em; margin: 0 !important; }
.lx-gh h3 small { font: 800 12px "DM Sans", sans-serif; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); padding: 2px 8px; border-radius: 999px; }
.lx-gh p { margin: 4px 0 0; font-size: 13.5px; color: var(--mut); }
.lx-gb { margin-top: 14px; }
.lx-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lx-it { min-width: 0; color: var(--ink); border-radius: 14px; background: #fff; border: 1px solid var(--line); transition: border-color 0.2s, box-shadow 0.3s; }
.lx-it:hover { border-color: color-mix(in srgb, var(--c) 45%, #fff); }
.lx-it.lit { box-shadow: 0 0 0 3px #dfefa8, 0 0 0 5px var(--c); }
.lx-a { display: grid; gap: 4px; padding: 12px 14px; color: inherit !important; text-decoration: none; }
.lx-a b { font-size: 14.5px; line-height: 1.3; }
.lx-a:hover b { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--c) 60%, transparent); }
.lx-a small { font-size: 12.5px; line-height: 1.4; color: var(--mut); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lx-tag { justify-self: start; font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: #eef2e2; color: #4f6a2a; }
.lx-tag-psilocybin, .lx-tag-laws { background: #efeaf7; color: #5b4a8a; }
.lx-tag-science { background: #e6f0f4; color: #2f6f8f; }
.lx-tag-cooking { background: #fbeee6; color: #b4512f; }
.lx-tag-species { background: #f6f0dc; color: #8a6a12; }
.lx-more { border-top: 1px dashed var(--line); padding: 0 14px; }
.lx-more summary { cursor: pointer; padding: 8px 0; font-size: 12px; font-weight: 700; color: var(--c); list-style: none; }
.lx-more summary::-webkit-details-marker { display: none; }
.lx-more summary::before { content: "+ "; }
.lx-more[open] summary::before { content: "− "; }
.lx-more p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.lx-more ul { display: grid; gap: 4px; margin-bottom: 8px; font-size: 12.5px; font-weight: 700; }
.lx-more ul li::before { content: "✓ "; color: var(--c); }
.lx-src { list-style: decimal !important; padding-left: 18px !important; margin-bottom: 10px !important; font-size: 12px; display: grid; gap: 3px; }
.lx-src a { color: #173c35; }

/* lessons: one column per track */
.lx-g[data-g="lessons"] .lx-gb { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lx-sub { padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--c) 6%, #fffdf4); border: 1px solid color-mix(in srgb, var(--c) 18%, #fff); }
.lx-sub h4 { font-size: 11.5px !important; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c); margin: 0 0 10px !important; display: flex; align-items: center; gap: 6px; }
.lx-sub h4::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.lx-sub .lx-list { grid-template-columns: 1fr; gap: 6px; counter-reset: ls; }
.lx-sub .lx-it { --c: inherit; counter-increment: ls; }
.lx-sub .lx-a { padding: 10px 12px 8px; }
.lx-sub .lx-a b { font-size: 13.5px; }
.lx-sub .lx-a small { -webkit-line-clamp: 2; font-size: 12px; }

/* quick answers */
.lx-qa summary { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 14px; cursor: pointer; font-size: 14px; font-weight: 600; line-height: 1.35; list-style: none; }
.lx-qa summary::-webkit-details-marker { display: none; }
.lx-qa em { flex: none; font-style: normal; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #f0f1ea; color: transparent; text-shadow: 0 0 7px rgba(20, 35, 30, 0.6); transition: color 0.2s, text-shadow 0.2s; }
.lx-qa[open] em { text-shadow: none; }
.lx-qa[open] em.is-fact { background: #e9f4d7; color: #4f7a2e; }
.lx-qa[open] em.is-myth { background: #fbe9e1; color: #b4512f; }
.lx-qa p { margin: 0; padding: 0 14px 12px; font-size: 13px; line-height: 1.5; color: #3b4a43; }
.lx-g[data-g="qa"] .lx-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }

/* glossary */
.lx-terms { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.lx-terms .lx-it { display: grid; gap: 3px; padding: 11px 13px; }
.lx-terms dfn { font-style: normal; font-weight: 800; font-size: 14px; color: var(--c); }
.lx-terms span { font-size: 12.5px; line-height: 1.4; color: #3b4a43; }

.lx-all { display: none; margin-top: 12px; align-items: center; gap: 4px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--c); font-weight: 800; font-size: 13px; cursor: pointer; }
.lx-empty { padding: 26px; text-align: center; border-radius: 16px; background: #fff; border: 1px dashed var(--line); color: var(--mut); }
.lx-disc { margin: 14px 0 0 !important; font-size: 12px; color: var(--mut); }

/* ---------- Tabs (default) ---------- */
.lx[data-layout="tabs"]:not(.is-filtering) .lx-g:not(.on) { display: none; }
.lx[data-layout="tabs"] .lx-g { padding: 20px; border-radius: 20px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 7%, #fffdf4), #fffdf4 60%); border: 1px solid color-mix(in srgb, var(--c) 18%, #fff); }
.lx[data-layout="tabs"].is-filtering .lx-g + .lx-g, .lx[data-layout="shelf"].is-filtering .lx-g + .lx-g { margin-top: 12px; }
.lx[data-layout="tabs"]:not(.is-filtering) .lx-g:not(.full) > .lx-gb > .lx-list > .lx-it:nth-child(n + 10),
.lx[data-layout="shelf"]:not(.is-filtering) .lx-g:not(.full) > .lx-gb > .lx-list > .lx-it:nth-child(n + 10) { display: none; }
.lx[data-layout="tabs"]:not(.is-filtering) .lx-g.cap9 .lx-all, .lx[data-layout="shelf"]:not(.is-filtering) .lx-g.cap9 .lx-all { display: inline-flex; }

/* ---------- Drawers ---------- */
.lx[data-layout="drawers"] .lx-nav { display: none; }
.lx[data-layout="drawers"] .lx-groups { display: grid; gap: 8px; }
.lx[data-layout="drawers"] .lx-g { border-radius: 18px; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--c); overflow: hidden; }
.lx[data-layout="drawers"] .lx-gh { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 14px 52px 14px 16px; cursor: pointer; }
.lx-gi { display: none; }
.lx[data-layout="drawers"] .lx-gi { grid-row: 1 / 3; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); }
.lx[data-layout="drawers"] .lx-gh::after { content: ""; position: absolute; right: 22px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--c); border-bottom: 2px solid var(--c); transform: translateY(-70%) rotate(45deg); transition: transform 0.25s; }
.lx[data-layout="drawers"] .lx-g.on .lx-gh::after { transform: translateY(-30%) rotate(-135deg); }
.lx[data-layout="drawers"] .lx-gh h3 { font-size: 24px !important; }
.lx[data-layout="drawers"] .lx-gh p { grid-column: 2; margin: 2px 0 0; }
.lx[data-layout="drawers"] .lx-gh:hover { background: color-mix(in srgb, var(--c) 4%, #fff); }
.lx[data-layout="drawers"]:not(.is-filtering) .lx-g:not(.on) .lx-gb { display: none; }
.lx[data-layout="drawers"] .lx-gb { margin: 0; padding: 4px 16px 18px; }

/* ---------- Bookshelf ---------- */
.lx[data-layout="shelf"] .lx-nav { position: relative; align-items: flex-end; gap: 6px; padding: 18px 22px 0; margin-bottom: 0; border-radius: 18px 18px 0 0; background: linear-gradient(180deg, #f3eedd, #ebe3c9); min-height: 210px; }
.lx[data-layout="shelf"] .lx-nav button { flex-direction: column; justify-content: space-between; align-items: center; gap: 10px; width: 62px; height: calc(150px + var(--i) * 9px); padding: 12px 6px; border-radius: 6px 6px 2px 2px; border: none; background: linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.22)), var(--c); color: #fff; box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.18), inset 0 -10px 0 rgba(0, 0, 0, 0.12); transition: transform 0.25s, box-shadow 0.25s; transform-origin: bottom center; }
.lx[data-layout="shelf"] .lx-nav button:nth-child(2n) { width: 54px; }
.lx[data-layout="shelf"] .lx-nav button:nth-child(3) { transform: rotate(-4deg); margin: 0 6px; }
.lx[data-layout="shelf"] .lx-nav i { background: rgba(255, 255, 255, 0.18); color: #fff; width: 32px; height: 32px; }
.lx[data-layout="shelf"] .lx-nav span { writing-mode: vertical-rl; transform: rotate(180deg); flex-direction: row; align-items: center; gap: 8px; }
.lx[data-layout="shelf"] .lx-nav b { font: 600 18px Cormorant, Georgia, serif; letter-spacing: 0.02em; white-space: nowrap; }
.lx[data-layout="shelf"] .lx-nav small { color: rgba(255, 255, 255, 0.85); }
.lx[data-layout="shelf"] .lx-nav button:hover { transform: translateY(-8px); }
.lx[data-layout="shelf"] .lx-nav button[aria-selected="true"] { transform: translateY(-22px); box-shadow: 0 14px 22px -10px rgba(0, 0, 0, 0.45), inset 0 6px 0 rgba(255, 255, 255, 0.25); }
.lx[data-layout="shelf"] .lx-nav button[aria-selected="true"] small { color: #dfefa8; }
.lx[data-layout="shelf"] .lx-groups { position: relative; border-top: 14px solid #8a6a3a; box-shadow: inset 0 4px 0 #a9844c; border-radius: 0 0 18px 18px; background: #fffdf4; padding: 22px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lx[data-layout="shelf"]:not(.is-filtering) .lx-g:not(.on) { display: none; }
.lx[data-layout="shelf"] .lx-g.on { animation: lx-pull 0.35s ease; }
@keyframes lx-pull { from { opacity: 0; transform: translateY(-8px); } }
.lx[data-layout="shelf"] .lx-gh { border-bottom: 2px solid color-mix(in srgb, var(--c) 25%, #fff); padding-bottom: 10px; }

/* ---------- Bento ---------- */
.lx[data-layout="bento"] .lx-nav { display: none; }
.lx[data-layout="bento"] .lx-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; grid-auto-flow: dense; }
.lx[data-layout="bento"] .lx-g { grid-column: span 2; padding: 18px; border-radius: 20px; background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--c); }
.lx[data-layout="bento"] .lx-g[data-g="lessons"] { grid-column: 1 / -1; background: linear-gradient(135deg, #173c35, #24554b); color: #fff; border: none; }
.lx[data-layout="bento"] .lx-g[data-g="lessons"] .lx-gh p { color: rgba(255, 255, 255, 0.78); }
.lx[data-layout="bento"] .lx-g[data-g="lessons"] .lx-gh h3 small { background: #dfefa8; color: #173c35; }
.lx[data-layout="bento"] .lx-g[data-g="lessons"] .lx-sub { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); }
.lx[data-layout="bento"] .lx-g[data-g="lessons"] .lx-sub h4 { color: #dfefa8; }
.lx[data-layout="bento"] .lx-g[data-g="lessons"] .lx-sub h4::before { background: var(--c); box-shadow: 0 0 0 2px #dfefa8; }
.lx[data-layout="bento"] .lx-g[data-g="lessons"] .lx-all { background: #dfefa8; border-color: #dfefa8; color: #173c35; }
.lx[data-layout="bento"] .lx-g.full { grid-column: 1 / -1; }
.lx[data-layout="bento"] .lx-g:not([data-g="lessons"]):not(.full) .lx-list { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.lx[data-layout="bento"] .lx-g:not(.full) .lx-a small, .lx[data-layout="bento"] .lx-g:not(.full) .lx-terms span { -webkit-line-clamp: 1; }
.lx[data-layout="bento"]:not(.is-filtering) .lx-g:not(.full) > .lx-gb > .lx-list > .lx-it:nth-child(n + 5),
.lx[data-layout="bento"]:not(.is-filtering) .lx-g:not(.full) .lx-sub .lx-it:nth-child(n + 3) { display: none; }
.lx[data-layout="bento"]:not(.is-filtering) .lx-g.cap4 .lx-all { display: inline-flex; }
.lx[data-layout="bento"] .lx-g:not(.full) .lx-more { display: none; }

/* ---------- Picker (dialog styles shared with the Learning Lab) ---------- */
.lx-opts { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .lx-g[data-g="lessons"] .lx-gb { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lx-terms { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 800px) {
  .lx-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lx-terms { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .lx-g[data-g="qa"] .lx-list { grid-template-columns: 1fr; }
  .lx[data-layout="bento"] .lx-groups { grid-template-columns: 1fr; }
  .lx[data-layout="bento"] .lx-g { grid-column: auto !important; }
}
@media (max-width: 560px) {
  .lx-list, .lx-terms, .lx-g[data-g="lessons"] .lx-gb { grid-template-columns: 1fr !important; }
  .lx[data-layout="bento"] .lx-g:not([data-g="lessons"]):not(.full) .lx-list, .lx[data-layout="bento"] .lx-g .lx-list { grid-template-columns: 1fr !important; }
  .lx[data-layout="bento"]:not(.is-filtering) .lx-g:not(.full) > .lx-gb > .lx-list > .lx-it:nth-child(n + 4),
  .lx[data-layout="bento"]:not(.is-filtering) .lx-g:not(.full) .lx-sub .lx-it:nth-child(n + 2) { display: none; }
  .lx[data-layout="bento"] .lx-g[data-g="lessons"]:not(.full) .lx-gb { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .lx[data-layout="bento"] .lx-g[data-g="lessons"]:not(.full) .lx-a small { display: none; }
  .lx[data-layout="bento"] .lx-g[data-g="lessons"]:not(.full) .lx-sub { padding: 9px; }
  .lx[data-layout="tabs"]:not(.is-filtering) .lx-g:not(.full) > .lx-gb > .lx-list > .lx-it:nth-child(n + 6),
  .lx[data-layout="shelf"]:not(.is-filtering) .lx-g:not(.full) > .lx-gb > .lx-list > .lx-it:nth-child(n + 6) { display: none; }
  .lx[data-layout="tabs"]:not(.is-filtering) .lx-g.cap5 .lx-all, .lx[data-layout="shelf"]:not(.is-filtering) .lx-g.cap5 .lx-all { display: inline-flex; }
  .lx[data-layout="shelf"] .lx-nav b { font-size: 15px; }
  .lx-btn { flex: 1; justify-content: center; }
  .lx[data-layout="tabs"] .lx-g, .lx[data-layout="shelf"] .lx-groups { padding: 14px; }
  .lx[data-layout="drawers"] .lx-gh { grid-template-columns: minmax(0, 1fr); padding-left: 14px; }
  .lx[data-layout="drawers"] .lx-gi { display: none; }
  .lx[data-layout="drawers"] .lx-gh p { grid-column: 1; }
  .lx[data-layout="shelf"] .lx-nav { padding: 16px 12px 0; min-height: 200px; }
  .lx[data-layout="shelf"] .lx-nav button { width: 52px; height: calc(158px + var(--i) * 5px); }
  .lx[data-layout="shelf"] .lx-nav button:nth-child(2n) { width: 46px; }
  .lx-opts { grid-template-columns: 1fr 1fr !important; }
}
@media (prefers-reduced-motion: reduce) {
  .lx[data-layout="shelf"] .lx-g.on { animation: none; }
}

/* v1.20.0 — glossary links. */
.lx-terms .lx-gloss-cta { grid-column: 1 / -1; padding: 0; background: #173c35; border-radius: 14px; }
.lx-terms .lx-gloss-cta .lx-a { display: grid; gap: 3px; padding: 14px 16px; color: #fff; text-decoration: none; }
.lx-terms .lx-gloss-cta b { color: #fff; } .lx-terms .lx-gloss-cta small { color: #dfefa8; }
.lx-terms dfn a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: currentColor; }
