.kb-page { width: min(1220px, 100%); margin: 0 auto; padding: 32px 28px 60px; color: var(--ink); }
.kb-page *, .kb-page *::before, .kb-page *::after { box-sizing: border-box; }
.kb-page ::selection { background: var(--primary-soft); color: var(--primary-dark); }
.kb-page input, .kb-page textarea { caret-color: var(--primary); }
.kb-page button, .kb-page a { touch-action: manipulation; }
.kb-page [tabindex="-1"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.kb-page a { color: var(--primary); text-underline-offset: 4px; overflow-wrap: anywhere; }
.kb-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin: 12px 0 28px; }
.kb-heading h1 { font-size: clamp(24px, 2.2vw, 32px); line-height: 1.35; margin: 0; overflow-wrap: anywhere; }
.kb-heading p { margin: 9px 0 0; color: var(--muted); line-height: 1.7; }
.kb-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.kb-page .primary-button, .kb-page .icon-text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; white-space: nowrap; }
.kb-page button:disabled { opacity: .55; cursor: not-allowed; }
.kb-page svg { width: 18px; height: 18px; flex-shrink: 0; }
.kb-search { display: flex; gap: 12px; align-items: end; margin-bottom: 28px; }
.kb-search-field { display: flex; align-items: center; flex: 1; gap: 12px; padding: 0 16px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; }
.kb-search-field:focus-within { border-color: var(--primary); }
.kb-search-field input { width: 100%; min-width: 0; border: 0; background: transparent; min-height: 48px; outline-offset: -3px; }
.kb-search > .primary-button { min-height: 48px; padding-inline: 24px; }
.kb-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 32px; align-items: start; }
.kb-sidebar { padding-right: 20px; border-right: 1px solid var(--line); }
.kb-filters > summary { font-weight: 700; padding: 10px 0; cursor: pointer; }
.kb-filter-content { padding-top: 12px; }
.kb-filter-content h2 { font-size: 13px; margin: 24px 0 9px; color: var(--muted); }
.kb-switch { display: flex; border-bottom: 1px solid var(--line); gap: 6px; }
.kb-switch button { flex: 1; padding: 10px 4px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); }
.kb-switch .is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.kb-categories { display: grid; gap: 3px; }
.kb-categories button { border: 0; text-align: left; border-radius: 6px; padding: 10px 12px; background: transparent; overflow-wrap: anywhere; }
.kb-categories button:hover, .kb-categories .is-active { background: var(--primary-soft); color: var(--primary-dark); }
.kb-categories .is-active { font-weight: 700; }
.kb-text-button { display: inline-flex; gap: 6px; align-items: center; min-height: 36px; padding: 4px 0; border: 0; background: transparent; color: var(--primary); text-decoration: underline; text-underline-offset: 4px; font-size: 13px; }
.kb-text-button:hover { color: var(--primary-dark); }
.kb-page .danger { color: var(--danger); }
.kb-filter-form { display: grid; gap: 16px; margin-top: 24px; }
.kb-filter-form label, .kb-field { display: grid; gap: 7px; min-width: 0; font-weight: 600; }
.kb-page input:not([type="checkbox"]):not([type="file"]), .kb-page select, .kb-page textarea { font-size: 14px; }
.kb-field input, .kb-field select, .kb-field textarea, .kb-filter-form input:not([type="checkbox"]), .kb-filter-form select, .kb-template select { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 6px; padding: 10px 12px; background: var(--surface); color: var(--ink); font-weight: 400; }
.kb-page input::placeholder, .kb-page textarea::placeholder { color: #64736b; opacity: 1; }
.kb-page textarea { resize: vertical; line-height: 1.8; }
.kb-page .kb-check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.kb-check input { width: 17px; height: 17px; accent-color: var(--primary); }
.kb-list-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 9px 0 16px; border-bottom: 1px solid var(--line-strong); }
.kb-list-heading h2 { font-size: 18px; margin: 0; }
.kb-list-heading > span, .kb-muted { color: var(--muted); font-size: 13px; }
.kb-row { padding: 24px 0; border-bottom: 1px solid var(--line); }
.kb-row-title { display: flex; align-items: baseline; gap: 10px; }
.kb-row-title > a { font-size: 18px; font-weight: 700; color: var(--ink); text-decoration: none; line-height: 1.55; }
.kb-row-title > a:hover { color: var(--primary); text-decoration: underline; }
.kb-pin { display: inline-flex; gap: 4px; align-items: center; color: var(--primary); white-space: nowrap; font-size: 12px; }
.kb-pin svg { width: 13px; height: 13px; }
.kb-excerpt { margin: 10px 0 14px; color: var(--muted); line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; white-space: pre-line; }
.kb-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; color: var(--muted); font-size: 12px; }
.kb-badge { padding: 3px 7px; border-radius: 4px; background: #e5eae6; color: #4a5950; }
.kb-badge.is-ready { background: var(--primary-soft); color: var(--primary-dark); }
.kb-tag { border: 0; padding: 2px 5px; border-radius: 4px; background: transparent; color: var(--primary); overflow-wrap: anywhere; font-size: 12px; }
button.kb-tag:hover { background: var(--primary-soft); text-decoration: underline; }
.kb-empty { padding: 64px 28px; text-align: center; background: var(--surface); border-bottom: 1px solid var(--line); }
.kb-empty > svg { width: 32px; height: 32px; color: var(--primary); }
.kb-empty h3 { font-size: 20px; margin: 18px 0 10px; }
.kb-empty p { color: var(--muted); line-height: 1.8; max-width: 380px; margin: 0 auto 20px; }
.kb-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 24px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.kb-document { max-width: 960px; }
.kb-document > .kb-heading { margin-top: 24px; }
.kb-document .kb-heading > div:first-child { min-width: 0; }
.kb-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.95; font-size: 16px; margin: 28px 0; padding: 28px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.kb-source { margin: 32px 0; overflow-wrap: anywhere; }
.kb-source p { white-space: pre-wrap; line-height: 1.8; }
.kb-source h2, .kb-attachments h2, .kb-conflict h2 { font-size: 18px; margin: 0 0 16px; }
.kb-attachments { margin-top: 32px; }
.kb-attachments h2 span { color: var(--muted); font-weight: 400; }
.kb-file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.kb-file { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.kb-file img { display: block; width: 100%; height: 160px; object-fit: contain; background: var(--surface-soft); }
.kb-file-placeholder { height: 64px; display: grid; place-items: center; color: var(--muted); background: var(--surface-soft); }
.kb-file-info { display: grid; gap: 7px; padding: 12px 14px; }
.kb-file-info strong { font-size: 13px; overflow-wrap: anywhere; line-height: 1.6; }
.kb-file-info > span { color: var(--muted); font-size: 12px; }
.kb-document-footer { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; align-items: center; color: var(--muted); font-size: 13px; }
.kb-editor { display: grid; gap: 22px; }
.kb-editor > .kb-field:first-child input { font-size: 19px; padding: 14px; }
.kb-template { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.kb-template label { display: grid; gap: 6px; min-width: 180px; }
.kb-template > span { font-size: 12px; color: var(--muted); padding-bottom: 10px; }
.kb-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.kb-more { border-top: 1px solid var(--line); padding-top: 16px; }
.kb-more summary { cursor: pointer; padding-bottom: 12px; font-weight: 600; }
.kb-more label + label { margin-top: 16px; }
.kb-editor .kb-attachments { margin-top: 8px; }
.kb-drop { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 24px; text-align: center; margin-top: 16px; }
.kb-drop > div { display: flex; gap: 8px; justify-content: center; align-items: center; }
.kb-drop p { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 8px 0 16px; }
.kb-drop.is-dragging { background: var(--primary-soft); border-color: var(--primary); }
.kb-file-picker { position: relative; overflow: hidden; cursor: pointer; }
.kb-file-picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.kb-file-picker:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; }
.kb-upload-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.kb-upload-row > div:first-child { display: grid; gap: 6px; min-width: 0; }
.kb-upload-row strong { overflow-wrap: anywhere; font-size: 13px; }
.kb-upload-row span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.kb-upload-row progress { width: 100%; max-width: 360px; accent-color: var(--primary); }
.kb-editor-footer { position: sticky; bottom: 0; background: var(--canvas); padding: 16px 0; border-top: 1px solid var(--line-strong); display: flex; justify-content: space-between; gap: 16px; align-items: center; z-index: 1; }
.kb-editor-footer > span { color: var(--muted); font-size: 13px; }
.kb-page [data-kb-notice] { padding: 12px 16px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-dark); line-height: 1.7; overflow-wrap: anywhere; }
.kb-page .kb-error { background: var(--danger-soft); color: #8a312a; }
.kb-conflict { padding: 20px; border: 1px solid var(--danger); border-radius: 8px; }
.kb-conflict .kb-body { max-height: 400px; overflow: auto; }
.kb-category-manager form { display: flex; align-items: end; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.kb-category-manager .kb-field, .kb-search > .kb-field { flex: 1; }
@media (max-width: 760px) {
  .kb-page { padding: 20px 16px 32px; }
  .kb-heading { flex-direction: column; gap: 16px; margin-bottom: 20px; }
  .kb-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .kb-sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 8px; }
  .kb-categories { grid-template-columns: 1fr 1fr; }
  .kb-filter-form { margin-bottom: 16px; }
  .kb-search { gap: 8px; margin-bottom: 16px; }
  .kb-search-field { padding: 0 10px; gap: 8px; }
  .kb-search > .primary-button { padding-inline: 16px; }
  .kb-list-heading { flex-wrap: wrap; }
  .kb-row { padding: 20px 0; }
  .kb-row-title { align-items: start; }
  .kb-pin { padding-top: 5px; }
  .kb-body { padding: 20px 16px; margin-top: 20px; }
  .kb-editor-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .kb-document-footer { flex-direction: column; align-items: start; }
  .kb-editor-footer { flex-wrap: wrap; gap: 10px; }
  .kb-editor-footer .kb-actions { margin-left: auto; }
  .kb-file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kb-file img { height: 130px; }
  .kb-drop { padding: 20px 12px; }
  .kb-category-manager form { flex-wrap: wrap; gap: 10px; }
  .kb-category-manager .kb-field { flex-basis: 100%; }
  .kb-pagination { flex-wrap: wrap; }
}
.kb-ai-tools { display: flex; align-items: flex-start; gap: 24px; margin: 0 0 24px; }
.kb-ai-tools > details { flex: 1; min-width: 0; }
.kb-ai-tools summary, .kb-originals summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.kb-ai-tools > button { flex-shrink: 0; margin-top: 8px; }
.kb-ai-tools .kb-search { align-items: flex-end; margin-top: 16px; }
.kb-ai-tools .kb-field { flex: 1; }
.kb-ai-tools textarea { resize: vertical; }
.kb-ai-detail { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.kb-originals { margin: 20px 0; }
.kb-answer-paragraph { padding: 16px 0; border-bottom: 1px solid var(--line); }
.kb-answer-paragraph p { margin: 0 0 8px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.kb-answer-paragraph a { white-space: normal; }
.kb-ai-tools [role="status"] { font-size: 13px; line-height: 1.7; }
.kb-experience-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.kb-experience-toolbar > button { margin-left: auto; }
.kb-experience-progress, .kb-experience-state { color: var(--muted); font-size: 13px; line-height: 1.8; }
.kb-experience-section { margin-top: 32px; }
.kb-experience-section > h2 { font-size: 18px; margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line-strong); }
.kb-experience-item { padding: 22px 0; border-bottom: 1px solid var(--line); }
.kb-experience-option > p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.9; margin: 10px 0; }
.kb-experience-option + .kb-experience-option { margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--line-strong); }
.kb-experience-warning, .kb-experience-pending { color: var(--danger); background: var(--danger-soft); }
.kb-experience-warning { padding: 10px 12px; border-radius: 6px; margin: 0 0 16px; line-height: 1.7; }
.kb-experience-sources { margin: 12px 0; font-size: 13px; }
.kb-experience-sources summary, .kb-experience-other > summary { color: var(--primary); cursor: pointer; padding: 6px 0; }
.kb-experience-sources > div { margin: 12px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.kb-experience-sources p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.kb-experience-conflict-actions { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.kb-experience-job { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.kb-experience-job > div { min-width: 0; }
.kb-experience-job p { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; margin: 7px 0 0; }
.kb-experience-job > button { flex-shrink: 0; }
