:root {
  color: #17212b;
  background: #f5f7f8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
}

#app {
  min-height: 100%;
}

button {
  font: inherit;
}

.kb-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: stretch;
  overflow: hidden;
}

.kb-panel {
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  padding: 24px;
  box-shadow: none;
}

.kb-panel--wide {
  width: 100%;
}

.kb-command-palette-layer {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: clamp(44px, 13vh, 118px) 16px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.kb-command-palette-layer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.kb-command-palette-hit-area {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: inherit;
  background: rgba(9, 21, 38, 0.18);
  backdrop-filter: blur(14px) saturate(1.14);
}

.kb-command-palette-card {
  width: min(620px, calc(100vw - 28px));
  min-height: 238px;
  border: 1px solid rgba(175, 209, 231, 0.58);
  border-radius: 8px;
  padding: 16px;
  color: #eef8ff;
  background: rgba(9, 32, 63, 0.72);
  box-shadow: 0 22px 70px rgba(8, 28, 54, 0.34);
}

.kb-command-palette-search {
  display: grid;
  margin-bottom: 10px;
}

.kb-command-palette-search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(187, 225, 255, 0.46);
  border-radius: 8px;
  padding: 0 14px;
  color: #f7fbff;
  background: rgba(4, 18, 39, 0.42);
  outline: none;
  font: inherit;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: 0;
}

.kb-command-palette-search input::placeholder {
  color: rgba(226, 241, 255, 0.68);
}

.kb-command-palette-search input:focus-visible {
  border-color: rgba(204, 235, 255, 0.86);
  box-shadow: 0 0 0 3px rgba(92, 178, 255, 0.18);
}

.kb-command-palette-list {
  display: grid;
  gap: 6px;
}

.kb-command-palette-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px 8px 12px;
  color: #eff8ff;
  background: rgba(7, 30, 63, 0.2);
  text-align: left;
  cursor: pointer;
}

.kb-command-palette-row:hover,
.kb-command-palette-row.is-active {
  border-color: rgba(184, 224, 255, 0.42);
  background: rgba(78, 155, 232, 0.24);
}

.kb-command-palette-row span {
  overflow: hidden;
  font-size: 14px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-command-palette-row kbd {
  max-width: 180px;
  overflow: hidden;
  border: 1px solid rgba(198, 229, 255, 0.3);
  border-radius: 7px;
  padding: 3px 7px;
  color: rgba(235, 247, 255, 0.78);
  background: rgba(4, 20, 45, 0.28);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-command-palette-empty {
  min-height: 78px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(190, 224, 252, 0.32);
  border-radius: 8px;
  color: rgba(234, 245, 255, 0.78);
  font-size: 14px;
  font-weight: 720;
}

.kb-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.kb-eyebrow {
  margin: 0 0 6px;
  color: #5b6b7a;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: 0;
}

.refresh-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #9bb7c8;
  border-radius: 6px;
  background: #e7f2f8;
  color: #12384f;
  font-weight: 700;
  cursor: pointer;
}

.kb-main-nav {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e4eaee;
}

.kb-main-nav__primary,
.kb-main-nav__secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kb-main-nav__secondary {
  gap: 5px;
}

.kb-main-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #435565;
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.kb-main-nav__link--secondary {
  min-height: 30px;
  padding: 0 10px;
  color: #556675;
  font-size: 13px;
  font-weight: 700;
}

.kb-main-nav__link:hover,
.kb-main-nav__link:focus-visible {
  border-color: #c8d1d9;
  color: #1d4d65;
  background: #f6fafc;
  outline: none;
}

.kb-main-nav__link.is-active {
  border-color: #9bb7c8;
  color: #12384f;
  background: #e7f2f8;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: #4a5a67;
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #9aa6b2;
}

.status-line[data-status="ready"] .status-dot {
  background: #1f9d6a;
}

.status-line[data-status="syncing"] .status-dot,
.status-line[data-status="starting"] .status-dot {
  background: #bf7b2f;
}

.status-line[data-status="error"] .status-dot {
  background: #c43b3b;
}

.status-line[data-status="disabled"] .status-dot,
.status-line[data-status="stopped"] .status-dot,
.status-line[data-status="not-started"] .status-dot {
  background: #768491;
}

.runtime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.runtime-section-stack {
  display: grid;
  gap: 18px;
}

.runtime-section-title {
  margin: 4px 0 -6px;
  color: #1d2c36;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.runtime-row {
  min-height: 72px;
  padding: 12px;
  border: 1px solid #e0e6eb;
  border-radius: 6px;
  background: #fbfcfd;
}

.runtime-row dt {
  margin: 0 0 6px;
  color: #647483;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.runtime-row dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #182631;
  font-size: 14px;
  line-height: 1.45;
}

.muted,
.error-message {
  margin: 0;
  color: #647483;
}

.error-message {
  color: #9f2f2f;
}

.health-placeholder {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.health-placeholder h2 {
  margin: 0;
  color: #1d2c36;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.query-catalog {
  display: grid;
  gap: 12px;
}

.query-summary {
  margin: 0;
  color: #4d5f6d;
  font-size: 14px;
  line-height: 1.45;
}

.kb-search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.kb-search-box__field {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: #22313b;
}

.kb-search-box__label {
  color: #52636f;
  font-size: 13px;
  font-weight: 750;
}

.kb-search-box__input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #b7c7d3;
  border-radius: 6px;
  padding: 0 12px;
  color: #17212b;
  background: #ffffff;
  font: inherit;
}

.kb-search-box__input:focus {
  border-color: #78a9bc;
  outline: 2px solid rgba(120, 169, 188, 0.24);
}

.kb-search-box__button {
  min-height: 42px;
  border: 1px solid #1f6f8b;
  border-radius: 6px;
  padding: 0 16px;
  color: #ffffff;
  background: #1f6f8b;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.kb-search-box__button:disabled,
.kb-search-box__input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.kb-search-results {
  display: grid;
  gap: 10px;
}

.kb-search-result {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #dce4e9;
  border-radius: 6px;
  background: #ffffff;
}

.kb-search-result__header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  justify-content: space-between;
}

.kb-search-result__title {
  color: #12384f;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
}

.kb-search-result__title:hover,
.kb-search-result__title:focus-visible {
  text-decoration: underline;
}

.kb-search-result__path {
  margin: 0;
  overflow-wrap: anywhere;
  color: #5c6d7a;
  font-size: 13px;
  line-height: 1.35;
}

.kb-search-result__fields {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kb-search-result__field {
  border-radius: 999px;
  padding: 2px 7px;
  color: #34515e;
  background: #eef2f5;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}

.kb-search-result__snippets {
  display: grid;
  gap: 6px;
}

.kb-search-result__snippet {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  color: #24313b;
  font-size: 13px;
  line-height: 1.45;
}

.kb-search-result__line {
  color: #6a7782;
  font-weight: 750;
}

.query-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #dbe3e8;
  border-radius: 8px;
  background: #ffffff;
}

.query-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: #1d2c36;
  font-size: 14px;
}

.query-table th,
.query-table td {
  border-bottom: 1px solid #e6edf1;
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.query-table th {
  color: #516371;
  background: #f8fafb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.query-table tbody tr:last-child td {
  border-bottom: 0;
}

.query-table__row {
  cursor: pointer;
}

.query-table__row:hover td,
.query-table__row:focus-visible td {
  background: #f4faf8;
}

.query-table__row:focus-visible {
  outline: 2px solid #78a9bc;
  outline-offset: -2px;
}

.query-table__id {
  width: 190px;
}

.query-table code,
.kb-argument-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.query-table__label {
  margin-bottom: 4px;
  color: #17212b;
  font-weight: 800;
}

.query-table__description {
  margin: 0;
  color: #5c6d7a;
  line-height: 1.45;
}

.blog-list {
  width: min(100%, 1120px);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.blog-reading-time {
  color: #637382;
}

.blog-article__series {
  padding: 0;
  border: none;
  background: none;
  color: #0d5f83;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
}

.blog-article__series:hover,
.blog-article__series:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}

.blog-article__footer {
  max-width: 88ch;
  display: grid;
  gap: 28px;
  margin-top: 8px;
}

.blog-prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.blog-prev-next__link {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #d6e0e7;
  border-radius: 10px;
  background: #fbfcfd;
  text-decoration: none;
}

.blog-prev-next__link--next {
  text-align: right;
}

.blog-prev-next__link:hover,
.blog-prev-next__link:focus-visible {
  border-color: #9bb7c8;
  background: #eaf4f8;
  outline: none;
}

.blog-prev-next__label {
  color: #637382;
  font-size: 12px;
  font-weight: 750;
}

.blog-prev-next__title {
  color: #16384d;
  font-size: 15px;
  font-weight: 750;
}

.blog-related {
  display: grid;
  gap: 10px;
}

.blog-related__title {
  margin: 0;
  font-size: 18px;
}

.blog-related__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.blog-related__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.blog-related__link {
  color: #164457;
  font-weight: 700;
  text-decoration: none;
}

.blog-related__link:hover,
.blog-related__link:focus-visible {
  color: #0d5f83;
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}

.blog-related__date {
  color: #637382;
  font-size: 13px;
}


.blog-article {
  width: min(100%, 1280px);
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

.blog-article__header {
  max-width: 88ch;
  display: grid;
  gap: 10px;
}

.blog-article__back-link {
  justify-self: start;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #c8d6de;
  border-radius: 6px;
  color: #164457;
  background: #f5fafc;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.blog-article__back-link:hover,
.blog-article__back-link:focus-visible {
  border-color: #9bb7c8;
  color: #0d5f83;
  background: #eaf4f8;
  outline: none;
}

.blog-article__header h1 {
  font-size: 36px;
  line-height: 1.15;
}

.blog-article__description {
  margin: 0;
  color: #4d5f6d;
  font-size: 17px;
  line-height: 1.55;
}

.blog-article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #637382;
  font-size: 13px;
  font-weight: 700;
}

.blog-article__layout {
  display: grid;
  grid-template-columns: minmax(0, 88ch) minmax(220px, 280px);
  align-items: start;
  gap: 40px;
}

.blog-article__body {
  min-width: 0;
  max-width: 88ch;
}

.blog-article__toc {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 14px;
  border: 1px solid #e0e6eb;
  border-radius: 6px;
  background: #fbfcfd;
}

.blog-article__toc-title {
  margin: 0 0 10px;
  color: #647483;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.blog-article__toc ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.blog-article__toc li {
  color: #465866;
  font-size: 13px;
  line-height: 1.35;
}

.blog-article__toc li[data-level="3"] {
  padding-left: 12px;
  color: #647483;
}

.blog-article__toc li[data-level="4"] {
  padding-left: 24px;
  color: #738393;
}

.blog-article__toc-link {
  display: block;
  margin-left: -6px;
  border-radius: 5px;
  padding: 3px 6px;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.blog-article__toc-link:hover,
.blog-article__toc-link:focus-visible {
  color: #0d5f83;
  background: #edf6f9;
  outline: none;
}

.markdown-body [data-heading-anchor="true"] {
  scroll-margin-top: 22px;
  outline: none;
}

.markdown-body [data-heading-anchor="true"]:focus-visible {
  border-radius: 4px;
  outline: 2px solid rgba(45, 120, 144, 0.32);
  outline-offset: 3px;
}

/* Public site prose: markdown rendered inside `.site-prose` wrappers on the
   public host (home intro, about, now, blog article body). Descendant
   selectors are required because the markdown renderer emits its own class
   cascade; owner note pages keep the default `.markdown-body` rules above. */
.site-prose .markdown-body {
  display: block;
  color: #20242c;
  font-size: 16px;
  line-height: 1.85;
}

.site-prose .markdown-body p {
  margin: 0 0 1.1em;
}

.site-prose .markdown-body h1,
.site-prose .markdown-body h2,
.site-prose .markdown-body h3,
.site-prose .markdown-body h4,
.site-prose .markdown-body h5,
.site-prose .markdown-body h6 {
  margin: 1.9em 0 0.7em;
  color: #20242c;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-weight: 700;
  line-height: 1.4;
}

.site-prose .markdown-body h1 {
  font-size: 24px;
}

.site-prose .markdown-body h2 {
  font-size: 21px;
}

.site-prose .markdown-body h3 {
  font-size: 18px;
}

.site-prose .markdown-body h4,
.site-prose .markdown-body h5,
.site-prose .markdown-body h6 {
  font-size: 16px;
}

.site-prose .markdown-body a {
  color: #2b5aa6;
  text-decoration: none;
}

.site-prose .markdown-body a:hover {
  color: #1f4688;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-prose .markdown-body a:focus-visible {
  border-radius: 3px;
  outline: 2px solid #2b5aa6;
  outline-offset: 2px;
}

.site-prose .markdown-body blockquote {
  margin: 0 0 1.1em;
  border-left: 3px solid #e7e3da;
  padding: 2px 0 2px 14px;
  color: #68707c;
  background: transparent;
}

.site-prose .markdown-body .md-blank {
  display: none;
}

.site-prose .markdown-body .md-list {
  margin: 0 0 1.1em;
  padding-left: 24px;
}

.site-prose .markdown-body .md-code {
  margin: 0 0 1.1em;
  border-color: #e7e3da;
  color: #20242c;
  background: #faf9f6;
}

.site-prose .markdown-body .md-table-wrap,
.site-prose .markdown-body .math-block {
  margin: 0 0 1.1em;
}

@media (max-width: 1120px) {
  .blog-article__layout {
    grid-template-columns: 1fr;
  }

  .blog-article__toc {
    position: static;
    max-height: none;
  }
}

.kb-argument-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  background: #ffffff;
}

.kb-argument-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  color: #17212b;
  font-size: 13px;
}

.kb-argument-table th,
.kb-argument-table td {
  border-bottom: 1px solid #e4eaee;
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}

.kb-argument-table th {
  color: #344653;
  background: #f4f3ef;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
}

.kb-argument-table tbody tr:last-child td {
  border-bottom: 0;
}

.kb-argument-table__name {
  width: 24%;
}

.kb-argument-table__type {
  width: 20%;
}

.kb-argument-table__required {
  width: 64px;
  color: #52636f;
  font-weight: 750;
}

.kb-argument-table__required[data-required="true"] {
  color: #b52e2e;
}

.kb-argument-table__description {
  min-width: 180px;
  color: #455866;
  line-height: 1.45;
}

.query-detail-description {
  max-width: 720px;
  margin: 8px 0 0;
  color: #5c6d7a;
  line-height: 1.45;
}

.query-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.query-back-link[data-selected="true"] {
  border-color: #2a845b;
  color: #1f5f42;
  background: #edf7f1;
}

.query-detail-section,
.query-run-result {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.query-detail-section h2,
.query-result-section h2 {
  margin: 0;
  color: #1d2c36;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.query-detail-id {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #5d6e7b;
  font-size: 13px;
  font-weight: 750;
}

.query-detail-id code,
.query-arg-field code,
.query-diagnostic code,
.query-raw {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.query-arg-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.query-arg-field {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid #dce4e9;
  border-radius: 6px;
  background: #fbfcfd;
}

.query-arg-field[data-required="true"] {
  border-color: #d4b2a5;
}

.query-arg-field__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.query-arg-field__name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #1d2c36;
  font-weight: 800;
}

.query-arg-field__meta {
  flex: none;
  color: #647483;
  font-size: 12px;
  font-weight: 750;
}

.query-arg-field__control {
  width: 100%;
  min-height: 38px;
  border: 1px solid #b7c7d3;
  border-radius: 6px;
  padding: 0 10px;
  color: #17212b;
  background: #ffffff;
  font: inherit;
}

.query-arg-field__control:focus {
  border-color: #78a9bc;
  outline: 2px solid rgba(120, 169, 188, 0.24);
}

.query-arg-field__helper {
  color: #637382;
  font-size: 12px;
  line-height: 1.35;
}

.query-run-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.query-result-section {
  display: grid;
  gap: 10px;
}

.query-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #52636f;
  font-size: 13px;
  font-weight: 750;
}

.query-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.query-stat {
  min-height: 72px;
  padding: 12px;
  border: 1px solid #e0e6eb;
  border-radius: 6px;
  background: #fbfcfd;
}

.query-stat dt,
.query-item-grid dt {
  margin: 0 0 5px;
  color: #647483;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.query-stat dd,
.query-item-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #17212b;
  font-size: 13px;
  line-height: 1.4;
}

.query-diagnostics {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.query-diagnostic {
  display: grid;
  grid-template-columns: minmax(70px, auto) minmax(130px, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid #ead3ca;
  border-radius: 6px;
  background: #fffaf7;
  color: #24313b;
  font-size: 13px;
}

.query-diagnostic strong {
  color: #9f2f2f;
}

.query-diagnostic .query-raw {
  grid-column: 1 / -1;
  margin: 0;
}

.query-items {
  display: grid;
  gap: 10px;
}

.query-result-item {
  padding: 12px;
  border: 1px solid #dce4e9;
  border-radius: 6px;
  background: #ffffff;
}

.query-result-item h3 {
  margin: 0 0 10px;
  color: #1d2c36;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0;
}

.query-item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 14px;
  margin: 0;
}

.query-raw {
  max-width: 100%;
  margin: 0;
  overflow: auto;
  border: 1px solid #e0e6eb;
  border-radius: 6px;
  padding: 10px;
  color: #17212b;
  background: #f8fafb;
  font-size: 12px;
  line-height: 1.45;
}

.xiangqi-page-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.xiangqi-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.xiangqi-list-panel {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.xiangqi-list-panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.xiangqi-list-panel__header h2 {
  margin: 0;
  color: #1d2c36;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.xiangqi-list-panel__header span {
  color: #647483;
  font-size: 13px;
  font-weight: 750;
}

.xiangqi-example-list,
.xiangqi-game-tree-list {
  max-height: min(720px, 72vh);
  display: grid;
  gap: 6px;
  overflow: auto;
}

.xiangqi-example-list__item,
.xiangqi-game-tree-list__item {
  min-width: 0;
  display: grid;
  gap: 5px;
  border: 1px solid #dce4e9;
  border-radius: 6px;
  padding: 10px 11px;
  color: #24313b;
  background: #ffffff;
  text-decoration: none;
}

.xiangqi-example-list__item:hover,
.xiangqi-example-list__item:focus-visible,
.xiangqi-example-list__item.is-active,
.xiangqi-game-tree-list__item:hover,
.xiangqi-game-tree-list__item:focus-visible,
.xiangqi-game-tree-list__item.is-active {
  border-color: #9bb7c8;
  background: #f4faf8;
  outline: none;
}

.xiangqi-game-tree-list__item.is-error {
  border-color: #e4c4c4;
}

.xiangqi-game-tree-list__item.is-error:hover,
.xiangqi-game-tree-list__item.is-error:focus-visible,
.xiangqi-game-tree-list__item.is-error.is-active {
  border-color: #cc8b8b;
  background: #fff7f7;
}

.xiangqi-example-list__title,
.xiangqi-game-tree-list__title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xiangqi-example-list__meta,
.xiangqi-game-tree-list__meta {
  min-width: 0;
  display: grid;
  gap: 3px;
  color: #647483;
  font-size: 12px;
  line-height: 1.3;
}

.xiangqi-example-list__meta span,
.xiangqi-game-tree-list__meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xiangqi-example-detail,
.xiangqi-game-tree-detail,
.xiangqi-tree-canvas-detail {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.xiangqi-example-meta,
.xiangqi-game-tree-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.xiangqi-page-grid--canvas {
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
}

.draughts-page-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.draughts-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.kb-pve-agent-select {
  position: relative;
  width: min(320px, 70vw);
}

.kb-pve-agent-select .rf-filter-select__input {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  padding: 0 36px 0 12px;
  border: 1px solid #9bb7c8;
  border-radius: 6px;
  background: #fff;
  color: #12384f;
  font: inherit;
  font-weight: 700;
  outline: none;
}

.kb-pve-agent-select .rf-filter-select__input:focus {
  border-color: #4f7ebc;
  box-shadow: 0 0 0 3px rgba(79, 126, 188, 0.16);
}

.kb-pve-agent-select .rf-filter-select__listbox {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  box-sizing: border-box;
  margin: 0;
  padding: 4px;
  overflow: auto;
  list-style: none;
  border: 1px solid #9bb7c8;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.16);
}

.kb-pve-agent-select .rf-filter-select__option {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.kb-pve-agent-select .rf-filter-select__option[data-active="true"] {
  background: #edf5f9;
}

.kb-pve-agent-select .rf-filter-select__option[data-selected="true"] {
  background: #12384f;
  color: #fff;
}

.kb-pve-agent-select .rf-filter-select__option-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.kb-pve-agent-select .rf-filter-select__option-label,
.kb-pve-agent-select .rf-filter-select__option-description {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-pve-agent-select .rf-filter-select__option-label {
  font-weight: 700;
}

.kb-pve-agent-select .rf-filter-select__option-description,
.kb-pve-agent-select .rf-filter-select__empty {
  color: #5b6b7a;
  font-size: 12px;
}

.kb-pve-agent-select .rf-filter-select__option[data-selected="true"]
  .rf-filter-select__option-description {
  color: rgba(255, 255, 255, 0.75);
}

.kb-pve-agent-select .rf-filter-select__empty {
  padding: 8px 10px;
}

.draughts-list-panel {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.draughts-list-panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.draughts-list-panel__header h2 {
  margin: 0;
  color: #1d2c36;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.draughts-list-panel__header span {
  color: #647483;
  font-size: 13px;
  font-weight: 750;
}

.draughts-example-list,
.draughts-game-tree-list {
  max-height: min(720px, 72vh);
  display: grid;
  gap: 6px;
  overflow: auto;
}

.draughts-example-list__item,
.draughts-game-tree-list__item {
  min-width: 0;
  display: grid;
  gap: 5px;
  border: 1px solid #dce4e9;
  border-radius: 6px;
  padding: 10px 11px;
  color: #24313b;
  background: #ffffff;
  text-decoration: none;
}

.draughts-example-list__item:hover,
.draughts-example-list__item:focus-visible,
.draughts-example-list__item.is-active,
.draughts-game-tree-list__item:hover,
.draughts-game-tree-list__item:focus-visible,
.draughts-game-tree-list__item.is-active {
  border-color: #98b5a8;
  background: #f4faf8;
  outline: none;
}

.draughts-game-tree-list__item.is-error {
  border-color: #e4c4c4;
}

.draughts-game-tree-list__item.is-error:hover,
.draughts-game-tree-list__item.is-error:focus-visible,
.draughts-game-tree-list__item.is-error.is-active {
  border-color: #cc8b8b;
  background: #fff7f7;
}

.draughts-example-list__title,
.draughts-game-tree-list__title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draughts-example-list__meta,
.draughts-game-tree-list__meta {
  min-width: 0;
  display: grid;
  gap: 3px;
  color: #647483;
  font-size: 12px;
  line-height: 1.3;
}

.draughts-example-list__meta span,
.draughts-game-tree-list__meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draughts-example-detail,
.draughts-game-tree-detail,
.draughts-tree-canvas-detail {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.draughts-example-meta,
.draughts-game-tree-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.draughts-page-grid--canvas {
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
}

.kb-game-tree-canvas {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.kb-game-tree-canvas__toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kb-game-tree-canvas__stats,
.kb-game-tree-canvas__actions {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.kb-game-tree-canvas__stats span {
  border: 1px solid #d5dee4;
  border-radius: 999px;
  padding: 3px 9px;
  color: #52636f;
  background: #f8fafb;
  font-size: 12px;
  font-weight: 750;
}

.kb-game-tree-tool {
  min-width: 34px;
  height: 34px;
  border: 1px solid #bdc8d0;
  border-radius: 6px;
  color: #20313c;
  background: #f8fafb;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.kb-game-tree-tool:hover,
.kb-game-tree-tool:focus-visible {
  border-color: #9bb7c8;
  background: #e7f2f8;
  outline: none;
}

.kb-game-tree-canvas__body {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 250px);
  gap: 12px;
  align-items: stretch;
}

.kb-game-tree-canvas__surface {
  position: relative;
  min-width: 0;
  min-height: min(640px, 72vh);
  overflow: hidden;
  border: 1px solid #d7e0e5;
  border-radius: 8px;
  background: #f8fafb;
  touch-action: none;
}

.kb-game-tree-canvas__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.kb-game-tree-canvas__fallback-layer {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

.kb-game-tree-canvas__node-layer {
  position: relative;
  transform-origin: 0 0;
}

.kb-game-tree-node {
  position: absolute;
  min-width: 0;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  border: 1px solid #cfdadf;
  border-radius: 8px;
  padding: 9px;
  color: #20313c;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(33, 47, 57, 0.08);
  cursor: pointer;
  text-align: left;
}

.kb-game-tree-node:hover,
.kb-game-tree-node:focus-visible,
.kb-game-tree-node.is-selected {
  border-color: #5a8a75;
  background: #f3faf6;
  outline: none;
}

.kb-game-tree-node .kb-game-tree-node__board {
  grid-row: 1 / 3;
  width: 118px;
  height: 118px;
  border: 1px solid #415960;
}

.kb-game-tree-node[data-variant="xiangqi"] {
  grid-template-columns: 104px minmax(0, 1fr);
}

.kb-game-tree-node[data-variant="xiangqi"] .kb-game-tree-node__board {
  width: 104px;
  height: auto;
  aspect-ratio: 9 / 10;
  border-color: #6d5632;
}

.kb-game-tree-node__move {
  min-width: 0;
  overflow: hidden;
  color: #1d2c36;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-game-tree-node__meta {
  min-width: 0;
  align-self: start;
  overflow: hidden;
  color: #647483;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-game-tree-node__invalid {
  grid-row: 1 / 3;
  width: 118px;
  height: 118px;
  border: 1px solid #e4c4c4;
  background: #fff7f7;
}

.kb-game-tree-inspector {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid #d7e0e5;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.kb-game-tree-inspector__board .kb-draughts-board,
.kb-game-tree-inspector__board .kb-xiangqi-board {
  width: min(100%, 210px);
}

.kb-game-tree-inspector__meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.kb-game-tree-inspector__meta div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.kb-game-tree-inspector__meta dt {
  color: #647483;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.kb-game-tree-inspector__meta dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #20313c;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-mcts-tree {
  width: min(100%, 1120px);
  display: grid;
  gap: 12px;
}

.kb-mcts-tree__header {
  display: grid;
  gap: 4px;
}

.kb-mcts-tree__header h3 {
  margin: 0;
  color: #1f2c35;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.kb-mcts-tree__header p {
  margin: 0;
  color: #5d6f7c;
  font-size: 13px;
  line-height: 1.45;
}

.kb-mcts-tree__note {
  margin: 0;
  color: #627482;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.kb-mcts-story {
  width: min(100%, 1120px);
  display: grid;
  gap: 12px;
}

.kb-mcts-run-story {
  width: min(100%, 1120px);
  display: grid;
  gap: 12px;
}

.kb-mcts-run-story__summary {
  margin-left: auto;
  color: #526675;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.kb-mcts-story__header {
  display: grid;
  gap: 4px;
}

.kb-mcts-story__header h3 {
  margin: 0;
  color: #1f2c35;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.kb-mcts-story__header p {
  margin: 0;
  color: #5d6f7c;
  font-size: 13px;
  line-height: 1.45;
}

.kb-mcts-story__controls {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kb-mcts-story__steps {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.kb-mcts-story__nav,
.kb-mcts-story__step {
  border: 1px solid #bdc8d0;
  border-radius: 6px;
  color: #263844;
  background: #f8fafb;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.kb-mcts-story__nav {
  min-height: 32px;
  padding: 0 11px;
}

.kb-mcts-story__step {
  width: 30px;
  height: 30px;
}

.kb-mcts-story__nav:hover,
.kb-mcts-story__step:hover,
.kb-mcts-story__nav:focus-visible,
.kb-mcts-story__step:focus-visible {
  border-color: #88aab9;
  background: #eef7fa;
  outline: none;
}

.kb-mcts-story__nav:disabled {
  color: #94a0a8;
  background: #edf1f3;
  cursor: default;
}

.kb-mcts-story__step.is-active {
  border-color: #286b59;
  color: #ffffff;
  background: #286b59;
}

.kb-mcts-story__caption {
  min-width: 0;
  display: grid;
  gap: 7px;
  border: 1px solid #d6e1e6;
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fbfc;
}

.kb-mcts-story__caption-top {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kb-mcts-story__phase {
  border: 1px solid #d7c999;
  border-radius: 999px;
  padding: 2px 8px;
  color: #67521b;
  background: #fff7dc;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.kb-mcts-story__counter {
  color: #687782;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.kb-mcts-story__caption h4 {
  margin: 0;
  color: #1f2c35;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
}

.kb-mcts-story__caption p {
  margin: 0;
  color: #435663;
  font-size: 13px;
  line-height: 1.45;
}

.kb-mcts-tree .kb-game-tree-canvas__surface {
  min-height: min(560px, 70vh);
}

.kb-tree-canvas-node {
  min-width: 0;
  height: 100%;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 10px;
}

.kb-game-tree-node[data-variant="mcts"] {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.kb-mcts-node {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 7px;
  padding: 10px;
}

.kb-mcts-node__top {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.kb-mcts-node__label {
  min-width: 0;
  overflow: hidden;
  color: #1f2c35;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-mcts-node__role,
.kb-mcts-inspector__role {
  flex: none;
  border: 1px solid #d7c999;
  border-radius: 999px;
  padding: 2px 7px;
  color: #67521b;
  background: #fff7dc;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.kb-mcts-node__move {
  min-width: 0;
  overflow: hidden;
  color: #415360;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-mcts-node__stats {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.kb-mcts-node__stat {
  min-width: 0;
  display: grid;
  gap: 2px;
  border: 1px solid #d8e2e7;
  border-radius: 6px;
  padding: 5px 6px;
  background: #f8fafb;
}

.kb-mcts-node__stat span {
  color: #647483;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.kb-mcts-node__stat strong {
  min-width: 0;
  overflow: hidden;
  color: #1f2c35;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-mcts-node__secondary {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.kb-mcts-node__secondary span {
  border: 1px solid #c8d9e6;
  border-radius: 999px;
  padding: 2px 6px;
  color: #31546c;
  background: #edf6fb;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
}

.kb-mcts-inspector {
  align-content: start;
}

.kb-mcts-inspector__header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kb-mcts-inspector__label {
  min-width: 0;
  overflow: hidden;
  color: #1f2c35;
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-mcts-inspector .kb-game-tree-inspector__meta dd {
  white-space: normal;
  overflow-wrap: anywhere;
}

.kb-context-window-story {
  width: min(100%, 1120px);
  display: grid;
  gap: 12px;
}

.kb-context-window-story__header {
  display: grid;
  gap: 4px;
}

.kb-context-window-story__header h3 {
  margin: 0;
  color: #1f2c35;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.kb-context-window-story__header p {
  margin: 0;
  color: #5d6f7c;
  font-size: 13px;
  line-height: 1.45;
}

.kb-context-window-story__controls {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kb-context-window-story__steps {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.kb-context-window-story__nav,
.kb-context-window-story__step {
  border: 1px solid #bdc8d0;
  border-radius: 6px;
  color: #263844;
  background: #f8fafb;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.kb-context-window-story__nav {
  min-height: 32px;
  padding: 0 11px;
}

.kb-context-window-story__step {
  width: 30px;
  height: 30px;
}

.kb-context-window-story__nav:hover,
.kb-context-window-story__step:hover,
.kb-context-window-story__nav:focus-visible,
.kb-context-window-story__step:focus-visible {
  border-color: #88aab9;
  background: #eef7fa;
  outline: none;
}

.kb-context-window-story__nav:disabled {
  color: #94a0a8;
  background: #edf1f3;
  cursor: default;
}

.kb-context-window-story__step.is-active {
  border-color: #2f5f7c;
  color: #ffffff;
  background: #2f5f7c;
}

.kb-context-window-story__caption {
  min-width: 0;
  display: grid;
  gap: 7px;
  border: 1px solid #d6e1e6;
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fbfc;
}

.kb-context-window-story__caption-top {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kb-context-window-story__phase {
  border: 1px solid #d7c999;
  border-radius: 999px;
  padding: 2px 8px;
  color: #67521b;
  background: #fff7dc;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.kb-context-window-story__counter {
  color: #687782;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.kb-context-window-story__caption h4 {
  margin: 0;
  color: #1f2c35;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
}

.kb-context-window-story__caption p {
  margin: 0;
  color: #435663;
  font-size: 13px;
  line-height: 1.45;
}

.kb-context-window-story__body {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(220px, 300px);
  gap: 14px;
  align-items: stretch;
}

.kb-context-window__stack-wrap,
.kb-context-window__side {
  min-width: 0;
  border: 1px solid #d6e1e6;
  border-radius: 8px;
  background: #fbfcfd;
}

.kb-context-window__stack-wrap {
  display: grid;
  grid-template-rows: auto minmax(640px, 72vh) auto;
  overflow: hidden;
}

.kb-context-window__stack-header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #dfe7eb;
  padding: 12px 14px;
  background: #ffffff;
}

.kb-context-window__stack-header > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.kb-context-window__eyebrow {
  color: #627482;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
  text-transform: uppercase;
}

.kb-context-window__stack-header strong {
  min-width: 0;
  overflow: hidden;
  color: #1f2c35;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-context-window__status {
  flex: none;
  border: 1px solid #b9d7c7;
  border-radius: 999px;
  padding: 4px 9px;
  color: #245340;
  background: #edf8f1;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.kb-context-window__status[data-status="risk"] {
  border-color: #e2ca88;
  color: #6f5311;
  background: #fff6d8;
}

.kb-context-window__status[data-status="overflow"] {
  border-color: #e0a3a3;
  color: #8d3030;
  background: #fff0f0;
}

.kb-context-window__stack {
  position: relative;
  min-width: 0;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  background: #f2f5f7;
  overflow: hidden;
}

.kb-context-window__stack[data-status="risk"],
.kb-context-window__stack[data-status="overflow"] {
  background: #f4f3ee;
}

.kb-context-window__threshold {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  border-top: 2px solid rgba(119, 92, 26, 0.72);
  pointer-events: none;
}

.kb-context-window__threshold span {
  position: absolute;
  top: -11px;
  right: 12px;
  border: 1px solid #d8c27e;
  border-radius: 999px;
  padding: 2px 7px;
  color: #6b5218;
  background: #fff7dc;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
}

.kb-context-window__message {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid #cfdce3;
  border-left-width: 6px;
  border-radius: 7px;
  padding: 6px 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(20, 32, 40, 0.04);
  overflow: hidden;
}

.kb-context-window__message-top {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kb-context-window__message-label {
  min-width: 0;
  overflow: hidden;
  color: #1f2c35;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-context-window__message-role {
  flex: none;
  color: #60727f;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
  text-transform: uppercase;
}

.kb-context-window__message-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: #5d6f7c;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

.kb-context-window__message-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-context-window__message[data-role="system"] {
  border-left-color: #263544;
  background: #f7f9fb;
}

.kb-context-window__message[data-role="tool-schema"],
.kb-context-window__message[data-role="mcp"],
.kb-context-window__message[data-role="tools"] {
  border-left-color: #6750a4;
  background: #f7f3ff;
}

.kb-context-window__message[data-role="user"] {
  border-left-color: #27715b;
  background: #f1fbf6;
}

.kb-context-window__message[data-role="assistant"] {
  border-left-color: #3a6f92;
  background: #f1f7fb;
}

.kb-context-window__message[data-role="tool-call"] {
  border-left-color: #b76b1f;
  background: #fff5eb;
}

.kb-context-window__message[data-role="tool-result"] {
  border-left-color: #b08a16;
  background: #fff9df;
}

.kb-context-window__message[data-role="retrieved-doc"] {
  border-left-color: #168082;
  background: #eefafa;
}

.kb-context-window__message[data-role="summary"],
.kb-context-window__message[data-role="checkpoint"] {
  border-left-color: #6a7480;
  background: #f4f6f7;
}

.kb-context-window__free {
  position: relative;
  z-index: 1;
  min-height: 28px;
  display: grid;
  place-items: end center;
  border: 1px dashed #c9d3da;
  border-radius: 7px;
  padding: 8px;
  color: #7a8790;
  background: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.kb-context-window__stats {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid #dfe7eb;
  padding: 10px 12px;
  background: #ffffff;
}

.kb-context-window__stat {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.kb-context-window__stat span {
  color: #647483;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
  text-transform: uppercase;
}

.kb-context-window__stat strong {
  min-width: 0;
  overflow: hidden;
  color: #1f2c35;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-context-window__side {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 14px;
}

.kb-context-window__side-section {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.kb-context-window__side-section h4 {
  margin: 0;
  color: #1f2c35;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
}

.kb-context-window__side-section p {
  margin: 0;
  color: #536674;
  font-size: 12px;
  line-height: 1.45;
}

.kb-context-window__legend {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.kb-context-window__legend-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #415360;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.kb-context-window__legend-swatch {
  width: 12px;
  height: 12px;
  flex: none;
  border-radius: 3px;
  background: #8998a4;
}

.kb-context-window__legend-item[data-role="system"] .kb-context-window__legend-swatch {
  background: #263544;
}

.kb-context-window__legend-item[data-role="tool-schema"] .kb-context-window__legend-swatch {
  background: #6750a4;
}

.kb-context-window__legend-item[data-role="user"] .kb-context-window__legend-swatch {
  background: #27715b;
}

.kb-context-window__legend-item[data-role="assistant"] .kb-context-window__legend-swatch {
  background: #3a6f92;
}

.kb-context-window__legend-item[data-role="tool-call"] .kb-context-window__legend-swatch {
  background: #b76b1f;
}

.kb-context-window__legend-item[data-role="tool-result"] .kb-context-window__legend-swatch {
  background: #b08a16;
}

.kb-context-window__legend-item[data-role="retrieved-doc"] .kb-context-window__legend-swatch {
  background: #168082;
}

.kb-context-window__legend-item[data-role="summary"] .kb-context-window__legend-swatch {
  background: #6a7480;
}

@media (max-width: 820px) {
  .kb-context-window-story__body {
    grid-template-columns: 1fr;
  }

  .kb-context-window__stack-wrap {
    grid-template-rows: auto minmax(520px, 68vh) auto;
  }

  .kb-context-window__stats {
    grid-template-columns: 1fr;
  }
}

.voice-page-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.voice-list-panel {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.voice-list-panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.voice-list-panel__header h2 {
  margin: 0;
  color: #1d2c36;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.voice-list-panel__header span {
  color: #647483;
  font-size: 13px;
  font-weight: 750;
}

.voice-line-list {
  max-height: min(720px, 72vh);
  display: grid;
  gap: 6px;
  overflow: auto;
}

.voice-line-list__item {
  min-width: 0;
  display: grid;
  gap: 5px;
  border: 1px solid #dce4e9;
  border-radius: 6px;
  padding: 10px 11px;
  color: #24313b;
  background: #ffffff;
  text-decoration: none;
}

.voice-line-list__item:hover,
.voice-line-list__item:focus-visible,
.voice-line-list__item.is-active {
  border-color: #9bb7c8;
  background: #f4faf8;
  outline: none;
}

.voice-line-list__title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-line-list__meta {
  min-width: 0;
  display: grid;
  gap: 3px;
  color: #647483;
  font-size: 12px;
  line-height: 1.3;
}

.voice-line-list__meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-line-detail {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.voice-line-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.kb-voice-line {
  width: min(780px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  background: #ffffff;
}

.kb-voice-line__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.kb-voice-line__eyebrow {
  margin: 0 0 4px;
  color: #5e6c76;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.kb-voice-line__title {
  margin: 0;
  color: #1c2a33;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.kb-voice-line__source {
  max-width: 140px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c7d4dc;
  border-radius: 6px;
  padding: 0 10px;
  overflow: hidden;
  color: #28485a;
  background: #f4faf8;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-voice-line__player {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e0e6eb;
  border-radius: 6px;
  background: #fbfcfd;
}

.kb-voice-line__audio {
  width: 100%;
  display: block;
}

.kb-voice-line__transcript {
  display: grid;
  gap: 7px;
  margin: 0;
}

.kb-voice-line__transcript figcaption {
  color: #647483;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.kb-voice-line__transcript blockquote {
  min-height: 92px;
  margin: 0;
  border-left: 4px solid #7aa0a8;
  border-radius: 0 6px 6px 0;
  padding: 14px 16px;
  color: #17212b;
  background: #f8fafb;
  font-size: 18px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.kb-voice-line__empty {
  margin: 0;
  color: #647483;
}

.kb-voice-line__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.kb-voice-line-meta-row {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e0e6eb;
  border-radius: 6px;
  background: #fbfcfd;
}

.kb-voice-line-meta-row dt {
  margin: 0 0 5px;
  color: #647483;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.kb-voice-line-meta-row dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #17212b;
  font-size: 13px;
  line-height: 1.4;
}

.kb-ui-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  color: #ffffff;
  background: #1f6f8b;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
}

.kb-ui-button--sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.kb-ui-button--lg {
  min-height: 44px;
  padding: 0 18px;
  font-size: 16px;
}

.kb-ui-button--secondary {
  border-color: #b7c7d3;
  color: #22313b;
  background: #ffffff;
}

.kb-ui-button--danger {
  background: #a33d3d;
}

.kb-ui-button--full {
  width: 100%;
}

.kb-ui-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.kb-ui-button__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.52);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: kb-spin 0.8s linear infinite;
}

.kb-ui-button--secondary .kb-ui-button__spinner {
  border-color: rgba(34, 49, 59, 0.28);
  border-top-color: #22313b;
}

.kb-ui-field {
  width: min(320px, 100%);
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  color: #22313b;
}

.kb-ui-field__label {
  font-size: 13px;
  font-weight: 750;
}

.kb-ui-dropdown {
  width: 100%;
  min-height: 38px;
  border: 1px solid #b7c7d3;
  border-radius: 6px;
  padding: 0 36px 0 12px;
  color: #17212b;
  background: #ffffff;
  font: inherit;
}

.kb-ui-dropdown:disabled {
  cursor: not-allowed;
  color: #6b7782;
  background: #eef2f5;
}

.kb-ui-field__helper {
  color: #637382;
  font-size: 12px;
  line-height: 1.35;
}

.kb-segmented-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.kb-segmented-filter__label {
  color: #52636f;
  font-size: 13px;
  font-weight: 750;
}

.kb-segmented-filter__options {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.kb-segmented-filter__option {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #b7c7d3;
  border-radius: 6px;
  padding: 0 10px;
  color: #22313b;
  background: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.kb-segmented-filter__option--active {
  border-color: #1f6f8b;
  color: #ffffff;
  background: #1f6f8b;
}

.kb-segmented-filter__option:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.kb-segmented-filter__count {
  min-width: 22px;
  border-radius: 999px;
  padding: 2px 7px;
  color: #52636f;
  background: #eef2f5;
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
}

.kb-segmented-filter__option--active .kb-segmented-filter__count {
  color: #164457;
  background: #d5edf5;
}

.kb-xiangqi-viewer {
  width: min(920px, 100%);
  padding: 18px;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  background: #ffffff;
}

.kb-xiangqi-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.kb-xiangqi-eyebrow {
  margin: 0 0 4px;
  color: #5e6c76;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.kb-xiangqi-title {
  margin: 0;
  color: #1c2a33;
  font-size: 22px;
  line-height: 1.2;
}

.kb-xiangqi-controls {
  width: min(100%, 443px);
  display: grid;
  grid-template-columns: 150px minmax(0, 285px);
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.kb-xiangqi-nav-controls {
  width: 150px;
  display: grid;
  grid-template-columns: 34px 54px 34px;
  gap: 8px;
  align-items: center;
}

.kb-xiangqi-icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid #bdc8d0;
  border-radius: 6px;
  color: #20313c;
  background: #f8fafb;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.kb-xiangqi-icon-button:disabled {
  cursor: not-allowed;
  color: #9aa5ad;
  background: #edf1f3;
}

.kb-xiangqi-counter {
  min-width: 54px;
  color: #52636f;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.kb-xiangqi-analysis-controls {
  min-height: 34px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.kb-xiangqi-analysis-toggle {
  font-size: 15px;
  font-weight: 850;
}

.kb-xiangqi-analysis-toggle.is-active {
  border-color: #9366aa;
  color: #4e2168;
  background: #f5edf8;
}

.kb-xiangqi-save-button {
  font-size: 15px;
  font-weight: 850;
}

.kb-xiangqi-clear-button {
  font-size: 15px;
  font-weight: 850;
}

.kb-xiangqi-save-status {
  flex: 0 1 104px;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  color: #4c6b57;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-xiangqi-save-status[data-status="error"] {
  color: #9f2f2f;
}

.kb-xiangqi-save-status[data-status="dirty"] {
  color: #856016;
}

.kb-xiangqi-analysis-status {
  flex: 0 0 92px;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  color: #5e6c76;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-xiangqi-analysis-status[data-status="unavailable"],
.kb-xiangqi-analysis-status[data-status="error"] {
  color: #9f2f2f;
}

.kb-xiangqi-analysis-status.is-placeholder {
  visibility: hidden;
}

.kb-xiangqi-layout {
  display: grid;
  grid-template-columns: minmax(270px, 540px) minmax(220px, 1fr);
  gap: 18px;
  align-items: start;
}

.kb-xiangqi-board-column {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.kb-xiangqi-board {
  position: relative;
  display: block;
  aspect-ratio: 9 / 10;
  width: 100%;
  max-width: 540px;
  background: #ead3a6;
}

.kb-xiangqi-piece {
  filter: drop-shadow(0 2px 3px rgba(20, 30, 38, 0.18));
  pointer-events: none;
}

.kb-xiangqi-analysis-layer {
  pointer-events: none;
}

.kb-xiangqi-analysis-arrow {
  stroke: #7a3f9d;
  stroke-width: 0.12;
  stroke-linecap: round;
  opacity: 0.82;
}

.kb-xiangqi-analysis-source {
  fill: rgba(122, 63, 157, 0.08);
  stroke: rgba(122, 63, 157, 0.72);
  stroke-width: 0.06;
}

.kb-xiangqi-analysis-target {
  fill: rgba(122, 63, 157, 0.16);
  stroke: #7a3f9d;
  stroke-width: 0.08;
}

.kb-xiangqi-curve {
  min-width: 0;
}

.kb-xiangqi-curve__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.kb-xiangqi-curve__header h3 {
  margin: 0;
  color: #24313b;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
}

.kb-xiangqi-curve__header span {
  min-width: 0;
  overflow: hidden;
  color: #60717d;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-xiangqi-curve__plot {
  display: block;
  width: 100%;
  height: 96px;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  background: #fbfcfd;
}

.kb-xiangqi-curve__axis {
  stroke: #d4dde3;
  stroke-width: 1;
}

.kb-xiangqi-curve__line {
  fill: none;
  stroke: #2f7f6f;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kb-xiangqi-curve__point {
  fill: #2f7f6f;
  stroke: #ffffff;
  stroke-width: 1.4;
}

.kb-xiangqi-curve__missing {
  fill: #c4cdd4;
}

.kb-xiangqi-curve__mate {
  fill: #8e3f56;
  stroke: #ffffff;
  stroke-width: 1.2;
}

.kb-xiangqi-curve__point.is-clickable,
.kb-xiangqi-curve__missing.is-clickable,
.kb-xiangqi-curve__mate.is-clickable {
  cursor: pointer;
  outline: none;
}

.kb-xiangqi-curve__point.is-clickable:hover,
.kb-xiangqi-curve__point.is-clickable:focus,
.kb-xiangqi-curve__missing.is-clickable:hover,
.kb-xiangqi-curve__missing.is-clickable:focus,
.kb-xiangqi-curve__mate.is-clickable:hover,
.kb-xiangqi-curve__mate.is-clickable:focus {
  stroke: #1f5f92;
  stroke-width: 2;
}

.kb-xiangqi-curve__point.is-current,
.kb-xiangqi-curve__missing.is-current {
  fill: #1f5f92;
}

.kb-xiangqi-curve__mate.is-current {
  fill: #1f5f92;
}

.kb-xiangqi-curve__current-ring {
  fill: transparent;
  stroke: #1f5f92;
  stroke-width: 2;
  pointer-events: none;
}

.kb-xiangqi-piece__label {
  font-weight: 800;
  line-height: 1;
  user-select: none;
}

.kb-xiangqi-selection-layer {
  pointer-events: all;
}

.kb-xiangqi-board-point {
  fill: transparent;
  stroke: transparent;
  stroke-width: 0.04;
  pointer-events: all;
}

.kb-xiangqi-board-point.is-clickable {
  cursor: pointer;
}

.kb-xiangqi-board-point.is-current-player:hover {
  fill: rgba(31, 111, 139, 0.12);
  stroke: rgba(31, 111, 139, 0.55);
}

.kb-xiangqi-board-point.is-selected {
  fill: rgba(31, 111, 139, 0.18);
  stroke: #1f6f8b;
  stroke-width: 0.06;
}

.kb-xiangqi-board-point.is-possible {
  fill: rgba(42, 132, 91, 0.2);
  stroke: rgba(42, 132, 91, 0.75);
}

.kb-xiangqi-board-point.is-possible:hover {
  fill: rgba(42, 132, 91, 0.3);
  stroke: #2a845b;
}

.kb-xiangqi-board-point.is-setup.is-clickable:hover {
  fill: rgba(132, 96, 42, 0.16);
  stroke: rgba(132, 96, 42, 0.7);
}

.kb-xiangqi-tree-panel {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.kb-xiangqi-line-section {
  min-width: 0;
}

.kb-xiangqi-line-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.kb-xiangqi-line-section__header h3 {
  margin: 0;
  color: #24313b;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
}

.kb-xiangqi-line-section__header span {
  min-width: 28px;
  border: 1px solid #d6dee4;
  border-radius: 999px;
  padding: 2px 8px;
  color: #596974;
  background: #f8fafb;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.kb-xiangqi-moves {
  max-height: min(540px, 70vh);
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
}

.kb-xiangqi-history {
  max-height: min(350px, 46vh);
}

.kb-xiangqi-options {
  max-height: min(190px, 28vh);
}

.kb-xiangqi-empty-moves {
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  color: #647483;
  background: #fbfcfd;
  font-size: 13px;
  font-weight: 750;
}

.kb-xiangqi-setup-panel {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.kb-xiangqi-setup-section {
  min-width: 0;
}

.kb-xiangqi-setup-pieces {
  display: grid;
  grid-template-columns: repeat(4, 44px);
  gap: 8px;
}

.kb-xiangqi-setup-piece,
.kb-xiangqi-setup-tool,
.kb-xiangqi-setup-side-button {
  height: 40px;
  border: 1px solid #d2dbe2;
  border-radius: 6px;
  color: #263743;
  background: #fbfcfd;
  font-weight: 800;
  cursor: pointer;
}

.kb-xiangqi-setup-piece {
  width: 44px;
  padding: 0;
}

.kb-xiangqi-setup-piece:hover,
.kb-xiangqi-setup-piece:focus-visible,
.kb-xiangqi-setup-tool:hover,
.kb-xiangqi-setup-tool:focus-visible,
.kb-xiangqi-setup-side-button:hover,
.kb-xiangqi-setup-side-button:focus-visible {
  border-color: #9bb7c8;
  outline: none;
}

.kb-xiangqi-setup-piece.is-selected,
.kb-xiangqi-setup-tool.is-selected,
.kb-xiangqi-setup-side-button.is-selected {
  border-color: #2f7f6f;
  background: #e9f5f2;
}

.kb-xiangqi-setup-piece__disc {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: #fdf8ec;
}

.kb-xiangqi-setup-piece[data-side="red"] {
  color: #a5302b;
}

.kb-xiangqi-setup-piece[data-side="black"] {
  color: #20262b;
}

.kb-xiangqi-setup-piece[data-side="erase"] {
  color: #5b6670;
}

.kb-xiangqi-setup-piece[data-side="erase"] .kb-xiangqi-setup-piece__disc {
  background: #f6f8fa;
  border-style: dashed;
}

.kb-xiangqi-setup-piece__label {
  font-size: 16px;
  line-height: 1;
}

.kb-xiangqi-setup-tools,
.kb-xiangqi-setup-side {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kb-xiangqi-setup-tool {
  width: 44px;
  font-size: 22px;
  line-height: 1;
}

.kb-xiangqi-setup-side-button {
  min-width: 70px;
  padding: 0 12px;
  font-size: 13px;
}

.kb-xiangqi-move {
  border-bottom: 1px solid #edf0f2;
}

.kb-xiangqi-move:last-child {
  border-bottom: none;
}

.kb-xiangqi-move button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 0;
  padding: 7px 10px;
  color: #24313b;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.kb-xiangqi-move button:hover,
.kb-xiangqi-move button.is-active {
  background: #edf6f5;
}

.kb-xiangqi-option button {
  background: #fbfcfd;
}

.kb-xiangqi-move__number {
  color: #64727c;
  font-size: 12px;
  font-weight: 750;
}

.kb-xiangqi-move__label {
  overflow: hidden;
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-xiangqi-move__comment {
  margin: -2px 10px 9px 60px;
  color: #687782;
  font-size: 12px;
  line-height: 1.35;
}

.kb-xiangqi-diagnostics {
  margin: 14px 0 0;
  padding-left: 18px;
  color: #9f2f2f;
  font-size: 13px;
}

.kb-draughts-viewer {
  width: min(920px, 100%);
  padding: 18px;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  background: #ffffff;
}

.kb-draughts-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.kb-draughts-eyebrow {
  margin: 0 0 4px;
  color: #5e6c76;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.kb-draughts-title {
  margin: 0;
  color: #1c2a33;
  font-size: 22px;
  line-height: 1.2;
}

.kb-draughts-controls {
  width: min(100%, 296px);
  display: grid;
  grid-template-columns: 150px minmax(0, 138px);
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.kb-draughts-nav-controls {
  width: 150px;
  display: grid;
  grid-template-columns: 34px 54px 34px;
  gap: 8px;
  align-items: center;
}

.kb-draughts-icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid #bdc8d0;
  border-radius: 6px;
  color: #20313c;
  background: #f8fafb;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.kb-draughts-icon-button:disabled {
  cursor: not-allowed;
  color: #9aa5ad;
  background: #edf1f3;
}

.kb-draughts-counter {
  min-width: 54px;
  color: #52636f;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.kb-draughts-save-controls {
  min-height: 34px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.kb-draughts-save-button {
  font-size: 15px;
  font-weight: 850;
}

.kb-draughts-save-status {
  flex: 0 1 96px;
  min-width: 0;
  overflow: hidden;
  color: #4c6b57;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-draughts-save-status[data-status="error"] {
  color: #9f2f2f;
}

.kb-draughts-layout {
  display: grid;
  grid-template-columns: minmax(270px, 520px) minmax(220px, 1fr);
  gap: 18px;
  align-items: start;
}

.kb-draughts-board {
  position: relative;
  display: block;
  aspect-ratio: 1;
  width: 100%;
  max-width: 520px;
  background: #f2eee6;
}

.kb-draughts-square {
  stroke: #43535b;
  stroke-width: 0.015;
}

.kb-draughts-square[data-square="light"] {
  fill: #f0e9dc;
}

.kb-draughts-square[data-square="dark"] {
  fill: #537369;
}

.kb-draughts-square[data-last="from"] {
  fill: #6b8794;
}

.kb-draughts-square[data-last="to"] {
  fill: #75985c;
}

.kb-draughts-piece {
  filter: drop-shadow(0 2px 3px rgba(20, 30, 38, 0.22));
  pointer-events: none;
}

.kb-draughts-piece__disc {
  stroke-width: 0.045;
}

.kb-draughts-piece[data-side="red"] .kb-draughts-piece__disc {
  fill: #b83e3a;
  stroke: #792622;
}

.kb-draughts-piece[data-side="black"] .kb-draughts-piece__disc {
  fill: #1e252a;
  stroke: #080d10;
}

.kb-draughts-piece__inner {
  fill: transparent;
  stroke: rgba(255, 255, 255, 0.34);
  stroke-width: 0.035;
}

.kb-draughts-piece__label {
  fill: #ffffff;
  font-weight: 850;
  line-height: 1;
  user-select: none;
}

.kb-draughts-selection-layer {
  pointer-events: all;
}

.kb-draughts-board-cell {
  fill: transparent;
  stroke: transparent;
  stroke-width: 0.045;
  pointer-events: all;
}

.kb-draughts-board-cell.is-clickable {
  cursor: pointer;
}

.kb-draughts-board-cell.is-current-player:hover {
  fill: rgba(31, 111, 139, 0.14);
  stroke: rgba(31, 111, 139, 0.62);
}

.kb-draughts-board-cell.is-selected {
  fill: rgba(31, 111, 139, 0.2);
  stroke: #1f6f8b;
  stroke-width: 0.07;
}

.kb-draughts-board-cell.is-possible {
  fill: rgba(236, 177, 64, 0.34);
  stroke: rgba(91, 67, 20, 0.72);
}

.kb-draughts-board-cell.is-possible:hover {
  fill: rgba(236, 177, 64, 0.46);
  stroke: #5b4314;
}

.kb-draughts-tree-panel {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.kb-draughts-line-section {
  min-width: 0;
}

.kb-draughts-line-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.kb-draughts-line-section__header h3 {
  margin: 0;
  color: #24313b;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
}

.kb-draughts-line-section__header span {
  min-width: 28px;
  border: 1px solid #d6dee4;
  border-radius: 999px;
  padding: 2px 8px;
  color: #596974;
  background: #f8fafb;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.kb-draughts-moves {
  max-height: min(540px, 70vh);
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
}

.kb-draughts-history {
  max-height: min(350px, 46vh);
}

.kb-draughts-options {
  max-height: min(190px, 28vh);
}

.kb-draughts-empty-moves {
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  color: #647483;
  background: #fbfcfd;
  font-size: 13px;
  font-weight: 750;
}

.kb-draughts-move {
  border-bottom: 1px solid #edf0f2;
}

.kb-draughts-move:last-child {
  border-bottom: none;
}

.kb-draughts-move button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 0;
  padding: 7px 10px;
  color: #24313b;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.kb-draughts-move button:hover,
.kb-draughts-move button.is-active {
  background: #edf6f5;
}

.kb-draughts-option button {
  background: #fbfcfd;
}

.kb-draughts-move__number {
  color: #64727c;
  font-size: 12px;
  font-weight: 750;
}

.kb-draughts-move__label {
  overflow: hidden;
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-draughts-move__comment {
  margin: -2px 10px 9px 60px;
  color: #687782;
  font-size: 12px;
  line-height: 1.35;
}

.kb-draughts-diagnostics {
  margin: 14px 0 0;
  padding-left: 18px;
  color: #9f2f2f;
  font-size: 13px;
}

.kb-notion-document,
.kb-notion-slash,
.kb-notion-selection-surface {
  width: min(860px, 100%);
  color: #1c2630;
}

.kb-notion-document {
  border: 1px solid #dce3e8;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px 16px;
}

.kb-notion-block-list {
  display: grid;
  gap: 4px;
}

.kb-notion-block {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 8px 3px 0;
  background: #ffffff;
}

.kb-notion-block:hover,
.kb-notion-block.is-active {
  border-color: #d4e2ea;
  background: #f8fbfc;
}

.kb-notion-block.is-selected {
  border-color: #86b5c9;
  background: #edf6f5;
}

.kb-notion-block.has-slash-menu {
  box-shadow: inset 3px 0 0 #d4834d;
}

.kb-notion-block__handle {
  width: 28px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  color: #7b8994;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.kb-notion-block__handle:hover,
.kb-notion-block__handle:focus-visible {
  color: #1f4e65;
  background: #e8f1f4;
  outline: none;
}

.kb-notion-block__content {
  min-width: 0;
  min-height: 32px;
  padding: 3px 0;
  outline: none;
}

.kb-notion-block__content:focus-visible {
  border-radius: 5px;
  box-shadow: 0 0 0 2px rgba(31, 111, 139, 0.22);
}

.kb-notion-block__heading {
  margin: 0;
  color: #17212b;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

h1.kb-notion-block__heading {
  font-size: 28px;
}

h3.kb-notion-block__heading {
  font-size: 18px;
}

.kb-notion-block__paragraph,
.kb-notion-block__quote,
.kb-notion-block__todo,
.kb-notion-block__list-line,
.kb-notion-block__callout {
  margin: 0;
  color: #25323d;
  font-size: 15px;
  line-height: 1.55;
}

.kb-notion-block__quote {
  border-left: 3px solid #8ea3b0;
  padding-left: 12px;
  color: #4d5c67;
}

.kb-notion-block__todo,
.kb-notion-block__list-line,
.kb-notion-block__callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.kb-notion-block__todo input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2a845b;
}

.kb-notion-block__bullet,
.kb-notion-block__number,
.kb-notion-block__callout-mark {
  color: #62717d;
  font-weight: 800;
}

.kb-notion-block__callout {
  border: 1px solid #ead7c8;
  border-radius: 6px;
  padding: 10px;
  background: #fff8f2;
}

.kb-notion-block__callout-mark {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #75421f;
  background: #f2dcc7;
  font-size: 13px;
}

.kb-notion-block__code {
  margin: 0;
  overflow: auto;
  border: 1px solid #d7e0e6;
  border-radius: 6px;
  padding: 12px;
  color: #dfe8ec;
  background: #20303a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.kb-notion-block__divider {
  border: 0;
  border-top: 1px solid #dce3e8;
  margin: 12px 0;
}

.kb-notion-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  border: 1px dashed #becbd5;
  border-radius: 8px;
  color: #667681;
  background: #fbfcfd;
  text-align: center;
}

.kb-notion-empty p {
  margin: 0;
}

.kb-notion-last-choice {
  display: inline-flex;
  gap: 8px;
  margin-top: 12px;
  color: #5a6b77;
  font-size: 13px;
}

.kb-notion-last-choice strong {
  color: #1f4e65;
}

.kb-notion-mini-label {
  margin: 0 0 3px;
  color: #62717d;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.kb-notion-slash {
  border: 1px solid #dce3e8;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.kb-notion-slash__header,
.kb-notion-selection-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.kb-notion-slash__header h2,
.kb-notion-selection-bar h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.kb-notion-quiet-button {
  min-height: 34px;
  border: 1px solid #bdc8d0;
  border-radius: 6px;
  padding: 0 11px;
  color: #20313c;
  background: #f8fafb;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.kb-notion-quiet-button:disabled {
  cursor: not-allowed;
  color: #9aa5ad;
  background: #edf1f3;
}

.kb-notion-slash__query {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: #4f606b;
  font-size: 13px;
  font-weight: 750;
}

.kb-notion-slash__query input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #b7c7d3;
  border-radius: 6px;
  padding: 0 11px;
  color: #17212b;
  background: #ffffff;
  font: inherit;
}

.kb-notion-slash__query input:disabled {
  color: #7b8994;
  background: #eef2f5;
}

.kb-notion-slash__panel {
  display: grid;
  gap: 4px;
  border: 1px solid #d5dee5;
  border-radius: 8px;
  padding: 6px;
  background: #fbfcfd;
}

.kb-notion-slash__item {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  color: #21303a;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.kb-notion-slash__item:hover,
.kb-notion-slash__item.is-active {
  border-color: #c5d7df;
  background: #edf6f5;
}

.kb-notion-slash__item-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.kb-notion-slash__item-main strong {
  font-size: 14px;
}

.kb-notion-slash__item-main span {
  overflow: hidden;
  color: #647483;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-notion-slash__item kbd {
  border: 1px solid #cbd5dc;
  border-radius: 5px;
  padding: 2px 6px;
  color: #52636f;
  background: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.kb-notion-slash__empty,
.kb-notion-slash__closed {
  min-height: 88px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px dashed #c8d3da;
  border-radius: 8px;
  color: #667681;
  background: #fbfcfd;
  font-size: 14px;
  text-align: center;
}

.kb-notion-selection-surface {
  display: grid;
  gap: 12px;
}

.kb-notion-selection-bar {
  grid-template-columns: minmax(0, 1fr) auto auto;
  border: 1px solid #dce3e8;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.kb-notion-selection-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(70px, auto));
  gap: 8px;
  margin: 0;
}

.kb-notion-selection-meta div {
  border: 1px solid #dde5ea;
  border-radius: 6px;
  padding: 6px 8px;
  background: #fbfcfd;
}

.kb-notion-selection-meta dt {
  margin: 0 0 2px;
  color: #667681;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.kb-notion-selection-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #20313c;
  font-size: 13px;
  font-weight: 750;
}

@keyframes kb-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 680px) {
  .kb-shell {
    padding: 0;
    place-items: stretch;
  }

  .kb-panel {
    padding: 18px;
  }

  .kb-header {
    flex-direction: column;
  }

  h1 {
    font-size: 26px;
  }

  .runtime-grid {
    grid-template-columns: 1fr;
  }

  .query-arg-form,
  .query-stat-grid,
  .query-item-grid,
  .query-diagnostic,
  .kb-search-box,
  .kb-search-result__snippet,
  .blog-article__layout,
  .xiangqi-page-grid,
  .xiangqi-example-meta,
  .xiangqi-game-tree-meta,
  .draughts-page-grid,
  .draughts-example-meta,
  .draughts-game-tree-meta,
  .voice-page-grid,
  .voice-line-meta,
  .kb-voice-line__meta {
    grid-template-columns: 1fr;
  }

  .xiangqi-page-actions {
    justify-content: flex-start;
  }

  .draughts-page-actions {
    justify-content: flex-start;
  }

  .xiangqi-example-list,
  .xiangqi-game-tree-list,
  .draughts-example-list,
  .draughts-game-tree-list {
    max-height: 300px;
  }

  .voice-line-list {
    max-height: 300px;
  }

  .kb-xiangqi-viewer {
    padding: 12px;
  }

  .kb-draughts-viewer {
    padding: 12px;
  }

  .kb-voice-line {
    padding: 12px;
  }

  .kb-voice-line__header {
    flex-direction: column;
  }

  .kb-xiangqi-header {
    flex-direction: column;
  }

  .kb-draughts-header {
    flex-direction: column;
  }

  .kb-xiangqi-controls {
    width: 100%;
    grid-template-columns: 150px minmax(0, 1fr);
    justify-content: start;
  }

  .kb-draughts-controls {
    width: 100%;
    grid-template-columns: 150px minmax(0, 1fr);
    justify-content: start;
  }

  .kb-xiangqi-layout {
    grid-template-columns: 1fr;
  }

  .kb-draughts-layout {
    grid-template-columns: 1fr;
  }

  .kb-game-tree-canvas__body {
    grid-template-columns: 1fr;
  }

  .kb-game-tree-canvas__surface {
    min-height: 520px;
  }

  .kb-game-tree-canvas__toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .kb-xiangqi-moves {
    max-height: 260px;
  }

  .kb-draughts-moves {
    max-height: 260px;
  }

  .kb-xiangqi-history {
    max-height: 190px;
  }

  .kb-draughts-history {
    max-height: 190px;
  }

  .kb-xiangqi-options {
    max-height: 150px;
  }

  .kb-draughts-options {
    max-height: 150px;
  }

  .kb-notion-document,
  .kb-notion-slash,
  .kb-notion-selection-surface {
    width: 100%;
  }

  .kb-notion-document,
  .kb-notion-slash {
    padding: 12px;
  }

  .kb-notion-block {
    grid-template-columns: 28px minmax(0, 1fr);
    padding-right: 6px;
  }

  .kb-notion-block__heading,
  h1.kb-notion-block__heading {
    font-size: 20px;
  }

  .kb-notion-slash__header,
  .kb-notion-selection-bar {
    grid-template-columns: 1fr;
  }

  .kb-notion-selection-meta {
    grid-template-columns: 1fr;
  }

  .kb-search-box__button {
    width: 100%;
  }

  .blog-article__header h1 {
    font-size: 28px;
  }

  .blog-article__toc {
    position: static;
    max-height: none;
  }
}

.kb-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.danger-button {
  border-color: #d7aaa5;
  background: #fff1ef;
  color: #8f2d27;
}

.note-surface,
.markdown-body {
  min-width: 0;
}

.markdown-body {
  display: grid;
  gap: 9px;
  color: #17212b;
  line-height: 1.58;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6,
.roadmap-detail h2,
.bookshelf-column h2 {
  margin: 0;
  letter-spacing: 0;
}

.markdown-body h1 {
  font-size: 28px;
}

.markdown-body h2,
.roadmap-detail h2,
.bookshelf-column h2 {
  font-size: 20px;
}

.markdown-body p {
  margin: 0;
}

.math-inline {
  display: inline;
}

.math-block {
  max-width: 100%;
  overflow-x: auto;
  padding: 2px 0;
}

.math-block mjx-container,
.math-block mjx-container[jax="SVG"] {
  margin: 0;
}

.markdown-body blockquote {
  margin: 0;
  border-left: 3px solid #8aa9b7;
  padding: 6px 0 6px 12px;
  color: #4f6170;
  background: #f8fbfc;
}

.md-blank {
  min-height: 8px;
}

.md-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 0 1.1em;
  border-radius: 6px;
}

.md-code {
  max-width: 100%;
  overflow: auto;
  border: 1px solid #dce4e9;
  border-radius: 6px;
  padding: 10px;
  background: #f7f9fa;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.md-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #dce4e9;
  border-radius: 6px;
  overflow: hidden;
  font-size: 14px;
  background: #ffffff;
}

.md-table th,
.md-table td {
  border-bottom: 1px solid #dce4e9;
  border-right: 1px solid #dce4e9;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.md-table th {
  background: #f7f9fa;
  color: #35495a;
  font-weight: 700;
}

.md-table th:last-child,
.md-table td:last-child {
  border-right: 0;
}

.md-table tbody tr:last-child td {
  border-bottom: 0;
}

.md-list {
  margin: 0;
  padding-left: 22px;
}

.md-task {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.wikilink {
  color: #176b83;
  font-weight: 700;
}

.wikilink--missing,
.wikilink--ambiguous {
  color: #9a5b22;
  text-decoration: underline dotted;
}

.note-render-stack {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.note-render-toolbar {
  display: flex;
  justify-content: flex-end;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #dce4e9;
  border-radius: 6px;
  padding: 10px;
  background: #ffffff;
}

.task-check-button {
  min-height: 34px;
  border: 1px solid #aac2ce;
  border-radius: 6px;
  background: #eff7fa;
  color: #164457;
  font-weight: 800;
}

.task-row__text {
  min-width: 0;
  min-height: 38px;
  border: 1px solid #b8c8d2;
  border-radius: 6px;
  padding: 0 10px;
  color: #17212b;
}

.task-row__actions {
  display: flex;
  gap: 8px;
}

.task-row__source {
  grid-column: 2 / -1;
  color: #5a6c79;
  font-size: 12px;
  text-decoration: none;
}

.zotero-curation {
  display: grid;
  gap: 18px;
  border: 1px solid #c9d6de;
  border-radius: 8px;
  padding: clamp(18px, 3vw, 30px);
  background: #f7fafb;
}

.zotero-curation__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.zotero-curation__header h2,
.zotero-curation__header p {
  margin: 0;
}

.zotero-curation__header p {
  margin-top: 4px;
  color: #637382;
  font-size: 13px;
}

.zotero-curation__header > span {
  flex: none;
  color: #2c7188;
  font-size: 12px;
  font-weight: 850;
}

.zotero-candidate {
  display: grid;
  gap: 10px;
  min-width: 0;
  border-top: 1px solid #dce5ea;
  padding-top: 18px;
}

.zotero-candidate__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #567181;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.zotero-candidate h3 {
  max-width: 72ch;
  margin: 0;
  overflow-wrap: anywhere;
  color: #17212b;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.25;
}

.zotero-candidate > p,
.zotero-curation__complete {
  margin: 0;
  color: #637382;
  line-height: 1.55;
}

.zotero-candidate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.zotero-candidate__actions .refresh-button {
  min-width: 96px;
}

.bookshelf-grid {
  display: grid;
  gap: 30px;
}

.bookshelf-column,
.roadmap-list,
.roadmap-graph,
.roadmap-detail {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.bookshelf-column__header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 4px;
}

.bookshelf-column__header h2 {
  margin: 0;
}

.bookshelf-column__header span {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #e8eef1;
  color: #536775;
  font-size: 12px;
  font-weight: 800;
}

.bookshelf-column__shelf {
  min-height: 150px;
  padding: 22px 20px 28px;
  border: 1px solid #d8c6a8;
  border-bottom: 12px solid #9a6541;
  border-radius: 8px 8px 3px 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(249, 243, 232, 0.92)),
    #f7efe2;
  box-shadow: 0 7px 0 #75482f, 0 13px 20px rgba(65, 45, 30, 0.12);
}

.bookshelf-column__items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 210px));
  gap: 24px 18px;
  align-items: start;
  justify-content: start;
}

.bookshelf-item {
  display: grid;
  grid-template-rows: auto 76px auto;
  align-items: start;
  gap: 11px;
  min-width: 0;
}

.bookshelf-item__cover {
  position: relative;
  display: block;
  width: min(100%, 158px);
  aspect-ratio: 2 / 3;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 3px 7px 7px 3px;
  background: #24495d;
  color: #ffffff;
  text-decoration: none;
  box-shadow: -5px 5px 0 #d2c1a5, 0 10px 20px rgba(45, 34, 24, 0.22);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.bookshelf-item__cover:hover,
.bookshelf-item__cover:focus-visible {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: -5px 8px 0 #d2c1a5, 0 14px 24px rgba(45, 34, 24, 0.26);
}

.bookshelf-item__cover-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  padding: 20px 16px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 9%),
    linear-gradient(145deg, #315e72, #173746);
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.bookshelf-item__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bookshelf-item__details {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  height: 76px;
  overflow: hidden;
}

.bookshelf-item__title {
  display: -webkit-box;
  overflow: hidden;
  color: #17212b;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.bookshelf-item__title:hover {
  color: #28617f;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bookshelf-item__authors {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #637382;
  font-size: 13px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.book-progress-editor {
  display: grid;
  gap: 9px;
  padding-top: 2px;
}

.book-progress-editor progress,
.book-progress-editor__track-placeholder {
  width: 100%;
  height: 7px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: #dce4e8;
}

.book-progress-editor progress {
  accent-color: #2c6a86;
}

.book-progress-editor__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.book-progress-editor label {
  display: grid;
  gap: 4px;
  color: #637382;
  font-size: 11px;
  font-weight: 750;
}

.book-progress-editor input {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  border: 1px solid #b8c8d2;
  border-radius: 6px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.9);
}

.book-progress-editor .refresh-button {
  width: 100%;
  min-height: 36px;
}

.roadmap-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) minmax(260px, 340px);
  gap: 16px;
  align-items: start;
}

.roadmap-list a {
  border: 1px solid #dce4e9;
  border-radius: 6px;
  padding: 8px 10px;
  color: #314656;
  text-decoration: none;
}

.roadmap-list a.is-active {
  border-color: #9bb7c8;
  background: #e7f2f8;
  color: #12384f;
  font-weight: 800;
}

.roadmap-level {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #e5ecef;
  padding-bottom: 10px;
}

.roadmap-level__label {
  flex-basis: 100%;
  color: #647483;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.roadmap-node {
  display: grid;
  gap: 3px;
  min-width: 148px;
  max-width: 210px;
  min-height: 62px;
  border: 1px solid #b8c8d2;
  border-radius: 6px;
  padding: 8px 10px;
  background: #ffffff;
  color: #17212b;
  text-align: left;
  cursor: pointer;
}

.roadmap-node.is-selected {
  border-color: #2d7890;
  box-shadow: 0 0 0 2px rgba(45, 120, 144, 0.16);
}

.roadmap-node span {
  font-weight: 800;
}

.roadmap-node small {
  color: #667987;
}

.roadmap-detail {
  border: 1px solid #dce4e9;
  border-radius: 6px;
  padding: 12px;
  background: #fbfcfd;
}

.attention-page {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.attention-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.attention-stat {
  display: grid;
  gap: 4px;
  min-height: 76px;
  border: 1px solid #dce4e9;
  border-radius: 6px;
  padding: 12px;
  background: #fbfcfd;
}

.attention-stat__label {
  color: #667987;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.attention-stat strong {
  color: #17212b;
  font-size: 26px;
  line-height: 1;
}

.attention-stat small {
  color: #667987;
}

.attention-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.attention-main,
.attention-feed,
.attention-meter-stack,
.attention-relation-stack {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.attention-visual-panel,
.attention-inspector,
.attention-empty {
  border: 1px solid #dce4e9;
  border-radius: 6px;
  padding: 14px;
  background: #fbfcfd;
}

.attention-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.attention-section-header h2,
.attention-inspector h2,
.attention-edge-list h3,
.attention-feedback-list h3,
.attention-blocked-panel h3 {
  margin: 0;
  color: #17212b;
}

.attention-section-header h2 {
  font-size: 18px;
}

.attention-section-header p,
.attention-inspector header p {
  margin: 4px 0 0;
  color: #5b6b7a;
  line-height: 1.45;
}

.attention-matrix {
  position: relative;
  height: 260px;
  min-height: 260px;
  border: 1px solid #cfd9df;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(197, 209, 216, 0.42) 1px, transparent 1px),
    linear-gradient(0deg, rgba(197, 209, 216, 0.42) 1px, transparent 1px),
    #ffffff;
  background-size: 25% 100%, 100% 25%, auto;
  overflow: hidden;
}

.attention-matrix__axis {
  position: absolute;
  color: #617281;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  pointer-events: none;
}

.attention-matrix__axis--y {
  top: 10px;
  left: 10px;
}

.attention-matrix__axis--x {
  right: 10px;
  bottom: 8px;
}

.attention-matrix__point {
  position: absolute;
  width: 28px;
  height: 28px;
  transform: translate(-50%, 50%);
  border: 2px solid #ffffff;
  border-radius: 50%;
  color: #17212b;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(23, 33, 43, 0.18);
  cursor: pointer;
}

.attention-matrix__point.is-selected {
  outline: 3px solid rgba(23, 33, 43, 0.24);
  outline-offset: 2px;
}

.attention-bucket--active {
  --attention-color: #4fb3a3;
  --attention-bg: #edf8f6;
  --attention-border: #88d2c8;
}

.attention-bucket--clarify {
  --attention-color: #d7a334;
  --attention-bg: #fff7df;
  --attention-border: #e7c66d;
}

.attention-bucket--blocked {
  --attention-color: #db6a57;
  --attention-bg: #fff0ed;
  --attention-border: #eca092;
}

.attention-bucket--incubating {
  --attention-color: #8e7bd8;
  --attention-bg: #f4f1ff;
  --attention-border: #b9adeb;
}

.attention-bucket--maintenance {
  --attention-color: #6c9b4e;
  --attention-bg: #f1f8eb;
  --attention-border: #a9cd91;
}

.attention-matrix__point,
.attention-bucket-label {
  background: var(--attention-color, #9bb7c8);
}

.attention-item-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--attention-border, #dce4e9);
  border-left-width: 5px;
  border-radius: 6px;
  padding: 12px;
  background: #ffffff;
  cursor: pointer;
}

.attention-item-card:hover,
.attention-item-card:focus-visible,
.attention-item-card.is-selected {
  border-color: var(--attention-color, #2d7890);
  box-shadow: 0 0 0 2px rgba(45, 120, 144, 0.14);
  outline: none;
}

.attention-item-card__header {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
}

.attention-item-card h2 {
  margin: 0;
  color: #17212b;
  font-size: 17px;
  line-height: 1.25;
}

.attention-item-card__body {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #4f6170;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.attention-item-card__meta,
.attention-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.attention-item-card__meta span,
.attention-chip,
.attention-badge,
.attention-bucket-label {
  min-height: 24px;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.attention-item-card__meta span,
.attention-chip,
.attention-badge {
  background: #edf2f5;
  color: #425462;
}

.attention-bucket-label {
  color: #ffffff;
}

.attention-blocked,
.attention-blocked-panel {
  border: 1px solid #eca092;
  border-radius: 6px;
  padding: 10px;
  background: #fff0ed;
  color: #7e3024;
}

.attention-blocked {
  margin: 0;
}

.attention-inspector {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 14px;
}

.attention-inspector header {
  display: grid;
  gap: 8px;
}

.attention-meter {
  display: grid;
  gap: 5px;
}

.attention-slider {
  display: grid;
  gap: 7px;
}

.attention-slider__label {
  display: flex;
  justify-content: space-between;
  color: #536575;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.attention-slider input[type="range"] {
  width: 100%;
  min-width: 0;
  accent-color: #2c7188;
}

.attention-state-control {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.attention-state-select {
  width: 100%;
  min-width: 0;
  border: 1px solid #cfd9df;
  border-radius: 6px;
  padding: 5px 8px;
  background: #ffffff;
  color: #17212b;
  font: inherit;
}

.attention-save-status {
  margin: 0;
  color: #536575;
  font-size: 12px;
  font-weight: 700;
}

.attention-save-status.is-error {
  color: #b44343;
}

.attention-meter__label {
  display: flex;
  justify-content: space-between;
  color: #536575;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.attention-meter__track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1e8ed;
}

.attention-meter__track span {
  display: block;
  height: 100%;
}

.attention-meter__fill--priority {
  background: #d7a334;
}

.attention-meter__fill--maturity {
  background: #4fb3a3;
}

.attention-detail-grid {
  display: grid;
  grid-template-columns: minmax(100px, auto) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.attention-detail-grid dt {
  color: #667987;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.attention-detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #17212b;
  font-size: 13px;
}

.attention-edge-list {
  display: grid;
  gap: 8px;
}

.attention-edge-list ul,
.attention-feedback-list ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attention-edge-row,
.attention-relation {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid #e0e6eb;
  border-radius: 6px;
  padding: 9px;
  background: #ffffff;
}

.attention-edge-row {
  grid-template-columns: minmax(80px, auto) minmax(0, 1fr) auto;
  align-items: center;
}

.attention-edge-row__relation,
.attention-relation__label {
  color: #12384f;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.attention-edge-row__title,
.attention-relation__node {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #17212b;
  font-weight: 750;
}

.attention-edge-row__confidence {
  color: #667987;
  font-size: 12px;
  font-weight: 800;
}

.attention-feedback-list {
  display: grid;
  gap: 8px;
}

.attention-feedback-list li {
  display: grid;
  gap: 4px;
  border-top: 1px solid #e0e6eb;
  padding-top: 8px;
}

.attention-feedback-list time {
  color: #667987;
  font-size: 12px;
  font-weight: 800;
}

.attention-feedback-list p {
  margin: 0;
  color: #394c5b;
  line-height: 1.45;
}

.attention-feedback-list code {
  overflow-wrap: anywhere;
  color: #314656;
  font-size: 12px;
}

.attention-relation {
  grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr) 80px;
  align-items: center;
}

.attention-relation__label {
  justify-self: center;
  border: 1px solid #cfd9df;
  border-radius: 6px;
  padding: 4px 8px;
  background: #edf2f5;
}

.attention-relation small {
  color: #667987;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.blog-article__layout:has(.kb-bitboard) {
  grid-template-columns: minmax(0, 1120px) minmax(220px, 280px);
}

.blog-article__layout:has(.kb-bitboard-move) {
  grid-template-columns: minmax(0, 1120px) minmax(220px, 280px);
}

.blog-article__layout:has(.kb-bitboard-capture) {
  grid-template-columns: minmax(0, 1120px) minmax(220px, 280px);
}

.blog-article__layout:has(.kb-mcts-tree) {
  grid-template-columns: minmax(0, 1120px) minmax(220px, 280px);
}

.blog-article__body:has(.kb-bitboard) {
  max-width: none;
}

.blog-article__body:has(.kb-bitboard-move) {
  max-width: none;
}

.blog-article__body:has(.kb-bitboard-capture) {
  max-width: none;
}

.blog-article__body:has(.kb-mcts-tree) {
  max-width: none;
}

.kb-bitboard {
  width: min(100%, 1120px);
  display: grid;
  gap: 16px;
  border: 1px solid #d8e1e7;
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfd;
  box-shadow: 0 12px 28px rgba(39, 54, 66, 0.08);
}

.kb-bitboard-move {
  width: min(100%, 1120px);
  display: grid;
  gap: 16px;
  border: 1px solid #d8e1e7;
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfd;
  box-shadow: 0 12px 28px rgba(39, 54, 66, 0.08);
}

.kb-bitboard-capture {
  width: min(100%, 1120px);
  display: grid;
  gap: 16px;
  border: 1px solid #d8e1e7;
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfd;
  box-shadow: 0 12px 28px rgba(39, 54, 66, 0.08);
}

.kb-bitboard__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.kb-bitboard__eyebrow {
  margin: 0 0 4px;
  color: #667987;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.kb-bitboard__header h2 {
  margin: 0;
  color: #1f2d36;
  font-size: 22px;
  line-height: 1.2;
}

.kb-bitboard__kind {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #d9e2e8;
  border-radius: 999px;
  padding: 5px 9px;
  background: #ffffff;
  color: #425564;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.kb-bitboard__kind-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #1f6f8b;
  box-shadow: 0 0 0 2px rgba(31, 111, 139, 0.14);
}

.kb-bitboard[data-kind="black"] .kb-bitboard__kind-dot {
  background: #1e252a;
  box-shadow: 0 0 0 2px rgba(30, 37, 42, 0.15);
}

.kb-bitboard[data-kind="white"] .kb-bitboard__kind-dot {
  background: #f8faf8;
  box-shadow: 0 0 0 1px #8795a0, 0 0 0 3px rgba(135, 149, 160, 0.12);
}

.kb-bitboard[data-kind="king"] .kb-bitboard__kind-dot {
  background: #d6a23d;
  box-shadow: 0 0 0 2px rgba(214, 162, 61, 0.18);
}

.kb-bitboard-move[data-source-kind="white-pawn"] .kb-bitboard__kind-dot {
  background: #f8faf8;
  box-shadow: 0 0 0 1px #8795a0, 0 0 0 3px rgba(135, 149, 160, 0.12);
}

.kb-bitboard-move[data-source-kind="black-pawn"] .kb-bitboard__kind-dot {
  background: #1e252a;
  box-shadow: 0 0 0 2px rgba(30, 37, 42, 0.15);
}

.kb-bitboard__layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(560px, 1fr);
  gap: 16px;
  align-items: start;
}

.kb-bitboard-board {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  border-radius: 8px;
  background: #21313a;
}

.kb-bitboard-square {
  stroke: #344d58;
  stroke-width: 0.018;
}

.kb-bitboard-square[data-square="light"] {
  fill: #edf2ec;
}

.kb-bitboard-square[data-square="dark"] {
  fill: #557468;
}

.kb-bitboard-square-node {
  cursor: default;
}

.kb-bitboard-square-node.is-hovered .kb-bitboard-square {
  stroke: #1f6f8b;
  stroke-width: 0.055;
}

.kb-bitboard-square__coord {
  fill: rgba(20, 31, 38, 0.72);
  font-size: 0.19px;
  font-weight: 850;
  pointer-events: none;
}

.kb-bitboard-square[data-square="dark"] ~ .kb-bitboard-square__coord {
  fill: rgba(255, 255, 255, 0.86);
}

.kb-bitboard-piece {
  filter: drop-shadow(0 2px 3px rgba(21, 31, 39, 0.24));
  pointer-events: none;
}

.kb-bitboard-piece__disc {
  fill: #1f6f8b;
  stroke: #12485c;
  stroke-width: 0.045;
}

.kb-bitboard[data-kind="black"] .kb-bitboard-piece__disc {
  fill: #1e252a;
  stroke: #080d10;
}

.kb-bitboard[data-kind="white"] .kb-bitboard-piece__disc {
  fill: #f8faf8;
  stroke: #5f6f78;
}

.kb-bitboard[data-kind="king"] .kb-bitboard-piece__disc {
  fill: #d6a23d;
  stroke: #7c5617;
}

.kb-bitboard__bits {
  min-width: 0;
  display: grid;
  gap: 12px;
  overflow-x: auto;
}

.kb-bitboard-bit-grid {
  min-width: 560px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
}

.kb-bitboard-bit {
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(2.4ch, 1fr) 22px;
  align-items: center;
  gap: 5px;
  border: 1px solid #d9e2e8;
  border-radius: 6px;
  padding: 5px 6px;
  background: #ffffff;
  color: #293a46;
  outline: none;
}

.kb-bitboard-bit.is-active {
  border-color: #7ab2c0;
  background: #eef9fb;
}

.kb-bitboard-bit.is-hovered,
.kb-bitboard-bit:focus-visible {
  border-color: #1f6f8b;
  box-shadow: 0 0 0 2px rgba(31, 111, 139, 0.18);
}

.kb-bitboard-bit__index {
  min-width: 2.4ch;
  overflow: visible;
  color: #253642;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.kb-bitboard-bit__value {
  grid-column: 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #edf2f5;
  color: #506473;
  font-size: 12px;
  font-weight: 900;
}

.kb-bitboard-bit.is-active .kb-bitboard-bit__value {
  background: #1f6f8b;
  color: #ffffff;
}

.kb-bitboard[data-kind="black"] .kb-bitboard-bit.is-active {
  border-color: #9ea9b0;
  background: #f0f3f5;
}

.kb-bitboard[data-kind="black"] .kb-bitboard-bit.is-active .kb-bitboard-bit__value {
  background: #1e252a;
  color: #ffffff;
}

.kb-bitboard[data-kind="white"] .kb-bitboard-bit.is-active {
  border-color: #b8c2c8;
  background: #f8faf8;
}

.kb-bitboard[data-kind="white"] .kb-bitboard-bit.is-active .kb-bitboard-bit__value {
  background: #ffffff;
  color: #1f2d36;
  box-shadow: inset 0 0 0 1px #8795a0;
}

.kb-bitboard[data-kind="king"] .kb-bitboard-bit.is-active {
  border-color: #d5b064;
  background: #fff8e7;
}

.kb-bitboard[data-kind="king"] .kb-bitboard-bit.is-active .kb-bitboard-bit__value {
  background: #d6a23d;
  color: #1f2d36;
}

.kb-bitboard-move__layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(260px, 1fr);
  gap: 16px;
  align-items: start;
}

.kb-bitboard-move-board {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  border-radius: 8px;
  background: #21313a;
}

.kb-bitboard-move-square-node.is-source-active .kb-bitboard-square,
.kb-bitboard-move-square-node.is-target-active .kb-bitboard-square {
  stroke: #1f6f8b;
  stroke-width: 0.055;
}

.kb-bitboard-move-lines {
  pointer-events: none;
}

.kb-bitboard-move-line {
  stroke: #1f6f8b;
  stroke-linecap: round;
  stroke-width: 0.045;
  opacity: 0.82;
}

.kb-bitboard-move-line[data-overlay="ne-target"],
.kb-bitboard-move-line[data-overlay="se-target"] {
  stroke: #377a54;
}

.kb-bitboard-move-source,
.kb-bitboard-move-target {
  cursor: default;
}

.kb-bitboard-move-source__disc {
  fill: #f8faf8;
  stroke: #5f6f78;
  stroke-width: 0.045;
  filter: drop-shadow(0 2px 3px rgba(21, 31, 39, 0.24));
}

.kb-bitboard-move-source[data-kind="black-pawn"] .kb-bitboard-move-source__disc {
  fill: #1e252a;
  stroke: #080d10;
}

.kb-bitboard-move-source.is-active .kb-bitboard-move-source__disc {
  stroke: #1f6f8b;
  stroke-width: 0.07;
}

.kb-bitboard-move-target__ring {
  fill: none;
  stroke: #1f6f8b;
  stroke-width: 0.055;
}

.kb-bitboard-move-target__ring[data-overlay="ne-target"],
.kb-bitboard-move-target__ring[data-overlay="se-target"] {
  stroke: #377a54;
}

.kb-bitboard-move-target__dot {
  fill: #ffffff;
  stroke: #1f6f8b;
  stroke-width: 0.035;
}

.kb-bitboard-move-target.has-multiple .kb-bitboard-move-target__dot {
  fill: #f7fbf9;
}

.kb-bitboard-move-target.is-active .kb-bitboard-move-target__ring,
.kb-bitboard-move-target.is-active .kb-bitboard-move-target__dot {
  stroke-width: 0.075;
}

.kb-bitboard-move-target__count {
  fill: #1f2d36;
  font-size: 0.18px;
  font-weight: 900;
  pointer-events: none;
}

.kb-bitboard-move__panel {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.kb-bitboard-move__summary,
.kb-bitboard-move__legend-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #d9e2e8;
  border-radius: 6px;
  padding: 9px 10px;
  background: #ffffff;
  color: #293a46;
}

.kb-bitboard-move__legend {
  display: grid;
  gap: 8px;
}

.kb-bitboard-move__swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #1f6f8b;
}

.kb-bitboard-move__swatch[data-kind="white-pawn"] {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #8795a0;
}

.kb-bitboard-move__swatch[data-kind="black-pawn"] {
  background: #1e252a;
}

.kb-bitboard-move__swatch[data-kind="target"] {
  background: #f7fbf9;
  box-shadow: inset 0 0 0 2px #1f6f8b;
}

.kb-bitboard-move__legend-item[data-overlay="ne-target"] .kb-bitboard-move__swatch,
.kb-bitboard-move__legend-item[data-overlay="se-target"] .kb-bitboard-move__swatch {
  background: #377a54;
}

.kb-bitboard-move__summary-label {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-bitboard-move__count {
  border-radius: 999px;
  padding: 2px 7px;
  background: #edf2f5;
  color: #425564;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.kb-bitboard-move__shift {
  grid-column: 2 / 4;
  color: #667987;
  font-size: 12px;
  font-weight: 750;
}

.kb-bitboard-capture__layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(260px, 1fr);
  gap: 16px;
  align-items: start;
}

.kb-bitboard-capture-board {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  border-radius: 8px;
  background: #21313a;
}

.kb-bitboard-capture-square-node.is-active .kb-bitboard-square {
  stroke: #1f6f8b;
  stroke-width: 0.055;
}

.kb-bitboard-capture-lines {
  pointer-events: none;
}

.kb-bitboard-capture-markers {
  pointer-events: none;
}

.kb-bitboard-capture-line {
  stroke: #d6a23d;
  stroke-linecap: round;
  stroke-width: 0.045;
  opacity: 0.72;
  pointer-events: none;
}

.kb-bitboard-capture-line.is-active {
  stroke-width: 0.065;
  opacity: 0.95;
}

.kb-bitboard-capture-marker {
  cursor: default;
  pointer-events: auto;
}

.kb-bitboard-capture-marker__disc {
  stroke-width: 0.045;
  filter: drop-shadow(0 2px 3px rgba(21, 31, 39, 0.24));
}

.kb-bitboard-capture-marker.is-source .kb-bitboard-capture-marker__disc {
  fill: #f8faf8;
  stroke: #5f6f78;
}

.kb-bitboard-capture-marker.is-enemy .kb-bitboard-capture-marker__disc {
  fill: #1e252a;
  stroke: #080d10;
}

.kb-bitboard-capture-marker.is-active .kb-bitboard-capture-marker__disc {
  stroke: #1f6f8b;
  stroke-width: 0.07;
}

.kb-bitboard-capture-marker__ring {
  fill: none;
  stroke: #d6a23d;
  stroke-width: 0.065;
}

.kb-bitboard-capture-marker__dot {
  fill: #fff8e7;
  stroke: #7c5617;
  stroke-width: 0.035;
}

.kb-bitboard-capture-marker.is-active .kb-bitboard-capture-marker__ring,
.kb-bitboard-capture-marker.is-active .kb-bitboard-capture-marker__dot {
  stroke: #1f6f8b;
}

.kb-bitboard-capture-marker__order {
  fill: #1f2d36;
  font-size: 0.17px;
  font-weight: 900;
  pointer-events: none;
}

.kb-bitboard-capture-marker.is-enemy .kb-bitboard-capture-marker__order {
  fill: #ffffff;
}

.kb-bitboard-capture__panel {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.kb-bitboard-capture__step {
  min-width: 0;
  display: grid;
  gap: 8px;
  border: 1px solid #d9e2e8;
  border-radius: 6px;
  padding: 10px;
  background: #ffffff;
}

.kb-bitboard-capture__step-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #293a46;
  font-size: 13px;
  font-weight: 900;
}

.kb-bitboard-capture__direction {
  border-radius: 999px;
  padding: 2px 7px;
  background: #edf2f5;
  color: #425564;
  font-size: 12px;
  font-weight: 900;
}

.kb-bitboard-capture__legend-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  padding: 7px 8px;
  background: #f7fafb;
  color: #293a46;
}

.kb-bitboard-capture__swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d6a23d;
}

.kb-bitboard-capture__legend-item[data-role="source"] .kb-bitboard-capture__swatch {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #8795a0;
}

.kb-bitboard-capture__legend-item[data-role="enemy"] .kb-bitboard-capture__swatch {
  background: #1e252a;
}

.kb-bitboard-capture__legend-item[data-role="landing"] .kb-bitboard-capture__swatch {
  background: #fff8e7;
  box-shadow: inset 0 0 0 2px #d6a23d;
}

.kb-markdown-component-error {
  display: grid;
  gap: 8px;
  border: 1px solid #e0b8b8;
  border-radius: 8px;
  padding: 12px;
  background: #fff7f7;
}

.kb-markdown-component-error p {
  margin: 0;
  color: #8f2c2c;
  font-weight: 800;
}

.kb-markdown-component-error pre {
  margin: 0;
  white-space: pre-wrap;
}

.codex-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.codex-stat {
  display: grid;
  gap: 4px;
  border: 1px solid #d9e1e6;
  border-radius: 8px;
  padding: 12px;
  background: #f7fafb;
}

.codex-stat__label {
  color: #586773;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.codex-stat__value {
  color: #16232c;
  font-size: 1.1rem;
}

.codex-page-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.45fr);
  gap: 16px;
  align-items: start;
}

.codex-thread-tree {
  display: grid;
  gap: 6px;
  max-height: 72vh;
  overflow: auto;
  padding-right: 4px;
}

.codex-thread-node {
  --codex-indent: calc(var(--codex-depth, 0) * 18px);
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  min-height: 56px;
  border: 1px solid #d9e1e6;
  border-radius: 8px;
  padding: 8px 10px 8px calc(10px + var(--codex-indent));
  background: #ffffff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.codex-thread-node:hover,
.codex-thread-node[data-selected="true"] {
  border-color: #6e8797;
  background: #f3f8fa;
}

.codex-thread-node__rail {
  width: 4px;
  border-radius: 999px;
  background: #8aa0ad;
}

.codex-thread-node[data-edge-status="open"] .codex-thread-node__rail {
  background: #2f9d73;
}

.codex-thread-node[data-edge-status="closed"] .codex-thread-node__rail {
  background: #a2adb5;
}

.codex-thread-node__body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.codex-thread-node__title {
  overflow: hidden;
  color: #16232c;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-thread-node__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #586773;
  font-size: 0.78rem;
}

.codex-thread-node__meta span {
  border-radius: 999px;
  padding: 2px 7px;
  background: #edf3f5;
}

.codex-thread-detail {
  min-width: 0;
}

.codex-thread-detail__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.codex-thread-detail__header h2 {
  margin: 0;
  color: #16232c;
  font-size: 1.25rem;
}

.codex-thread-detail__tokens {
  display: grid;
  justify-items: end;
  min-width: 96px;
  color: #586773;
}

.codex-thread-detail__tokens strong {
  color: #16232c;
  font-size: 1.4rem;
}

.codex-thread-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.codex-thread-facts dd {
  overflow-wrap: anywhere;
}

.codex-fork-graph {
  min-width: 0;
  border: 1px solid #d9e1e6;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.codex-fork-graph__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.codex-fork-graph__header h3 {
  margin: 0;
  color: #16232c;
  font-size: 1rem;
}

.codex-fork-graph__counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
  color: #586773;
  font-size: 0.78rem;
  font-weight: 700;
}

.codex-fork-graph__counts span {
  border: 1px solid #d9e1e6;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f7fafb;
}

.codex-fork-stage {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 320px;
  max-height: 72vh;
  overflow: auto;
  border: 1px solid #d9e1e6;
  border-radius: 8px;
  padding: 16px;
  background: #f7fafb;
}

.codex-fork-stage__connector {
  display: block;
  width: 2px;
  height: 18px;
  border-radius: 999px;
  background: #9aaab3;
}

.codex-fork-ancestors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.codex-fork-ancestor-step {
  display: flex;
  align-items: center;
  gap: 10px;
}

.codex-fork-ancestor-step__line {
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: #9aaab3;
}

.codex-fork-focus {
  display: grid;
  justify-items: center;
  width: 100%;
}

.codex-fork-node {
  display: grid;
  gap: 7px;
  width: min(320px, 100%);
  min-width: min(220px, 100%);
  min-height: 104px;
  border: 1px solid #c8d5dc;
  border-left: 5px solid #6e8797;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(22, 35, 44, 0.06);
}

.codex-fork-node:hover,
.codex-fork-node:focus-visible,
.codex-fork-node[data-selected="true"] {
  border-color: #45606f;
  border-left-color: #b97924;
  background: #fffaf2;
}

.codex-fork-node:focus-visible {
  outline: 2px solid #45606f;
  outline-offset: 2px;
}

.codex-fork-node[data-role="Ancestor"],
.codex-fork-node[data-role="Parent"] {
  border-left-color: #4f788a;
}

.codex-fork-node[data-role="Descendant"] {
  border-left-color: #2f9d73;
}

.codex-fork-node[data-edge-status="closed"] {
  border-style: dashed;
  opacity: 0.76;
}

.codex-fork-node__topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #586773;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.codex-fork-node__edge {
  color: #6e8797;
}

.codex-fork-node__title {
  display: -webkit-box;
  overflow: hidden;
  color: #16232c;
  font-weight: 850;
  line-height: 1.2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.codex-fork-node__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #586773;
  font-size: 0.76rem;
}

.codex-fork-node__meta code,
.codex-fork-node__meta span {
  border-radius: 999px;
  padding: 2px 7px;
  background: #edf3f5;
}

.codex-fork-node__meta code {
  color: #273946;
  font-size: 0.72rem;
}

.codex-fork-descendant-branches {
  display: grid;
  gap: 10px;
  width: min(620px, 100%);
}

.codex-fork-branch {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
}

.codex-fork-branch__rail {
  position: relative;
  display: block;
  width: 20px;
  min-height: 116px;
}

.codex-fork-branch__rail::before,
.codex-fork-branch__rail::after {
  position: absolute;
  content: "";
  background: #9aaab3;
}

.codex-fork-branch__rail::before {
  top: 0;
  left: 9px;
  width: 2px;
  height: 100%;
}

.codex-fork-branch__rail::after {
  top: 52px;
  left: 9px;
  width: 14px;
  height: 2px;
}

.codex-fork-branch__body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.codex-fork-root-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d9e1e6;
  border-radius: 999px;
  padding: 7px 10px;
  background: #ffffff;
  color: #586773;
  font-size: 0.82rem;
  font-weight: 700;
}

.codex-fork-root-note__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #b97924;
}

.codex-token-table td,
.codex-token-table th {
  white-space: nowrap;
}

.codex-token-table code {
  font-size: 0.72rem;
}

.codex-diagnostics {
  display: grid;
  gap: 8px;
}

.war-chest-game-tree-list {
  display: grid;
  gap: 8px;
}

.war-chest-game-tree-list__item {
  display: grid;
  gap: 6px;
  border: 1px solid #d9e1e6;
  border-radius: 8px;
  padding: 10px;
  color: inherit;
  text-decoration: none;
}

.war-chest-game-tree-list__item.is-active {
  border-color: #386f9f;
  background: #f2f7fb;
}

.war-chest-game-tree-list__item.is-error {
  border-color: #e0bbb7;
}

.war-chest-game-tree-list__title {
  color: #26323a;
  font-weight: 800;
}

.war-chest-game-tree-list__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #6f7e89;
  font-size: 0.8rem;
}

.war-chest-game-tree-meta {
  display: grid;
  gap: 8px;
}

@media (max-width: 760px) {
  .kb-bitboard__header,
  .kb-bitboard__layout,
  .kb-bitboard-move__layout,
  .kb-bitboard-capture__layout {
    grid-template-columns: 1fr;
  }

  .kb-bitboard__header {
    display: grid;
  }
}

@media (max-width: 980px) {
  .kb-war-chest-viewer,
  .kb-war-chest-map-editor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .bookshelf-grid,
  .roadmap-layout,
  .attention-layout,
  .attention-stat-grid {
    grid-template-columns: 1fr;
  }

  .task-row {
    grid-template-columns: 1fr;
  }

  .task-row__source {
    grid-column: auto;
  }

  .attention-inspector {
    position: static;
  }

  .attention-relation,
  .attention-edge-row {
    grid-template-columns: 1fr;
  }

  .codex-stats,
  .codex-page-grid,
  .codex-thread-facts {
    grid-template-columns: 1fr;
  }

  .codex-thread-tree {
    max-height: 360px;
  }

  .codex-fork-graph__header,
  .codex-fork-ancestor-step {
    display: grid;
  }

  .codex-fork-graph__counts {
    justify-content: start;
  }

  .codex-fork-stage {
    justify-items: stretch;
    max-height: none;
    padding: 12px;
  }

  .codex-fork-ancestors,
  .codex-fork-focus {
    justify-items: stretch;
    justify-content: stretch;
  }

  .codex-fork-ancestor-step__line {
    width: 2px;
    height: 14px;
    margin-left: 18px;
  }

  .codex-fork-node,
  .codex-fork-descendant-branches {
    width: 100%;
  }
}

.hex-cube-story {
  display: grid;
  gap: 16px;
  margin: 32px 0;
  border: 1px solid #d7e0e5;
  border-radius: 18px;
  background: #f8faf9;
  padding: 18px;
  overflow: hidden;
}

.hex-cube-story__header,
.hex-cube-story__axis-legend,
.hex-cube-story__coord-row,
.hex-cube-story__equation,
.hex-cube-story__steps {
  display: flex;
  align-items: center;
}

.hex-cube-story__header {
  justify-content: space-between;
  gap: 16px;
}

.hex-cube-story__header h3,
.hex-cube-story__narrative p {
  margin: 0;
}

.hex-cube-story__eyebrow {
  margin: 0 0 4px;
  color: #6c7a83;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hex-cube-story__axis-legend {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  font-size: 0.76rem;
  font-weight: 800;
}

.hex-cube-story__axis-legend span,
.hex-cube-story__coord-row span {
  border-radius: 999px;
  padding: 4px 8px;
}

.hex-cube-story .q {
  color: #9d352f;
  background: #f8e4e1;
}

.hex-cube-story .r {
  color: #256a49;
  background: #dff1e6;
}

.hex-cube-story .s {
  color: #295d91;
  background: #e0ebf6;
}

.hex-cube-story__stage {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  min-height: 430px;
  border: 1px solid #dce4e8;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.hex-cube-story__three {
  min-width: 0;
  min-height: 430px;
  cursor: grab;
}

.hex-cube-story__three:active {
  cursor: grabbing;
}

.hex-cube-story__three canvas {
  display: block;
}

.hex-cube-story__three > svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 430px;
}

.hex-cube-story__side {
  display: grid;
  align-content: center;
  border-left: 1px solid #e3e8eb;
  background: #fbfcfc;
  padding: 14px;
}

.hex-cube-story__plane-view {
  display: block;
  width: 100%;
  height: auto;
  max-height: 290px;
}

.hex-cube-story__plane-view polygon {
  fill: #eef2ec;
  stroke: #a9b3b9;
  stroke-width: 1.5;
}

.hex-cube-story__plane-view polygon[data-origin="true"] {
  fill: #f6e6b9;
  stroke: #c9912f;
}

.hex-cube-story__plane-view polygon[data-selected="true"] {
  fill: #d8ede3;
  stroke: #20865a;
  stroke-width: 3;
}

.hex-cube-story__plane-view text {
  fill: #a13d36;
  font-size: 12px;
  font-weight: 700;
}

.hex-cube-story__inspector {
  display: grid;
  gap: 10px;
  border-top: 1px solid #e3e8eb;
  padding: 14px 4px 2px;
}

.hex-cube-story__coord-row {
  gap: 6px;
}

.hex-cube-story__coord-row strong {
  min-width: 20px;
  font-variant-numeric: tabular-nums;
}

.hex-cube-story__equation {
  justify-content: space-between;
  gap: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.hex-cube-story__equation span {
  border-radius: 999px;
  background: #f5dfdc;
  padding: 3px 8px;
  color: #a13d36;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 800;
}

.hex-cube-story__equation span[data-valid="true"] {
  color: #256a49;
  background: #dff1e6;
}

.hex-cube-story__axial {
  color: #65737c;
  font-size: 0.82rem;
}

.hex-cube-story__narrative {
  min-height: 58px;
}

.hex-cube-story__narrative p {
  margin-top: 5px;
  color: #5c6a73;
}

.hex-cube-story__steps {
  justify-content: center;
  gap: 8px;
}

.hex-cube-story__steps button {
  width: 34px;
  height: 34px;
  border: 1px solid #cbd5da;
  border-radius: 999px;
  color: #53616a;
  background: #fff;
  cursor: pointer;
}

.hex-cube-story__steps button[data-active="true"] {
  border-color: #356f9f;
  color: #fff;
  background: #356f9f;
}

@media (max-width: 760px) {
  .hex-cube-story__header {
    align-items: flex-start;
  }

  .hex-cube-story__stage {
    grid-template-columns: 1fr;
  }

  .hex-cube-story__three {
    min-height: 350px;
  }

  .hex-cube-story__three > svg {
    min-height: 350px;
  }

  .hex-cube-story__side {
    border-top: 1px solid #e3e8eb;
    border-left: 0;
  }
}

.war-chest-information-set-story {
  margin: 28px 0;
  overflow: hidden;
  border: 1px solid #d8e0e4;
  border-radius: 18px;
  color: #26323a;
  background: #f8faf9;
  box-shadow: 0 16px 36px rgba(37, 50, 58, 0.08);
}

.war-chest-information-set-story__header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid #e0e6e9;
}

.war-chest-information-set-story__header h3,
.war-chest-information-set-story__header p {
  margin: 0;
}

.war-chest-information-set-story__header h3 {
  margin: 5px 0 7px;
}

.war-chest-information-set-story__header > p:last-child {
  color: #63717a;
  font-size: 0.9rem;
}

.war-chest-information-set-story__eyebrow {
  color: #9b641e !important;
  font-size: 0.72rem !important;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.war-chest-information-set-story__set {
  margin: 20px;
  padding: 15px;
  border: 2px solid #b77e23;
  border-radius: 15px;
  background: #fffaf0;
}

.war-chest-information-set-story__set-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #78531d;
  font-size: 0.82rem;
}

.war-chest-information-set-story__set-label strong {
  font-size: 0.92rem;
}

.war-chest-information-set-story__worlds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.war-chest-information-set-story__world {
  overflow: hidden;
  border: 1px solid #e0d3b9;
  border-radius: 11px;
  background: #fff;
}

.war-chest-information-set-story__world > header,
.war-chest-information-set-story__observation > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-weight: 800;
}

.war-chest-information-set-story__world > header {
  color: #684b20;
  background: #f7ecd6;
}

.war-chest-information-set-story__world small,
.war-chest-information-set-story__observation small {
  display: block;
  color: #718089;
  font-size: 0.7rem;
  font-weight: 600;
}

.war-chest-information-set-story__zone {
  padding: 10px 12px;
}

.war-chest-information-set-story__zone + .war-chest-information-set-story__zone {
  border-top: 1px solid #edf0f1;
}

.war-chest-information-set-story__zone-label {
  display: block;
  margin-bottom: 6px;
  color: #718089;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.war-chest-information-set-story__coins {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.war-chest-information-set-story__coin {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border: 1px solid #dbe2e5;
  border-radius: 999px;
  padding: 3px 8px;
  color: #4a5962;
  background: #f5f7f8;
  font-size: 0.73rem;
  font-weight: 750;
}

.war-chest-information-set-story__coin[data-kind="hidden"] {
  border-color: #e2bbb7;
  color: #8d3732;
  background: #fff0ee;
}

.war-chest-information-set-story__coin[data-kind="own"] {
  border-color: #b7d8c7;
  color: #256a49;
  background: #eaf6ef;
}

.war-chest-information-set-story__coin[data-kind="unknown"] {
  border-color: #cad1d5;
  color: #fff;
  background: repeating-linear-gradient(135deg, #56646d 0 5px, #64727b 5px 10px);
}

.war-chest-information-set-story__hidden {
  border-top: 1px dashed #d7b9b5;
  background: #fff9f8;
}

.war-chest-information-set-story__projection {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #6c7880;
  font-size: 0.76rem;
}

.war-chest-information-set-story__projection strong {
  color: #356f9f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.war-chest-information-set-story__projection-arrow {
  color: #356f9f;
  font-size: 1.6rem;
  line-height: 1;
}

.war-chest-information-set-story__observation {
  margin: 5px 20px 20px;
  overflow: hidden;
  border: 2px solid #356f9f;
  border-radius: 15px;
  background: #f7fbff;
}

.war-chest-information-set-story__observation > header {
  color: #285b86;
  background: #e7f1f9;
}

.war-chest-information-set-story__observation > header > div > span {
  display: block;
}

.war-chest-information-set-story__observation > header > strong {
  border-radius: 999px;
  padding: 4px 8px;
  color: #285b86;
  background: #fff;
  font-size: 0.7rem;
}

.war-chest-information-set-story__observation-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
}

.war-chest-information-set-story__observation-grid > .war-chest-information-set-story__zone + .war-chest-information-set-story__zone {
  border-top: 0;
  border-left: 1px solid #dbe7ef;
}

.war-chest-information-set-story__summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 15px 20px 18px;
  border-top: 1px solid #e0e6e9;
  color: #596871;
  font-size: 0.83rem;
  text-align: center;
}

.war-chest-information-set-story__summary strong {
  color: #26323a;
}

@media (max-width: 760px) {
  .war-chest-information-set-story__set-label {
    display: grid;
  }

  .war-chest-information-set-story__worlds,
  .war-chest-information-set-story__observation-grid,
  .war-chest-information-set-story__summary {
    grid-template-columns: 1fr;
  }

  .war-chest-information-set-story__observation-grid > .war-chest-information-set-story__zone + .war-chest-information-set-story__zone {
    border-top: 1px solid #dbe7ef;
    border-left: 0;
  }
}

/* Writing workspace */
.writing-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  border-block: 1px solid #dce4e9;
  background: #f8fafb;
}

.writing-summary > div {
  min-width: 148px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 10px 16px;
}

.writing-summary > div + div {
  border-left: 1px solid #dce4e9;
}

.writing-summary dt {
  color: #627380;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.writing-summary dd {
  margin: 0;
  color: #17212b;
  font-size: 18px;
  font-weight: 800;
}

.writing-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  border-bottom: 1px solid #ccd7de;
}

.writing-tab {
  min-height: 42px;
  display: flex;
  gap: 9px;
  align-items: center;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 14px;
  color: #5b6b7a;
  background: transparent;
  font-weight: 720;
  white-space: nowrap;
  cursor: pointer;
}

.writing-tab small {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #587080;
  background: #eaf0f3;
  font-size: 11px;
  text-align: center;
}

.writing-tab:hover {
  color: #173e54;
  background: #f1f6f8;
}

.writing-tab[aria-selected="true"] {
  border-bottom-color: #2c7188;
  color: #12384f;
}

.writing-tab:focus-visible,
.writing-queue-item:focus-visible,
.writing-document__actions a:focus-visible,
.writing-relation-list a:focus-visible {
  outline: 3px solid rgba(44, 113, 136, 0.24);
  outline-offset: -3px;
}

.writing-workspace {
  border: 1px solid #ccd7de;
  background: #fff;
}

.writing-queue,
.writing-context {
  min-width: 0;
  background: #f7f9fa;
}

.writing-queue {
  border-right: 1px solid #ccd7de;
}

.writing-context {
  border-left: 1px solid #ccd7de;
}

.writing-queue > header,
.writing-context > header {
  padding: 17px 16px 14px;
  border-bottom: 1px solid #dce4e9;
}

.writing-queue h2,
.writing-context h2,
.writing-document h2,
.writing-context-section h3 {
  margin: 0;
  color: #17212b;
}

.writing-queue h2,
.writing-context h2 {
  font-size: 17px;
}

.writing-queue header p,
.writing-context header p {
  margin: 5px 0 0;
  color: #5b6b7a;
  font-size: 12px;
  line-height: 1.45;
}

.writing-queue-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  border: 0;
  border-bottom: 1px solid #e1e7eb;
  padding: 13px 15px;
  color: #17212b;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.writing-queue-item:hover {
  background: #edf4f7;
}

.writing-queue-item[data-selected="true"] {
  background: #e2eef2;
}

.writing-queue-item strong {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
}

.writing-queue-item__kind,
.writing-document__kind {
  color: #2c7188;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.writing-queue-item__links {
  justify-self: end;
  color: #758590;
  font-size: 10px;
  font-weight: 700;
}

.writing-queue-item__reason {
  overflow: hidden;
  color: #536575;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.writing-document {
  min-width: 0;
  background: #fff;
}

.writing-document__inner {
  min-height: 100%;
}

.writing-document__header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 52px) 18px;
  border-bottom: 1px solid #e0e6ea;
}

.writing-document__header h2 {
  max-width: 28ch;
  margin-top: 5px;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.writing-document__header p {
  max-width: 64ch;
  margin: 8px 0 0;
  overflow: hidden;
  color: #71808b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.writing-document__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.writing-document__actions a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #aec1cd;
  border-radius: 6px;
  padding: 0 10px;
  color: #284e62;
  background: #f7fafb;
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}

.writing-document__actions .writing-primary-action {
  border-color: #2c7188;
  color: #fff;
  background: #2c7188;
}

.writing-document__actions a:hover {
  border-color: #2c7188;
  background: #e9f2f5;
}

.writing-document__actions .writing-primary-action:hover {
  color: #fff;
  background: #225d72;
}

.writing-document__body {
  max-width: 76ch;
  margin: 0 auto;
  padding: 30px clamp(22px, 5vw, 64px) 70px;
}

.writing-document__body > .markdown-body {
  max-width: none;
}

.writing-context-section {
  padding: 16px;
  border-bottom: 1px solid #dce4e9;
}

.writing-context-section h3 {
  margin-bottom: 10px;
  color: #536575;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.writing-open-loops,
.writing-relation-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.writing-open-loops li {
  padding: 10px;
  border-radius: 6px;
  color: #5c4610;
  background: #fff5d6;
}

.writing-open-loops li > span {
  display: block;
  color: #846411;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.writing-open-loops p {
  margin: 4px 0 0;
  color: #4f3c0d;
  font-size: 13px;
  line-height: 1.4;
}

.writing-open-loops small {
  display: block;
  margin-top: 6px;
  color: #866f34;
  font-size: 10px;
}

.writing-relation-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
}

.writing-relation-list a {
  overflow: hidden;
  color: #284e62;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.writing-relation-list a:hover {
  text-decoration: underline;
}

.writing-relation-list small {
  color: #7b8993;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.writing-context-empty,
.writing-empty {
  margin: 0;
  color: #71808b;
  font-size: 12px;
  line-height: 1.45;
}

.writing-empty {
  padding: 18px 16px;
}

.writing-document__empty,
.writing-unavailable {
  min-height: 360px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 32px;
  color: #5b6b7a;
  text-align: center;
}

.writing-document__empty p,
.writing-unavailable p {
  max-width: 48ch;
  margin: 8px 0 0;
}

.writing-page-loading,
.writing-document__loading {
  display: grid;
  gap: 12px;
  padding: 28px;
}

.writing-page-loading span,
.writing-document__loading span {
  height: 12px;
  border-radius: 6px;
  background: #e8eef1;
  transform-origin: left;
  animation: writing-load 1.2s cubic-bezier(0.16, 1, 0.3, 1) infinite alternate;
}

.writing-page-loading span:nth-child(2),
.writing-document__loading span:nth-child(2) {
  width: 78%;
  animation-delay: 90ms;
}

.writing-page-loading span:nth-child(3),
.writing-document__loading span:nth-child(3) {
  width: 56%;
  animation-delay: 180ms;
}

@keyframes writing-load {
  from { transform: scaleX(0.72); opacity: 0.58; }
  to { transform: scaleX(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .writing-page-loading span,
  .writing-document__loading span {
    animation: none;
  }
}

@media (max-width: 1180px) {
  .writing-context {
    grid-column: 1 / -1;
    border-top: 1px solid #ccd7de;
    border-left: 0;
  }

  .writing-context__body {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .writing-context-section {
    border-bottom: 0;
  }

  .writing-context-section + .writing-context-section {
    border-left: 1px solid #dce4e9;
  }
}

@media (max-width: 760px) {
  .writing-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .writing-summary > div + div {
    border-left: 0;
  }

  .writing-summary > div:nth-child(even) {
    border-left: 1px solid #dce4e9;
  }

  .writing-summary > div:nth-child(n + 3) {
    border-top: 1px solid #dce4e9;
  }

  .writing-queue {
    border-right: 0;
    border-bottom: 1px solid #ccd7de;
  }

  .writing-queue__items {
    max-height: 320px;
  }

  .writing-document__header {
    display: grid;
  }

  .writing-document__actions {
    justify-content: flex-start;
  }

  .writing-context {
    grid-column: auto;
  }

  .writing-context__body {
    display: block;
  }

  .writing-context-section + .writing-context-section {
    border-top: 1px solid #dce4e9;
    border-left: 0;
  }
}
