/* Instruction wiki: sidebar with the document list, main area switching
   between rendered view (.dlg-doc), CodeMirror editor and history. */

.iw-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.iw-sidebar {
    flex: 0 0 220px;
    border-right: 1px solid var(--app-border, #ddd);
    padding-right: 12px;
}

.iw-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.iw-sidebar__title {
    font-weight: 600;
}

.iw-doc-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.iw-doc-list__item {
    padding: 3px 6px;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    overflow-wrap: anywhere;
}

.iw-doc-list__item:hover {
    background: rgba(127, 127, 127, 0.12);
}

.iw-doc-list__item--active {
    background: rgba(127, 127, 127, 0.18);
    font-weight: 600;
}

.iw-main {
    flex: 1 1 auto;
    min-width: 0;
}

.iw-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.iw-doc-title {
    font-weight: 600;
    font-size: 1.1em;
    margin-right: auto;
}

.iw-toolbar__actions {
    display: flex;
    gap: 6px;
}

.iw-btn {
    padding: 3px 10px;
    border: 1px solid var(--app-border, #ccc);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    color: inherit;
}

.iw-btn--active {
    background: rgba(127, 127, 127, 0.18);
    font-weight: 600;
}

.iw-btn--primary {
    border-color: #3b6ea5;
    color: #3b6ea5;
    font-weight: 600;
}

.iw-btn--danger {
    border-color: #a54040;
    color: #a54040;
}

.iw-editor .cm-editor {
    min-height: 420px;
    border: 1px solid var(--app-border, #ccc);
    border-radius: 4px;
    font-size: 14px;
}

.iw-history__row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--app-border, #eee);
}

.iw-history__row span {
    margin-right: auto;
}

.iw-history__detail {
    margin-top: 12px;
}

.iw-diff {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.iw-diff ins {
    background: rgba(60, 160, 60, 0.25);
    text-decoration: none;
}

.iw-diff del {
    background: rgba(200, 60, 60, 0.25);
}
