/* Knowledge is a reading space inside the existing workbench navigation. */
.knowledge-hero { padding: 26px 28px; background: #fff; border: 1px solid var(--line); box-shadow: none; }
.knowledge-hero .eyebrow { color: var(--purple); }
.knowledge-hero h2 { font-size: clamp(24px, 2.1vw, 32px); letter-spacing: -.03em; }
.knowledge-hero p { font-size: 15px; }
.release-badge { display: flex; flex-direction: column; gap: 5px; padding-left: 24px; border-left: 1px solid var(--line); min-width: 170px; }
.release-badge span, .release-badge small { color: var(--muted); font-size: 12px; }
.release-badge strong { font-size: 16px; font-weight: 600; }
.knowledge-categories { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin: 22px 0; }
.knowledge-categories > button { display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 8px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .15s, background .15s; }
.knowledge-categories > button:hover { border-color: #bcb0ef; }
.knowledge-categories > button.active { border-color: var(--purple); background: #f5f2ff; box-shadow: inset 0 -3px var(--purple); }
.knowledge-tab-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.knowledge-tab-top small { font-size: 12px; letter-spacing: .08em; }
.knowledge-tab-top b { font-size: 12px; font-weight: 500; }
.knowledge-categories > button > strong { font-size: 19px; font-weight: 650; }
.knowledge-categories > button > span:last-child { font-size: 12px; color: var(--muted); line-height: 1.6; }
.knowledge-categories > button.active > strong, .knowledge-categories > button.active .knowledge-tab-top { color: #6046c5; }
.knowledge-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0 16px; }
.knowledge-tools > p { margin: 0; color: var(--muted); font-size: 14px; }
.knowledge-tools .search-box { min-width: min(380px,100%); }
.knowledge-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; padding-bottom: 24px; }
.knowledge-card { overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: #fff; transition: box-shadow .15s, border-color .15s; }
.knowledge-card:hover { border-color: #c6bae9; box-shadow: 0 8px 24px #3424630a; }
.knowledge-card > button { display: flex; width: 100%; height: 100%; flex-direction: column; text-align: left; padding: 0; color: inherit; background: transparent; }
.knowledge-cover { display: flex; position: relative; width: 100%; height: 178px; justify-content: center; align-items: center; padding: 14px 22px 30px; background: #f8f8fa; border-bottom: 1px solid #eeedf3; }
.knowledge-cover img { width: 100%; height: 100%; object-fit: contain; }
.knowledge-cover > span { position: absolute; left: 16px; bottom: 10px; color: #655d76; background: #fffffff0; font-size: 11px; padding: 3px 8px; border-radius: 5px; }
.knowledge-type-cover { display: flex; min-width: 0; flex-direction: column; padding: 14px; gap: 12px; width: 100%; }
.knowledge-type-cover > span { color: #665777; font-size: 23px; line-height: 1.35; font-family: Georgia, "Songti SC", serif; font-style: italic; overflow-wrap: anywhere; }
.knowledge-type-cover > small { color: #938a9f; font-size: 12px; letter-spacing: .05em; }
.knowledge-card-copy { display: flex; flex: 1; flex-direction: column; padding: 20px; width: 100%; }
.knowledge-card-category { color: #8a7da0; font-size: 11px; line-height: 1.5; }
.knowledge-card h3 { font-size: 18px; line-height: 1.6; margin: 8px 0; font-weight: 650; }
.knowledge-card em { display: block; margin: 0 0 6px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.knowledge-card p { margin: 4px 0 20px; color: #716b7d; font-size: 14px; line-height: 1.8; }
.knowledge-card footer { display: flex; gap: 12px; justify-content: space-between; align-items: center; border-top: 1px solid #efedf4; padding-top: 14px; margin-top: auto; font-size: 12px; }
.knowledge-card footer > span { color: var(--muted); }
.knowledge-card footer strong { color: #7058ad; white-space: nowrap; font-weight: 600; }
.knowledge-detail-dialog { width: min(1160px,calc(100vw - 48px)); max-width: none; height: min(920px,calc(100dvh - 48px)); max-height: calc(100dvh - 48px); padding: 32px 42px 50px; border: 0; background: #fff; color: var(--ink); overflow-y: auto; border-radius: 18px; }
.knowledge-detail-dialog .viewer-close { position: sticky; top: 0; float: right; color: var(--muted); background: #f5f3f8; z-index: 4; }
.knowledge-reader-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-right: 48px; margin: 4px 0 30px; font-size: 12px; color: var(--muted); }
.knowledge-reader-top button { padding: 6px 0; color: var(--purple); background: transparent; font-size: 14px; }
.knowledge-detail-heading { padding: 0 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.knowledge-detail-heading > small { color: var(--purple); font-size: 13px; }
.knowledge-detail-heading h2 { margin: 12px 0; font-size: clamp(25px,2.4vw,36px); line-height: 1.45; letter-spacing: -.025em; font-weight: 650; }
.knowledge-detail-heading em { display: block; color: var(--muted); font-size: 17px; overflow-wrap: anywhere; }
.knowledge-detail-heading p { margin: 16px 0 0; max-width: 820px; color: #777082; font-size: 17px; line-height: 1.8; }
.knowledge-reader-layout { display: grid; grid-template-columns: 200px minmax(0,1fr); gap: 40px; }
.knowledge-toc { position: sticky; top: 14px; align-self: start; display: flex; flex-direction: column; gap: 6px; }
.knowledge-toc > strong { margin: 0 0 14px 12px; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .08em; }
.knowledge-toc button { display: flex; gap: 8px; text-align: left; line-height: 1.6; padding: 10px 12px; background: transparent; color: #80768e; border-radius: 8px; font-size: 13px; }
.knowledge-toc button:hover, .knowledge-toc button:focus-visible { color: var(--purple); background: var(--purple-soft); }
.knowledge-toc button span { color: #aaa1b8; font-size: 11px; padding-top: 2px; }
.knowledge-reader-body { min-width: 0; }
.knowledge-article-section { scroll-margin-top: 20px; padding-bottom: 30px; margin-bottom: 20px; border-bottom: 1px solid #eeebf2; }
.knowledge-article-section h3 { display: flex; gap: 12px; align-items: baseline; margin: 0 0 18px; font-size: 21px; line-height: 1.6; font-weight: 650; }
.knowledge-article-section h3 > span { color: #af9bc9; font-size: 13px; }
.knowledge-article-section > p, .knowledge-article-section > ul { margin: 14px 0; color: #514b5d; font-size: 17px; line-height: 1.95; }
.knowledge-article-section > ul { padding-left: 24px; }
.knowledge-article-section li { padding-left: 4px; margin: 8px 0; }
.knowledge-inline-figures, .knowledge-gallery { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,230px),1fr)); gap: 16px; margin: 24px 0 0; }
.knowledge-figure { min-width: 0; margin: 0; border: 1px solid var(--line); padding: 18px; border-radius: 12px; background: #fcfbfd; }
.knowledge-figure > img, .knowledge-figure > video { width: 100%; max-height: 420px; object-fit: contain; margin: 0 auto; border-radius: 4px; }
.knowledge-figure figcaption { display: flex; align-items: flex-start; flex-direction: column; gap: 8px; margin-top: 14px; }
.knowledge-media-type { display: inline-block; padding: 3px 7px; background: #efeaf7; color: #7f6b99; border-radius: 4px; font-size: 11px; }
.knowledge-figure figcaption strong { font-size: 13px; line-height: 1.7; font-weight: 500; }
.knowledge-figure figcaption p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.7; overflow-wrap: anywhere; }
.knowledge-figure details { font-size: 12px; color: #8d819d; line-height: 1.8; }
.knowledge-figure details p { margin-top: 8px; }
.knowledge-figure summary { cursor: pointer; }
.knowledge-figure a, .knowledge-sources a { text-decoration: underline; text-underline-offset: 3px; }
.knowledge-video-placeholder { display: flex; min-height: 180px; flex-direction: column; justify-content: center; align-items: center; gap: 16px; background: #f0edf5; border-radius: 8px; }
.knowledge-video-placeholder > span { color: #69567d; font-size: 16px; }
.knowledge-video-placeholder > small { color: var(--muted); font-size: 12px; }
.knowledge-sources { scroll-margin-top: 20px; padding: 22px; background: #f8f6fb; border-radius: 12px; overflow-wrap: anywhere; }
.knowledge-sources h3, .knowledge-related h3 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.knowledge-sources p, .knowledge-sources li { font-size: 13px; line-height: 1.9; color: #81768e; }
.knowledge-sources ul { margin: 12px 0; padding-left: 20px; }
.knowledge-sources small { font-size: 11px; color: #94899f; }
.knowledge-sources details { margin-top: 18px; font-size: 13px; }
.knowledge-sources details button { margin: 12px 8px 0 0; }
.knowledge-related { margin-top: 30px; }
.knowledge-related > button { display: grid; width: 100%; grid-template-columns: 80px 1fr 15px; gap: 12px; padding: 17px 0; background: transparent; text-align: left; border-bottom: 1px solid var(--line); align-items: baseline; }
.knowledge-related span { color: var(--muted); font-size: 12px; }
.knowledge-related strong { color: #6d548c; font-weight: 500; font-size: 14px; }
.knowledge-related b { color: #a997bd; }
.knowledge-media-error { color: var(--red-dark); padding: 20px; font-size: 13px; }
#view-knowledge button:focus-visible { outline: 3px solid #bea9ee; outline-offset: 3px; }
@media (max-width: 1100px) {
  .knowledge-categories > button { padding: 15px; }
  .knowledge-categories > button > strong { font-size: 17px; }
  .knowledge-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .knowledge-reader-layout { grid-template-columns: 170px minmax(0,1fr); gap: 24px; }
}
@media (max-width: 700px) {
  .knowledge-hero { padding: 22px; }
  .knowledge-hero .release-badge { border-left: 0; padding-left: 0; min-width: 0; margin-top: 10px; }
  .knowledge-categories { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .knowledge-tools { align-items: stretch; flex-direction: column; }
  .knowledge-grid { grid-template-columns: minmax(0,1fr); }
  .knowledge-detail-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); padding: 20px; border-radius: 12px; }
  .knowledge-reader-top { padding-right: 8px; margin-bottom: 20px; }
  .knowledge-reader-top > span { display: none; }
  .knowledge-reader-layout { display: block; }
  .knowledge-toc { position: static; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
  .knowledge-toc > strong { margin-left: 0; margin-bottom: 3px; }
  .knowledge-toc button { padding: 7px 0; }
  .knowledge-detail-heading h2 { font-size: 27px; }
  .knowledge-article-section > p, .knowledge-article-section > ul { font-size: 16px; }
  .knowledge-figure { padding: 12px; }
  .knowledge-related > button { grid-template-columns: 68px 1fr 12px; gap: 8px; }
}
