/* Knowledge lens — growth chain (left), dimmed graph (centre), preview card (right). */
#graph-workspace { position: relative; }
#lens-canvas { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .2s ease; }
#lens-canvas.on { opacity: 1; }
body.lens-open #graph-selection-controls, body.lens-open .graph-help { display: none !important; }

/* ---------- left: growth chain ---------- */
#lens-chain { position: absolute; z-index: 5; top: 16px; left: 16px; bottom: 16px; width: 296px; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 18px 20px; border-radius: 18px; background: rgb(255 255 255 / .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgb(255 255 255 / .7) inset, 0 18px 48px rgb(15 28 46 / .1); color: var(--mn-text); scrollbar-width: thin; }
:root[data-graph-theme="dark"] #lens-chain { background: rgb(18 34 58 / .82); color: #E6F0F9; box-shadow: 0 18px 48px rgb(0 0 0 / .35); }
#lens-chain .lens-head { margin-bottom: 14px; }
.lens-eyebrow { color: var(--lens-muted, rgb(23 59 104 / .55)); font-size: 12px; letter-spacing: .04em; }
:root[data-graph-theme="dark"] #lens-chain { --lens-muted: rgb(221 236 247 / .6); }
#lens-chain h3 { margin: 4px 0 2px; font-size: 19px; line-height: 1.35; font-weight: 600; }
#lens-chain .lens-head p, .lens-chain-lead { margin: 0; color: var(--lens-muted, rgb(23 59 104 / .6)); font-size: 13px; line-height: 1.6; }
.lens-steps { position: relative; margin: 0; padding: 0 0 0 18px; list-style: none; }
.lens-steps::before { content: ''; position: absolute; left: 4px; top: 8px; bottom: 10px; width: 1.5px; background: linear-gradient(180deg, rgb(185 115 63 / .15), rgb(185 115 63 / .55)); border-radius: 2px; }
.lens-steps li { position: relative; padding: 2px 0 12px; }
.lens-steps li::before { content: ''; position: absolute; left: -18px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 1.5px solid #B9733F; }
.lens-steps li.is-current::before { background: #173B68; border-color: #173B68; box-shadow: 0 0 0 4px rgb(23 59 104 / .12); }
:root[data-graph-theme="dark"] .lens-steps li::before { background: #12223A; }
:root[data-graph-theme="dark"] .lens-steps li.is-current::before { background: #E6F0F9; border-color: #E6F0F9; }
.lens-step-label { display: block; color: var(--lens-muted, rgb(23 59 104 / .55)); font-size: 11.5px; line-height: 1.5; }
.lens-step-nodes { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.lens-step-nodes b { font-size: 15px; font-weight: 600; }
.lens-link { min-height: 28px; padding: 0; border: 0; background: none; color: inherit; font-size: 14px; line-height: 1.6; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--c) 45%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.lens-link:hover { text-decoration-color: var(--c); }
.lens-side { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgb(23 59 104 / .08); }
:root[data-graph-theme="dark"] .lens-side { border-top-color: rgb(156 200 234 / .14); }
.lens-side h4 { margin: 0 0 6px; font-size: 12.5px; font-weight: 500; color: var(--lens-muted, rgb(23 59 104 / .6)); }
.lens-side h4 small { margin-left: 4px; font-size: 11.5px; }
.lens-side > div { display: flex; flex-wrap: wrap; gap: 0 12px; }
.lens-side .lens-link::before { content: '✦'; margin-right: 4px; font-size: 10px; color: var(--c); text-decoration: none; display: inline-block; }
.lens-side[data-role="method"] .lens-link::before { content: '◆'; font-size: 8px; }
.lens-more { color: var(--lens-muted, rgb(23 59 104 / .5)); font-size: 12.5px; line-height: 28px; }
.lens-thought, .lens-tags button { min-height: 26px; padding: 1px 10px; border: 1px solid #E6D9C6; border-radius: 999px; background: #FBF7F1; color: #7A5A33; font-size: 12.5px; cursor: pointer; }
.lens-thought:hover, .lens-tags button:hover { border-color: #C9A97F; }
#lens-chain .lens-thought { margin: 2px 6px 2px 0; }
#lens-chain.is-in .lens-steps li, #lens-chain.is-in .lens-side { animation: lens-rise .42s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(260ms + var(--i) * 420ms); }
@keyframes lens-rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- right: preview card ---------- */
#lens-card { position: absolute; z-index: 8; top: 64px; right: 12px; width: min(380px, calc(100% - 24px)); max-height: calc(100% - 80px); overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 20px 18px; border-radius: 20px; background: #fff; color: var(--mn-text);
  box-shadow: 0 24px 64px rgb(15 28 46 / .16), 0 2px 6px rgb(15 28 46 / .06); scrollbar-width: thin; }
#lens-card.is-in { animation: lens-card-in .36s cubic-bezier(.2,.8,.2,1); }
@keyframes lens-card-in { from { opacity: 0; transform: translateX(18px); } }
.lens-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.lens-type { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: rgb(23 59 104 / .7); }
.lens-type::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.lens-loc { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgb(23 59 104 / .5); font-size: 12.5px; }
.lens-close { margin-left: auto; width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: rgb(23 59 104 / .55); font-size: 20px; }
.lens-close:hover { background: #F1F5F9; color: var(--mn-text); }
#lens-card h2 { margin: 2px 0 10px; font-size: 24px; line-height: 1.3; font-weight: 600; letter-spacing: .01em; }
.lens-def { position: relative; max-height: 190px; overflow: hidden; }
.lens-def.is-long::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 48px; background: linear-gradient(180deg, rgb(255 255 255 / 0), #fff); }
.lens-def p, .lens-def .reader-description { margin: 6px 0; font-family: "Songti SC","STSong","Noto Serif CJK SC","Source Han Serif SC",serif; font-size: 15.5px; line-height: 1.85; color: #1D3557; }
.lens-def .textbook-formula, .lens-def .r80-math.display { margin: 6px 0; padding: 10px 14px; border-radius: 12px; background: #F4F8FC; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.lens-def .textbook-copy-origin { display: none; }
.lens-thought-def { display: grid; gap: 4px; margin: 10px 0 0; font-size: 14px; line-height: 1.7; }
.lens-thought-def dt { color: rgb(23 59 104 / .55); font-size: 12px; }
.lens-thought-def dd { margin: 0 0 6px; }
.lens-facts { display: flex; gap: 0; margin: 14px 0 0; padding: 10px 0; border-top: 1px solid #EEF2F6; border-bottom: 1px solid #EEF2F6; }
.lens-facts > div { flex: 1; text-align: center; }
.lens-facts > div + div { border-left: 1px solid #EEF2F6; }
.lens-facts dd { margin: 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.lens-facts dt { color: rgb(23 59 104 / .55); font-size: 12px; }
.lens-tags { display: grid; gap: 6px; margin-top: 12px; font-size: 13px; color: rgb(23 59 104 / .75); }
.lens-tags p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.lens-tags p > span { color: rgb(23 59 104 / .5); font-size: 12px; margin-right: 4px; }
.lens-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.lens-actions button { min-height: 40px; padding: 6px 14px; border: 1px solid #D7E0EA; border-radius: 12px; background: #fff; color: var(--mn-text); font-size: 14px; }
.lens-actions button:hover { border-color: #9CB4CC; }
.lens-actions .lens-primary { border-color: #173B68; background: #173B68; color: #fff; }
.lens-actions .lens-primary:hover { background: #10305A; }
.lens-mini-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 0 0 10px; font-size: 12.5px; color: rgb(23 59 104 / .6); }
.lens-mini-chain span { animation: lens-rise .4s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(120ms + var(--i) * 260ms); }
.lens-mini-chain span::after { content: '→'; margin: 0 6px; color: #B9733F; }
.lens-mini-chain span.is-current { color: var(--mn-text); font-weight: 600; }
.lens-mini-chain span.is-current::after { display: none; }

/* ---------- thought lens bar ---------- */
#thought-lens-bar { position: absolute; z-index: 6; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-radius: 999px;
  background: rgb(255 255 255 / .8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 6px 20px rgb(15 28 46 / .08); white-space: nowrap; max-width: calc(100% - 32px); overflow-x: auto; scrollbar-width: none; }
#thought-lens-bar > span { margin-right: 4px; color: rgb(23 59 104 / .5); font-size: 12px; }
#thought-lens-bar button { min-height: 30px; padding: 2px 11px; border: 0; border-radius: 999px; background: transparent; color: rgb(23 59 104 / .82); font-size: 13px; }
#thought-lens-bar button:hover { background: #F4EEE5; }
#thought-lens-bar button[aria-pressed="true"] { background: #A0805A; color: #fff; }
:root[data-graph-theme="dark"] #thought-lens-bar { background: rgb(18 34 58 / .8); }
:root[data-graph-theme="dark"] #thought-lens-bar button { color: #E6F0F9; }
:root[data-graph-theme="dark"] #thought-lens-bar > span { color: rgb(221 236 247 / .6); }
body.lens-open #thought-lens-bar { left: calc(50% - 40px); }

@media (max-width: 900px) {
  #lens-card { top: auto; bottom: 8px; right: 8px; left: 8px; width: auto; max-height: 62%; border-radius: 18px; }
  #lens-card.is-in { animation-name: lens-sheet-in; }
  @keyframes lens-sheet-in { from { opacity: 0; transform: translateY(24px); } }
  #thought-lens-bar { top: 8px; left: 8px; right: 8px; transform: none; max-width: none; }
  body.lens-open #thought-lens-bar { left: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  #lens-chain.is-in .lens-steps li, #lens-chain.is-in .lens-side, .lens-mini-chain span { animation: none; opacity: 1; transform: none; }
  #lens-card.is-in { animation: none; }
}
body.lens-open #graph-type-legend { display: none !important; }

/* ---------- context while the lens is open ---------- */
@media (min-width: 901px) {
  body.lens-open .app:not(.path-mode):not(.hierarchy-mode) { grid-template-columns: minmax(0, 1fr); }
  body.lens-open .app:not(.path-mode):not(.hierarchy-mode) > aside.left { display: none; }
  body.lens-open .hierarchy-mode .hierarchy-viewport { padding-right: 396px; }
  body.lens-open .hierarchy-mode .hierarchy-footer .hierarchy-actions,
  body.lens-open .hierarchy-mode .hierarchy-footer .hierarchy-selection { visibility: hidden; }
}
#thought-lens-bar { top: auto; bottom: 14px; }
body.lens-open #thought-lens-bar { left: 50%; }
@media (max-width: 900px) { #thought-lens-bar { top: 8px; bottom: auto; } body.lens-open #thought-lens-bar { display: none; } }

/* Layered view: the five columns share one top line. Thoughts are a slim filter row above them (they cut across
   chapters, so they are not a column and do not push the knowledge and method columns down). */
.hierarchy-board { grid-template-rows: minmax(0, 1fr) !important; }
.hierarchy-board > .hierarchy-column { grid-row: 1 !important; }
.hierarchy-thought-band { display: flex; flex: none; align-items: center; gap: 14px; min-height: 48px; padding: 8px 30px; border-bottom: 1px solid #E5EAF0; background: #FBFCFD; overflow-x: auto; scrollbar-width: none; }
.hierarchy-thought-band[hidden] { display: none; }
.thought-band-label { flex: none; font-size: 12.5px; font-weight: 600; color: #7A5A33; letter-spacing: .02em; }
.thought-band-choices { display: flex; flex: none; gap: 6px; }
.thought-band-choices button { display: inline-flex; align-items: baseline; gap: 5px; min-height: 30px; padding: 3px 12px; border: 1px solid #EADFCF; border-radius: 999px; background: #FFFDF9; color: #8A6A43; font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.thought-band-choices button b { font-weight: 500; }
.thought-band-choices button small { font-size: 11px; color: #B39C7D; }
.thought-band-choices button:not(.has-links) { color: #B7A890; border-style: dashed; }
.thought-band-choices button:hover { border-color: #CDB28C; background: #FBF4EA; }
.thought-band-choices [aria-pressed="true"] { background: #A0805A; border-color: #A0805A; border-style: solid; color: #fff; }
.thought-band-choices [aria-pressed="true"] small { color: #F5E8D6; }
.thought-band-note { flex: 1; min-width: 180px; margin: 0; font-size: 11.5px; color: #8E8170; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thought-band-note button { margin-left: 6px; padding: 0; min-height: 0; border: 0; background: none; color: #7A5A33; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
/* fewer things to read: the method index lives in 更多; feet keep only the knowledge count */
.hierarchy-nav-index { display: none !important; }
.hierarchy-column-foot { visibility: hidden; }
.hierarchy-column[data-layer="3"] .hierarchy-column-foot { visibility: visible; }
@media (min-width: 901px) {
  /* With the preview open, the five columns narrow to make room instead of sliding under it. */
  body.lens-open .hierarchy-mode .hierarchy-viewport { padding-right: 396px; }
  body.lens-open .hierarchy-mode .hierarchy-thought-band { padding-right: 410px; }
  body.lens-open .hierarchy-mode .hierarchy-board { min-width: 0; padding: 0 20px; column-gap: 26px; grid-template-columns: minmax(118px,.72fr) minmax(124px,.8fr) minmax(150px,1fr) minmax(170px,1.2fr) minmax(165px,1.12fr); }
  body.lens-open .hierarchy-mode .hierarchy-column-head p { white-space: normal; }
}
@media (max-width: 900px) { .hierarchy-thought-band { padding: 8px 14px; gap: 10px; } .thought-band-note { display: none; } }

/* ---------- view switch & no bottom mode bar ---------- */
#graph-mode-bar { display: none !important; }
.view-switch { display: inline-flex; padding: 3px; margin-right: 6px; border-radius: 12px; background: #EEF3F8; }
.view-switch button { min-height: 32px; padding: 3px 14px; border: 0; border-radius: 9px; background: transparent; color: rgb(23 59 104 / .65); font-size: 13.5px; }
.view-switch button[aria-pressed="true"] { background: #fff; color: var(--mn-text); box-shadow: 0 1px 3px rgb(15 28 46 / .12); }
#graph-display-panel #graph-spacing-control { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; font-size: 13px; }

/* Reading with the chain still visible on the left */
body.lens-reading #reader-backdrop { background: transparent !important; }
body.lens-reading #thought-lens-bar, body.lens-reading .view-switch { visibility: hidden; }

/* ---------- diagnosis panel ---------- */
.lens-eyebrow { display: inline-flex; align-items: center; gap: 6px; }
.lens-diag { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgb(23 59 104 / .08); }
.lens-diag:first-of-type { border-top: 0; padding-top: 4px; }
:root[data-graph-theme="dark"] .lens-diag { border-top-color: rgb(156 200 234 / .14); }
.lens-diag h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font-size: 13.5px; font-weight: 600; }
.lens-diag h4 small { margin-left: auto; font-weight: 400; font-size: 11.5px; color: var(--lens-muted, rgb(23 59 104 / .5)); }
#lens-chain.is-in .lens-diag { animation: lens-rise .42s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(260ms + var(--i) * 300ms); }
.lens-rows { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.lens-rows li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.lens-row-note { display: inline-flex; flex-wrap: wrap; gap: 2px 6px; }
.lens-row-note button { padding: 0; min-height: 0; border: 0; background: none; color: #8A6A43; font-size: 12px; cursor: pointer; }
.lens-row-note button::before { content: '▲'; margin-right: 2px; font-size: 7px; vertical-align: 2px; color: var(--k-thought); }
.lens-row-note button:hover { text-decoration: underline; }
:root[data-graph-theme="dark"] .lens-row-note button { color: #E2C49C; }
.lens-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lens-chips.is-next { gap: 0 12px; }
.lens-plain { margin: 0; font-size: 13.5px; line-height: 1.65; color: inherit; }
.lens-plain.is-muted { color: var(--lens-muted, rgb(23 59 104 / .5)); }
.lens-glint { color: #3E8C80; font-size: 11px; }
.lens-diag .lens-steps { margin-top: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#graph-focus-toggle { padding: 0 10px; }
.display-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 10px; font-size: 13px; }
.display-row #graph-theme-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 2px 12px; border: 1px solid #D7E0EA; border-radius: 10px; background: #fff; }
.display-row #graph-theme-toggle svg { width: 16px; height: 16px; }
/* Full reading page: the same diagnosis chain as a left rail */
#lens-chain.is-rail { position: fixed; top: calc(var(--mn-header-height, 80px) + 128px); left: 16px; bottom: 16px; width: 270px; z-index: 5; background: #fff; box-shadow: 0 10px 32px rgb(15 28 46 / .08); }
body.lens-rail #learning-path { padding-left: 300px; }
body.lens-rail .lens-open #lens-card { display: none; }
#graph-key, .graph-only-help, #relation-legend { display: none !important; }
.lens-route { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 4px; }
.lens-route i { font-style: normal; color: var(--k-book); opacity: .7; }
.lens-route small { flex-basis: 100%; color: var(--lens-muted, rgb(23 59 104 / .55)); font-size: 12px; }
/* Thought rows: "直接体现" or "经 ◆方法" — the method that carries the link is shown, never implied. */
.lens-rows.is-thoughts .lens-row-note.is-how { align-items: baseline; color: rgb(23 59 104 / .5); font-size: 12px; }
.lens-rows.is-thoughts .lens-row-note.is-how button { color: #5E5390; }
.lens-rows.is-thoughts .lens-row-note.is-how button::before { content: '◆'; color: var(--k-method); }
:root[data-graph-theme="dark"] .lens-rows.is-thoughts .lens-row-note.is-how button { color: #B7ACDB; }

/* Home: the brand returns to the whole map from anywhere. */
a.brand { color: inherit; text-decoration: none; border-radius: 12px; }
a.brand:hover .brand-icon { filter: brightness(1.12); }
a.brand:focus-visible { outline: 2px solid rgb(79 143 215 / .6); outline-offset: 4px; }

/* The bottom row stays put in every graph state: zoom sits above the lens veil; while reading it moves beside the drawer. */
#graph-workspace .zoom { z-index: 6; }
body.lens-reading #graph-workspace .zoom { right: calc(var(--lens-reader-w, 0px) + 18px); }

/* The chain panel is as tall as its content, not a tall empty column. */
#lens-chain { bottom: auto; max-height: calc(100% - 32px); }
#lens-chain.is-rail { bottom: 16px; max-height: none; }

/* Reading beside the graph (wide screens): no modal veil, the left side stays clickable. */
body.reader-beside #reader-overlay { pointer-events: none; }
body.reader-beside #reader-dialog { pointer-events: auto; }
body.reader-beside #reader-backdrop { display: none; }

/* Layered view: no bottom bar. Its hint duplicated the subtitle, and its actions duplicate the preview card,
   so it showed as an empty strip once something was selected. The columns now use the full height. */
.hierarchy-mode .hierarchy-footer, #hierarchy-view .hierarchy-footer { display: none !important; }

/* Thought thread: the same idea, in learning order, with one line on how it is used at each point. */
#thought-lens-bar { display: none !important; }
.lens-back { display: block; margin: 0 0 10px; padding: 0; min-height: 0; border: 0; background: none; color: var(--k-book); font-size: 12.5px; cursor: pointer; text-align: left; }
.lens-back:hover { text-decoration: underline; }
.lens-thread { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.lens-thread li { display: grid; gap: 1px; padding-left: 12px; border-left: 2px solid rgb(160 128 90 / .28); }
.lens-thread li.is-here { border-left-color: var(--k-thought); }
.lens-thread li.is-here .lens-link { font-weight: 600; }
.lens-thread .lens-thread-book { padding: 6px 0 0; border: 0; font-size: 11.5px; color: var(--lens-muted, rgb(23 59 104 / .5)); }
.lens-thread .lens-thread-book:first-child { padding-top: 0; }
.lens-thread-why { font-size: 12px; line-height: 1.55; color: var(--lens-muted, rgb(23 59 104 / .62)); }
.lens-thread-via { display: inline-flex; flex-wrap: wrap; gap: 0 8px; }
.lens-thread-via button { padding: 0; min-height: 0; border: 0; background: none; color: #5E5390; font-size: 11.5px; cursor: pointer; }
.lens-thread-via button::before { content: '◆';margin-right: 2px; font-size: 10px; color: var(--k-method); }
:root[data-graph-theme="dark"] .lens-thread-via button { color: #B7ACDB; }
.lens-here { justify-self: start; margin-left: 0; padding: 0 6px; border-radius: 999px; background: rgb(160 128 90 / .14); color: #8A6A43; font-size: 11px; vertical-align: 1px; }
:root[data-graph-theme="dark"] .lens-here { background: rgb(226 196 156 / .16); color: #E2C49C; }
.lens-route .lens-role { flex-basis: 100%; font-size: 11.5px; font-weight: 600; color: var(--k-book); }
.lens-route + .lens-route { margin-top: 8px; }

/* Phones: the preview opens as a short peek (type, name, actions) so the map or the chosen card stays visible; 展开 shows the rest. */
.lens-peek-toggle { display: none; }
@media (max-width: 900px) {
  .lens-peek-toggle { display: inline-flex; align-items: center; margin-left: auto; height: 30px; min-height: 30px; padding: 0 12px; border: 1px solid rgb(23 59 104 / .14); border-radius: 999px; background: transparent; color: var(--k-book); font-size: 12.5px; }
  .lens-peek-toggle + .lens-close { margin-left: 4px; }
  #lens-card.is-peek :is(.lens-def, .lens-facts, .lens-tags, .lens-mini-chain, .lens-thought-def) { display: none; }
  #lens-card.is-peek h2 { margin-bottom: 12px; font-size: 21px; }
  body.lens-open .hierarchy-list { padding-bottom: 240px; }
}
.thought-band-choices [aria-pressed="true"]:hover { background: #8E7049; border-color: #8E7049; color: #fff; }

/* Thought provenance, kept quiet: evidenced thoughts are chips; thoughts reached only through a method sit on one muted line. */
.lens-via-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 8px 0 0; font-size: 12px; color: var(--lens-muted, rgb(23 59 104 / .5)); }
.lens-via-line > span { font-size: 11.5px; margin-right: 2px; }
.lens-via-line button { padding: 0; min-height: 0; border: 0; background: none; color: #8A6A43; font-size: 12px; cursor: pointer; opacity: .85; }
.lens-via-line button::before { content: '△'; margin-right: 2px; font-size: 8px; vertical-align: 1px; color: var(--k-thought); }
.lens-via-line button:hover { text-decoration: underline; opacity: 1; }
.lens-indirect { margin-top: 10px; }
.lens-indirect > summary { cursor: pointer; font-size: 12px; color: var(--lens-muted, rgb(23 59 104 / .55)); list-style: none; }
.lens-indirect > summary::-webkit-details-marker { display: none; }
.lens-indirect > summary::before { content: '○'; margin-right: 6px; font-size: 10px; color: var(--k-thought); }
.lens-indirect[open] > summary { margin-bottom: 8px; }
.lens-indirect .lens-chips { gap: 4px 12px; }
.lens-indirect .lens-link { opacity: .8; }
:root[data-graph-theme="dark"] .lens-via-line button { color: #E2C49C; }
.lens-thread li.lens-thread-group { padding-left: 0; border-left: 0; }
.lens-thread-group .lens-chips { gap: 3px 14px; }
.lens-thread-book small { margin-left: 6px; font-size: 11px; opacity: .7; }
.lens-thread-group .lens-link.is-here { font-weight: 600; text-decoration-color: var(--k-thought); }
.lens-thread-group .lens-thread-why { margin: 6px 0 0; padding-left: 10px; border-left: 2px solid var(--k-thought); }
.lens-thread-group .lens-thread-why b { margin-right: 6px; font-weight: 600; color: var(--k-thought); }
.lens-thread li.lens-thread-book { display: flex; align-items: baseline; }

/* Mid-width windows (901–1179px): chain stays left, preview docks bottom as a peek beside it. */
@media (min-width: 901px) and (max-width: 1179px) {
  #lens-card { top: auto; bottom: 16px; left: 328px; right: 16px; width: auto; max-height: 58%; }
  #lens-card.is-in { animation-name: lens-sheet-in; }
  .lens-peek-toggle { display: inline-flex; align-items: center; margin-left: auto; height: 30px; min-height: 30px; padding: 0 12px; border: 1px solid rgb(23 59 104 / .14); border-radius: 999px; background: transparent; color: var(--k-book); font-size: 12.5px; }
  .lens-peek-toggle + .lens-close { margin-left: 4px; }
  #lens-card.is-peek :is(.lens-def, .lens-facts, .lens-tags, .lens-mini-chain, .lens-thought-def) { display: none; }
  #lens-card.is-peek h2 { margin-bottom: 12px; font-size: 21px; }
  body.lens-open .hierarchy-mode #lens-card { left: 16px; }
  body.lens-open .hierarchy-mode .hierarchy-viewport { padding-right: 0; }
  body.lens-open .hierarchy-mode .hierarchy-list { padding-bottom: 200px; }
}
@keyframes lens-sheet-in { from { opacity: 0; transform: translateY(24px); } }
