.knowledge-panel {
    position: fixed;
    z-index: 20;
    width: 310px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 12px;
    border: 3px solid #e6bf61;
    border-radius: 0;
    background: #f4e7bd;
    box-shadow: 0 0 0 4px #263d2b, 6px 7px 0 #101e1acc;
    color: #263d2b;
}

.world-settings-panel {
    position: fixed;
    z-index: 20;
    display: grid;
    gap: 8px;
    width: 310px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 12px;
    border: 3px solid #e6bf61;
    background: #f4e7bd;
    box-shadow: 0 0 0 4px #263d2b, 6px 7px 0 #101e1acc;
    color: #263d2b;
}

.knowledge-panel[hidden] { display: none; }
.world-settings-panel[hidden] { display: none; }

.configuration-picker {
    display: grid;
    gap: 5px;
    padding-bottom: 8px;
    border-bottom: 1px solid #d9dfca;
    font-size: 12px;
}

.configuration-user-controls {
    display: flex;
    gap: 5px;
}

.configuration-user-controls input { flex: 1; }
#configuration-status { font-size: 11px; }
#configuration-status.status-saved { color: #52674a; }
#configuration-status.status-error { color: #a44232; }

.knowledge-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.close-knowledge-panel {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #52674a;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.knowledge-item-list {
    display: grid;
    gap: 7px;
}

.knowledge-item-editor,
.knowledge-add {
    display: grid;
    gap: 8px;
}

.knowledge-add {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #d9dfca;
}

.knowledge-item-editor + .knowledge-item-editor {
    padding-top: 8px;
    border-top: 1px solid #d9dfca;
}

.knowledge-item-fields {
    display: grid;
    gap: 6px;
}

.knowledge-item-options {
    display: grid;
    gap: 7px;
}

.knowledge-choice-field {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.knowledge-choice-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.knowledge-choice-buttons button {
    flex: 1 1 26px;
    padding: 0 4px;
    font-size: 11px;
}

.knowledge-choice-buttons button[aria-pressed="true"] {
    border-color: #263d2b;
    background: #52674a;
    color: #fff9e7;
}

.knowledge-item-options > .delete-knowledge {
    justify-self: end;
}

.knowledge-field {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.knowledge-field-label {
    color: #665536;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.knowledge-panel select,
.knowledge-panel input,
.knowledge-panel textarea,
.knowledge-panel button,
.world-settings-panel select,
.world-settings-panel input,
.world-settings-panel textarea,
.world-settings-panel button {
    min-width: 0;
    border: 2px solid #8a7950;
    border-radius: 0;
    background: #fff9e7;
    color: #263d2b;
    font: inherit;
}

.knowledge-panel select,
.knowledge-panel input,
.knowledge-panel button,
.world-settings-panel select,
.world-settings-panel input,
.world-settings-panel button {
    height: 32px;
}

.knowledge-panel input,
.world-settings-panel input { padding: 6px 8px; }
.knowledge-panel select,
.world-settings-panel select { padding: 0 5px; }
.world-settings-panel textarea {
    min-height: 64px;
    padding: 6px 8px;
    resize: vertical;
}

.knowledge-panel button,
.world-settings-panel button {
    padding: 0 7px;
    cursor: pointer;
}

.world-settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.world-settings-actions button { flex: 1; }
.world-settings-actions .reset-animals { flex-basis: 100%; }

.knowledge-panel .delete-knowledge,
.world-settings-panel .delete-world {
    border-color: #a45b42;
    background: #f3d9bd;
    color: #743b2d;
}

.world-settings-panel button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
