@font-face {
    font-family: 'Outfit';
    src: url('/fonts/Outfit/Outfit-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;
    font-family: Outfit, Arial, Helvetica, sans-serif;
    background: #ffffff;
    color: #1C1C1C;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #ffffff;
    color: #1C1C1C;
}

.knowledge-base-page,
.knowledge-base-page button,
.knowledge-base-page input,
.knowledge-base-page textarea,
.knowledge-base-page select {
    font-family: Outfit, Arial, Helvetica, sans-serif;
}

.knowledge-base-page,
.knowledge-base-page .sidebar-panel,
.knowledge-base-page .content-panel {
    scrollbar-color: #1C1C1C #F5F5F5;
    scrollbar-width: thin;
}

.knowledge-base-page::-webkit-scrollbar,
.knowledge-base-page .sidebar-panel::-webkit-scrollbar,
.knowledge-base-page .content-panel::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.knowledge-base-page::-webkit-scrollbar-track,
.knowledge-base-page .sidebar-panel::-webkit-scrollbar-track,
.knowledge-base-page .content-panel::-webkit-scrollbar-track {
    background: #F5F5F5;
}

.knowledge-base-page::-webkit-scrollbar-thumb,
.knowledge-base-page .sidebar-panel::-webkit-scrollbar-thumb,
.knowledge-base-page .content-panel::-webkit-scrollbar-thumb {
    background-color: #1C1C1C;
    border-radius: 10px;
    border: 2px solid #F5F5F5;
}

.knowledge-base-page::-webkit-scrollbar-thumb:hover,
.knowledge-base-page .sidebar-panel::-webkit-scrollbar-thumb:hover,
.knowledge-base-page .content-panel::-webkit-scrollbar-thumb:hover {
    background-color: #000000;
}

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 20px;
}

.hero,
.panel {
    background: #F5F5F5;
    border: 1px solid #e7e7e7;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(28, 28, 28, 0.06);
}

.panel {
    margin-top: 24px;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1C1C1C;
}

h1,
h2 {
    margin-top: 0;
}

.summary {
    max-width: 60ch;
    line-height: 1.6;
}

.actions {
    margin-top: 20px;
}

button {
    border: 0;
    border-radius: 10px;
    padding: 12px 18px;
    background: #1C1C1C;
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
}

button:hover,
.button-link:hover {
    background: #333333;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 12px 18px;
    background: #1C1C1C;
    color: #ffffff;
    text-decoration: none;
}

pre {
    margin: 16px 0 0;
    padding: 16px;
    border-radius: 10px;
    background: #ffffff;
    color: #1C1C1C;
    overflow-x: auto;
    border: 1px solid #e0e0e0;
}

.knowledge-base-page {
    max-width: 1400px;
    padding: 32px 20px;
}

.knowledge-base-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.sidebar-panel,
.content-panel,
.topic-card {
    background: #F5F5F5;
    border: 0;
    border-radius: 10px;
}

.sidebar-panel {
    padding: 20px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.sidebar-search {
    width: 100%;
    margin: 16px 0 20px;
    padding: 12px 14px;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    background: #ffffff;
    color: #1C1C1C;
    font: inherit;
}

.sidebar-search:focus {
    outline: 2px solid rgba(28, 28, 28, 0.15);
    border-color: #1C1C1C;
}

.sidebar-panel,
.sidebar-panel * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.chapter-list,
.subchapter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.chapter-item + .chapter-item {
    margin-top: 16px;
}

.chapter-list {
    position: relative;
    min-height: 24px;
}

.chapter-drop-indicator {
    display: none;
    position: absolute;
    height: 1px;
    background: #1C1C1C;
    pointer-events: none;
    z-index: 50;
}

.topic-drop-indicator {
    display: none;
    position: absolute;
    height: 1px;
    background: #1C1C1C;
    pointer-events: none;
    z-index: 50;
}

.chapter-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.knowledgebase-debug-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
    padding: 10px 14px;
    font-size: 0.85rem;
    line-height: 1;
    box-shadow: 0 10px 20px rgba(28, 28, 28, 0.18);
}

.chapter-collapse-toggle {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #1C1C1C;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.chapter-collapse-toggle:hover {
    background: rgba(28, 28, 28, 0.06);
}

.chapter-item.is-collapsed .chapter-collapse-toggle {
    font-weight: 700;
}

.chapter-add-topic-button {
    margin-left:15%;
    width:75%;
    margin-top:5px;
    margin-bottom:5px;
}

.chapter-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #1C1C1C;
    font-size: 0.85rem;
    line-height: 1;
    cursor: grab;
}

.topic-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #1C1C1C;
    font-size: 0.85rem;
    line-height: 1;
    cursor: grab;
}

.chapter-drag-handle:hover {
    background: rgba(28, 28, 28, 0.06);
}

.topic-drag-handle:hover {
    background: rgba(28, 28, 28, 0.06);
}

.chapter-drag-handle:active {
    cursor: grabbing;
}

.topic-drag-handle:active {
    cursor: grabbing;
}

.chapter-remove-button,
.topic-remove-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    color: #1C1C1C;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1;
}

.chapter-remove-button:hover,
.topic-remove-button:hover {
    background: transparent;
    color: #1C1C1C;
}

.chapter-item-add {
    margin-top: -10px;
}

.chapter-item-add button {
    width: 100%;
}

.chapter-item.is-collapsed .subchapter-list {
    display: none;
}

.chapter-item.is-dragging {
    opacity: 0.6;
}

.chapter-item.is-drag-over {
    background: rgba(28, 28, 28, 0.04);
}

.chapter-list.is-dragging-chapters .chapter-item:not(.is-dragging) {
    transition: background-color 0.12s ease;
}

.chapter-list.is-dragging-chapters .chapter-item.is-drop-target-before,
.chapter-list.is-dragging-chapters .chapter-item.is-drop-target-after,
.chapter-list.is-dragging-chapters .chapter-title.is-drop-target-before,
.chapter-list.is-dragging-chapters .chapter-title.is-drop-target-after {
    background: rgba(28, 28, 28, 0.06);
}

.chapter-title.is-drop-target-before::before,
.chapter-title.is-drop-target-after::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: #1C1C1C;
    border-radius: 999px;
    pointer-events: none;
    z-index: 60;
}

.chapter-title.is-drop-target-before::before {
    top: -4px;
}

.chapter-title.is-drop-target-after::after {
    bottom: -4px;
}

.chapter-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    flex: 1 1 auto;
    min-height: 24px;
    cursor: default;
}

.chapter-title-toggle {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.chapter-title-toggle:hover,
.chapter-title-toggle:focus,
.chapter-title-toggle:active {
    background: transparent;
    color: inherit;
    text-decoration: none;
}

.subchapter-list {
    padding-left: 14px;
    border-left: 1px solid #d8d8d8;
    position: relative;
}

.subchapter-item + .subchapter-item {
    margin-top: 8px;
}

.subchapter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topic-sidebar-actions {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}

.topic-unpublished-indicator {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d92d20;
    position: absolute;
    top: 10px;
    right: -8px;
    pointer-events: none;
}

.subchapter-item.is-drop-target-before,
.subchapter-item.is-drop-target-after {
    background: rgba(28, 28, 28, 0.06);
}

.chapter-title[data-chapter-drag-handle] {
    cursor: grab;
    user-select: none;
    border-radius: 6px;
    padding: 0 4px;
    -webkit-user-select: none;
    touch-action: none;
}

.chapter-title[data-chapter-drag-handle]:hover {
    background: rgba(28, 28, 28, 0.06);
}

.chapter-title[data-chapter-drag-handle]:active {
    cursor: grabbing;
}

.subchapter-item.is-selected .sidebar-link {
    font-weight: 700;
    text-decoration: none;
}

.sidebar-link {
    color: #1C1C1C;
    text-decoration: none;
    line-height: 1.5;
    flex: 1 1 auto;
}

.knowledgebase-topic-title-editable {
    min-height: 24px;
}

.sidebar-link:hover {
    text-decoration: none;
}

.content-panel {
    padding: 24px;
    min-height: 0;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.content-panel h1 {
    margin-bottom: 12px;
}

.content-panel > p {
    margin: 10px 0;
    line-height: 1.6;
}

.topic-grid {
    display: grid;
    gap: 16px;
}

.topic-card {
    padding: 20px;
}

.topic-card.is-selected {
    box-shadow: none;
}

.topic-card h2,
.topic-card h3 {
    margin-bottom: 10px;
}

.topic-chapter-label {
    margin: 0 0 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.topic-summary {
    margin: 0;
    line-height: 1.6;
}

.topic-section {
    margin-top: 20px;
    margin-bottom: 30px;
}

.topic-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.topic-card p {
    margin: 15px 0;
    line-height: 1.6;
    white-space: pre-wrap;
}

.topic-content-block + .topic-content-block {
    margin-top: 20px;
}

.topic-card p .knowledgebase-inline-editable {
    white-space: pre-wrap;
}

.topic-card textarea.knowledgebase-paragraph-editor {
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    resize: none;
    font: inherit;
    color: inherit;
    outline: none;
    line-height: 1.6;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-word;
}

.knowledgebase-inline-editable {
    outline: none;
    border-bottom: 1px dashed rgba(28, 28, 28, 0.25);
}

.knowledgebase-inline-editable:focus {
    border-bottom-color: #1C1C1C;
    background: rgba(28, 28, 28, 0.04);
}

.knowledgebase-debug-topic-header {
    margin-bottom: 12px;
}

.knowledgebase-debug-topic-title {
    margin: 0 0 12px;
}

.knowledgebase-debug-topic-title .knowledgebase-inline-editable {
    display: inline-block;
    min-width: 160px;
}

.knowledgebase-debug-topic-controls {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    margin-bottom: 12px;
}

.knowledgebase-debug-topic-controls-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.knowledgebase-debug-topic-controls-secondary {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
}

.knowledgebase-publish-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1C1C1C;
}

.knowledgebase-publish-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.knowledgebase-publish-toggle-slider {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #d0d5dd;
    transition: background-color 0.18s ease;
    flex: 0 0 auto;
}

.knowledgebase-publish-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.2);
    transition: transform 0.18s ease;
}

.knowledgebase-publish-toggle input:checked + .knowledgebase-publish-toggle-slider {
    background: #12b76a;
}

.knowledgebase-publish-toggle input:checked + .knowledgebase-publish-toggle-slider::after {
    transform: translateX(18px);
}

.knowledgebase-publish-toggle input:focus-visible + .knowledgebase-publish-toggle-slider {
    outline: 2px solid rgba(28, 28, 28, 0.2);
    outline-offset: 2px;
}

.knowledgebase-publish-toggle-text {
    white-space: nowrap;
}

.chapter-add-button,
.chapter-add-topic-button,
.knowledgebase-debug-topic-controls button,
.topic-section-actions button,
.topic-table-actions button,
.topic-table-row-actions button,
.topic-table-column-actions button,
.topic-bullet-actions button,
.topic-bullet-block-actions button,
.topic-paragraph-actions button,
.topic-callout-actions button,
.topic-code-actions button,
.topic-image-actions button,
.topic-image-replace-button {
    padding: 2px 10px;
    border-radius: 6px;
    background: #E5E5E5;
    color: #1C1C1C;
    font-size: 0.85rem;
}

.chapter-add-button:hover,
.chapter-add-topic-button:hover,
.knowledgebase-debug-topic-controls button:hover,
.topic-section-actions button:hover,
.topic-table-actions button:hover,
.topic-table-row-actions button:hover,
.topic-table-column-actions button:hover,
.topic-bullet-actions button:hover,
.topic-bullet-block-actions button:hover,
.topic-paragraph-actions button:hover,
.topic-callout-actions button:hover,
.topic-code-actions button:hover,
.topic-image-actions button:hover,
.topic-image-replace-button:hover {
    background: #DADADA;
    color: #1C1C1C;
}

.topic-section-actions,
.topic-table-actions,
.topic-table-row-actions,
.topic-table-column-actions,
.topic-bullet-actions,
.topic-bullet-block-actions,
.topic-callout-actions,
.topic-code-actions,
.topic-image-actions,
.topic-paragraph-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    margin-bottom: 6px;
}

.topic-image-replace-button {
    margin-top: 8px;
    display: inline-flex;
}

.topic-table-actions {
    margin-top: 10px;
    margin-bottom: 10px;
}

.topic-bullet-block-actions {
    margin-top: 8px;
}

button[data-insert-menu-toggle] {
    background: #E8F3FF;
    color: #1C1C1C;
    border:1px solid lightgrey;
}

button[data-insert-menu-toggle]:hover {
    background: #D7EAFF;
    color: #1C1C1C;
}

button[data-callout-type-toggle][data-callout-target-type="success"] {
    background: #E4F6E8;
    color: #135A23;
}

button[data-callout-type-toggle][data-callout-target-type="success"]:hover {
    background: #CFF0D6;
    color: #135A23;
}

button[data-callout-type-toggle][data-callout-target-type="info"] {
    background: #E8F3FF;
    color: #1C4E7A;
}

button[data-callout-type-toggle][data-callout-target-type="info"]:hover {
    background: #D7EAFF;
    color: #1C4E7A;
}

button[data-callout-type-toggle][data-callout-target-type="warning"] {
    background: #FFE9D6;
    color: #7A4A11;
}

button[data-callout-type-toggle][data-callout-target-type="warning"]:hover {
    background: #FFDDBB;
    color: #7A4A11;
}

button[data-callout-type-toggle][data-callout-target-type="danger"] {
    background: #FFE4E4;
    color: #7A1111;
}

button[data-callout-type-toggle][data-callout-target-type="danger"]:hover {
    background: #FFD0D0;
    color: #7A1111;
}

.topic-insert-menu {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 6px;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    background: #ffffff;

}

.topic-insert-menu[hidden] {
    display: none;
}

.topic-insert-menu button {
    padding: 2px 8px;
    border-radius: 6px;
    background: #EDEDED;
    color: #1C1C1C;
    font-size: 0.8rem;
}

.topic-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    background: transparent;
    border: 1px solid #d4d4d4;
}


.topic-data-table td {
    border: 1px solid #d4d4d4;
    padding: 10px 12px;
    vertical-align: top;
}

.topic-table-row-actions-cell {
    width: 1%;
    padding: 6px;
    white-space: nowrap;
}

.topic-table-column-actions-row td {
    border-top: 0;
    border-bottom: 0;
    padding: 6px;
    background: transparent;
}

.topic-table-column-actions-cell {
    text-align: center;
}

.topic-table-column-actions-cell-corner {
    width: 1%;
}

.topic-table-row-actions {
    justify-content: center;
    margin: 0;
}

.topic-table-row-actions button,
.topic-table-column-actions button {
    min-width: 32px;
    padding-inline: 8px;
}

.topic-table-column-actions {
    justify-content: center;
    margin: 0;
}

.topic-data-table .knowledgebase-inline-editable {
    display: block;
    min-height: 1.4em;
    border-bottom: 0;
}

.topic-data-table .knowledgebase-table-cell-editor {
    white-space: pre-wrap;
    word-break: break-word;
}

.topic-data-table .knowledgebase-inline-editable:focus {
    background: rgba(28, 28, 28, 0.03);
}

.topic-image .topic-image-actions {
    position: static;
    margin-top: 8px;
    margin-bottom: 0;
}

.knowledgebase-debug-block-divider {
    margin: 20px 0 0;
    border: 0;
    border-top: 1px solid lightgrey;
}

/*.knowledge-base hr {
    opacity: 1;
}*/

.topic-card ul {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.topic-bullet-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 8px;
    position: relative;
    padding-left: 22px;
    padding-right: 8px;
    min-height: 24px;
}

.topic-bullet-item .topic-bullet-actions {
    display: flex;
    margin: 0;
    grid-column: 2;
    align-items: center;
    justify-self: end;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.topic-bullet-item:hover .topic-bullet-actions,
.topic-bullet-item:focus-within .topic-bullet-actions {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.topic-bullet-item .knowledgebase-inline-editable {
    grid-column: 1;
    min-width: 0;
}

.topic-card li.topic-bullet-item::before {
    left: 0;
}

.topic-bullet-item-readonly {
    display: block;
    position: relative;
    padding-left: 22px;
    padding-right: 0;
    min-height: 0;
}

.topic-card li + li {
    margin-top: 6px;
}

.topic-card li {
    line-height: 1.6;
}

.topic-card li::before {
    content: '';
    position: absolute;
    left: 26px;
    top: 0.72em;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: linear-gradient(135deg, #1C1C1C 0%, #5c5c5c 100%);
    /*box-shadow: 0 0 0 4px rgba(28, 28, 28, 0.08);*/
}

.chapter-list li::before,
.subchapter-list li::before {
    content: none;
}

.topic-card li.topic-bullet-item-readonly::before {
    left: 0;
}

.topic-code-block {
    margin-top: 16px;
}

.topic-content-block-callout {
    margin-top: 16px;
}

.knowledgebase-callout {
    position: relative;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    border-radius: 14px;
    padding: 14px 16px;
    padding-left: 20px;
    border: 1px solid transparent;
}

.knowledgebase-callout::before {
    content: '';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-height: 100%;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
}

.knowledgebase-callout-info {
    background: #eaf5ff;
    border-color: #c8e3ff;
    color: #174a74;
}

.knowledgebase-callout-info::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233f8fd3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3Cpath d='M8 14c-1.6-1.2-2.5-3-2.5-5A6.5 6.5 0 0 1 12 2.5 6.5 6.5 0 0 1 18.5 9c0 2-.9 3.8-2.5 5l-1 1.5h-6L8 14Z'/%3E%3C/svg%3E");
}

.knowledgebase-callout-warning {
    background: #fff2e4;
    border-color: #ffd3a8;
    color: #8a4b08;
}

.knowledgebase-callout-warning::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23d18a28' d='M12 3 22 21H2L12 3Z'/%3E%3Crect x='11' y='8' width='2' height='7' rx='1' fill='white'/%3E%3Ccircle cx='12' cy='18' r='1.2' fill='white'/%3E%3C/svg%3E");
}

.knowledgebase-callout-success {
    background: #eaf8ee;
    border-color: #cfead6;
    color: #135a23;
}

.knowledgebase-callout-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236ac58a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 9.5 17 19 7.5'/%3E%3C/svg%3E");
}

.knowledgebase-callout-danger {
    background: #ffecec;
    border-color: #ffd0d0;
    color: #7a1111;
}

.knowledgebase-callout-danger::before {
    content: '!';
    background-image: none;
    color: #d46565;
}

.knowledgebase-callout-body,
.knowledgebase-callout-editor {
    grid-column: 2;
    min-height: 1.5em;
}

.knowledgebase-callout-editor:focus {
    background: rgba(255, 255, 255, 0.35);
}

.topic-callout-actions {
    grid-column: 2;
    margin-top: 10px;
    margin-bottom: 0;
}

.topic-code-label {
    margin-bottom: 8px;
    font-weight: 700;
}

.topic-code-block pre {
    margin: 0;
    background: #ffffff;
}

.topic-code-block code {
    font-family: Consolas, "Courier New", monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.topic-code-block code .knowledgebase-inline-editable {
    display: block;
    min-height: 1.5em;
}

.topic-image {
    margin: 16px 0 0;
    width: 100%;
    max-width: 100%;
    text-align: center;
    position: relative;
}

.topic-image-media {
    position: relative;
    width: var(--topic-image-width, 100%);
    max-width: 100%;
    margin: 0 auto;
}

.topic-image img {
    display: block;
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid #dedede;
    background: #ffffff;
}

.topic-image figcaption {
    width: var(--topic-image-width, 100%);
    max-width: 100%;
    margin: 8px auto 0;
    font-size: 0.95rem;
    color: #444444;
}

.topic-image figcaption .knowledgebase-inline-editable {
    display: inline-block;
}

.topic-image-debug {
    position: absolute;
    top: 0px;
    right: 0px;
    padding: 0px;
    border-radius: 10px;
    background: transparent;
    border: 0;
    z-index: 1;
}

.topic-image-debug input {
    width: 64px;
    padding: 6px 8px;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    background: #ffffff;
    color: #1C1C1C;
    font: inherit;
}

.empty-state {
    display: none;
    padding: 20px;
    border-radius: 10px;
    background: #F5F5F5;
    border: 1px dashed #cfcfcf;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 900px) {
    .knowledge-base-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .sidebar-panel {
        position: static;
        top: auto;
        max-height: none;
        overflow-y: visible;
    }

    .content-panel {
        max-height: none;
        overflow-y: visible;
    }

    .knowledge-base-page {
        padding: 16px 12px 24px;
    }

    .sidebar-panel,
    .content-panel,
    .topic-card {
        padding: 16px;
    }

    .chapter-title-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .chapter-title {
        min-width: 0;
    }

    .subchapter-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .sidebar-link {
        min-width: 0;
        word-break: break-word;
    }

    .topic-section-actions,
    .topic-code-actions,
    .topic-image-actions,
    .topic-paragraph-actions,
    .knowledgebase-debug-topic-controls {
        gap: 8px;
    }

    .topic-section-actions button,
    .topic-code-actions button,
    .topic-image-actions button,
    .topic-paragraph-actions button,
    .knowledgebase-debug-topic-controls button,
    .chapter-add-topic-button,
    .topic-image-replace-button {
        width: 100%;
    }

    .topic-image-debug {
        position: static;
        margin-bottom: 8px;
        display: flex;
        justify-content: flex-end;
    }

    .topic-image figcaption {
        width: 100%;
    }

    pre {
        font-size: 0.9rem;
    }
}
