html, body {
    margin: 0;
    overflow-x: clip;
    padding: 0;
}

/* Wissenstraining */
.wt-shell {
    box-sizing: border-box;
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    color: #071a3a;
}

.wt-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.wt-page-header h1,
.wt-question-workspace h1,
.wt-feedback h1,
.wt-result-summary h1 {
    margin: 0 0 10px;
    color: #071a3a;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.wt-page-header p,
.wt-result-summary > p {
    max-width: 720px;
    margin: 0;
    color: #53627a;
    font-size: 17px;
    line-height: 1.6;
}

.wt-picker {
    display: grid;
    gap: 0;
    border: 1px solid #d8e0eb;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.wt-picker-step {
    display: grid;
    grid-template-columns: minmax(210px, .7fr) minmax(0, 1.8fr);
    gap: 28px;
    padding: 28px;
    border-bottom: 1px solid #e2e8f0;
}

.wt-step-heading {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.wt-step-heading > span {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border: 1px solid #93b9ea;
    border-radius: 50%;
    color: #0052b4;
    font-weight: 900;
}

.wt-step-heading h2,
.wt-step-heading p { margin: 0; }
.wt-step-heading h2 { font-size: 20px; }
.wt-step-heading p { margin-top: 6px; color: #66758b; font-size: 14px; line-height: 1.45; }

.wt-course-rail {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 2px 8px;
}

.wt-course-option,
.wt-chapter-option,
.wt-section-option {
    border: 1px solid #cfd8e5;
    background: #fff;
    color: #14233e;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.wt-course-option {
    display: grid;
    gap: 6px;
    flex: 0 0 250px;
    min-height: 96px;
    padding: 18px;
    border-radius: 10px;
}

.wt-course-option span,
.wt-chapter-option small,
.wt-section-option small { color: #68778d; }

.wt-course-option.is-active,
.wt-chapter-option.is-active,
.wt-section-option.is-active {
    border-color: #0052b4;
    background: #f3f8ff;
    box-shadow: 0 0 0 2px rgba(0, 82, 180, .12);
}

.wt-course-description { display: none; grid-column: 2; color: #53627a; }
.wt-course-description.is-active { display: block; }
.wt-course-description p { margin: 0; }
.wt-chapter-list,
.wt-section-list { display: none; gap: 10px; }
.wt-chapter-list.is-active,
.wt-section-list.is-active { display: grid; }

.wt-chapter-option,
.wt-section-option {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
    min-height: 66px;
    padding: 12px 16px;
    border-radius: 10px;
}

.wt-chapter-option > span:last-child,
.wt-section-option > span:last-child { display: grid; gap: 4px; }
.wt-active-arrow { visibility: hidden; color: #0052b4; font-size: 22px; }
.wt-chapter-option.is-active .wt-active-arrow { visibility: visible; }
.wt-radio-dot { width: 14px; height: 14px; border: 2px solid #8da0b8; border-radius: 50%; }
.wt-section-option.is-active .wt-radio-dot { border: 4px solid #0052b4; }
.wt-section-option.is-locked {
    cursor: not-allowed;
    opacity: .62;
    background: #f5f7fa;
}
.wt-section-option.is-locked .wt-radio-dot { border-style: dashed; }

.wt-start-bar {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    align-items: end;
    padding: 24px 28px;
    background: #f7faff;
}
.wt-start-bar label { display: grid; gap: 6px; color: #3f4f66; font-weight: 700; }
.wt-start-bar select { min-height: 44px; border: 1px solid #bdc9d8; border-radius: 8px; background: #fff; padding: 0 38px 0 12px; font: inherit; }

.wt-training-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: calc(100vh - 106px);
    margin: -32px;
    color: #071a3a;
    background: #fff;
}

.wt-progress-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 36px;
    padding: 42px 34px 30px;
    border-right: 1px solid #d8e0eb;
    background: #f4f9ff;
}
.wt-progress-sidebar h2 { margin: 0 0 18px; font-size: 20px; }
.wt-progress-track { height: 6px; margin-bottom: 22px; overflow: hidden; border-radius: 10px; background: #dbe7f5; }
.wt-progress-track span { display: block; height: 100%; background: #0052b4; }
.wt-progress-list { display: grid; gap: 16px; margin: 0; }
.wt-progress-list div { display: flex; justify-content: space-between; gap: 14px; }
.wt-progress-list dt { color: #53627a; }
.wt-progress-list dd { margin: 0; font-weight: 850; }
.wt-help-list { margin-top: 36px; padding-top: 28px; border-top: 1px solid #d2deec; }
.wt-help-button { min-height: 44px; width: 100%; border: 1px solid #e39b17; border-radius: 8px; background: #fffaf0; color: #9a5a00; font: inherit; font-weight: 800; cursor: pointer; }
.wt-leave-link { color: #0052b4; font-weight: 800; text-decoration: none; }

.wt-question-workspace { width: min(840px, calc(100% - 64px)); margin: 0 auto; padding: 42px 0 70px; }
.wt-question-context { margin: 0 0 18px; color: #0052b4; font-weight: 750; }
.wt-question-copy { color: #172641; font-size: 18px; line-height: 1.65; }
.wt-question-copy p:first-child { margin-top: 0; }
.wt-answer-form { display: grid; gap: 24px; margin-top: 26px; }
.wt-answer-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.wt-answer-field legend { margin-bottom: 10px; font-weight: 800; }
.wt-answer-field input[type="text"],
.wt-answer-field input[type="number"],
.wt-answer-field textarea,
.wt-answer-field select,
.wt-admin-editor input,
.wt-admin-editor textarea,
.wt-admin-editor select {
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    border: 1px solid #b9c6d6;
    border-radius: 8px;
    background: #fff;
    color: #071a3a;
    font: inherit;
    padding: 11px 13px;
}
.wt-answer-field textarea,
.wt-admin-editor textarea { resize: vertical; }
.wt-answer-field input:focus,
.wt-answer-field textarea:focus,
.wt-answer-field select:focus { outline: 3px solid rgba(0, 82, 180, .18); border-color: #0052b4; }

.wt-choice-list { display: grid; gap: 12px; }
.wt-choice-list label { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 0 18px; border: 1px solid #c7d1df; border-radius: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.wt-choice-list label:hover { border-color: #6b9bd5; background: #f8fbff; }
.wt-choice-list label:has(input:checked) { border-color: #0052b4; background: #edf5ff; box-shadow: 0 0 0 2px rgba(0, 82, 180, .12); }
.wt-choice-list input { width: 20px; height: 20px; accent-color: #0052b4; }
.wt-answer-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.wt-answer-actions .button-primary,
.wt-answer-actions .button-secondary,
.wt-feedback .button-primary { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; box-sizing: border-box; padding: 0 22px; border-radius: 8px; text-decoration: none; }

.wt-field-matching { display: grid; gap: 14px; }
.wt-matching-instruction { margin: 0; color: #607089; }
.wt-matching-mobile-copy { display: none; }
.wt-matching-board { position: relative; display: grid; grid-template-columns: minmax(210px, 1fr) minmax(210px, 1fr); gap: clamp(110px, 16vw, 210px); padding: 8px 0; }
.wt-matching-sources,
.wt-matching-targets { position: relative; z-index: 2; display: grid; gap: 18px; align-content: start; }
.wt-matching-source-row { display: grid; }
.wt-matching-card { position: relative; display: flex; align-items: center; min-height: 62px; box-sizing: border-box; padding: 12px 18px; border: 1px solid #b8c7d7; border-radius: 11px; background: #fff; color: #14243f; font: inherit; font-weight: 800; line-height: 1.35; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s, transform .15s; }
.wt-matching-source { justify-content: space-between; background: #edf6f8; }
.wt-matching-target { justify-content: flex-start; }
.wt-matching-card:hover,
.wt-matching-card:focus-visible { border-color: #087f86; outline: 0; box-shadow: 0 0 0 3px rgba(8, 127, 134, .13); }
.wt-matching-source.is-active { border-color: #0052b4; background: #e7f1fd; box-shadow: 0 0 0 3px rgba(0, 82, 180, .14); transform: translateX(3px); }
.wt-matching-card.is-matched { border-color: #4e9b83; }
.wt-matching-card i { position: absolute; top: 50%; width: 16px; height: 16px; border: 3px solid #fff; border-radius: 50%; background: #64717a; box-shadow: 0 0 0 1px #64717a; transform: translateY(-50%); }
.wt-matching-source i { right: -9px; }
.wt-matching-target i { left: -9px; }
.wt-matching-card.is-matched i { background: #087f86; box-shadow: 0 0 0 1px #087f86; }
.wt-matching-lines { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.wt-matching-lines path { fill: none; stroke: #65727a; stroke-width: 3; stroke-linecap: round; }
.wt-match-select-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.wt-matching-status { margin: 2px 0 0; color: #52647b; font-size: 14px; font-weight: 700; }

.wt-order-list { display: grid; gap: 9px; padding: 0; list-style: none; }
.wt-order-hint { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 10px; color: #617087; font-size: 14px; }
.wt-order-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 54px; padding: 0 12px; border: 1px solid #c7d1df; border-radius: 8px; background: #fff; transition: opacity .15s, box-shadow .15s, border-color .15s; }
.wt-order-list li[draggable="true"] { cursor: grab; }
.wt-order-list li[draggable="true"]:active { cursor: grabbing; }
.wt-order-list li.is-dragging { opacity: .45; border-color: #0052b4; box-shadow: 0 8px 22px rgba(0, 52, 112, .14); }
.wt-order-drag-handle { color: #6d7e94; font-size: 24px; line-height: 1; }
.wt-order-label { min-width: 0; }
.wt-order-buttons { display: flex; gap: 5px; }
.wt-order-list button,
.wt-chem-keyboard button { min-width: 40px; min-height: 38px; border: 1px solid #b8c5d4; border-radius: 7px; background: #fff; color: #14233e; font: inherit; font-weight: 800; cursor: pointer; }

.wt-formula-editor { display: grid; gap: 14px; }
.wt-formula-editor math-field { min-height: 72px; box-sizing: border-box; border: 1px solid #9fb1c6; border-radius: 9px; padding: 14px; font-size: 28px; }
.wt-formula-editor math-field:focus-within { border-color: #0052b4; outline: 3px solid rgba(0, 82, 180, .15); }
.wt-chem-keyboard { display: grid; gap: 10px; }
.wt-chem-keyboard-group { display: grid; gap: 7px; padding: 10px 12px 12px; border: 1px solid #d7e0eb; border-radius: 9px; background: #f8fafc; }
.wt-chem-keyboard-group.is-numbers { border-color: #a9c9ec; background: #f0f7ff; }
.wt-chem-keyboard-group > strong { color: #4d5e75; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.wt-chem-keyboard-group > div { display: flex; flex-wrap: wrap; gap: 8px; }
.wt-chem-keyboard button { min-width: 54px; }
.wt-review-request { display: grid; gap: 7px; margin: 18px 0; justify-items: start; }
.wt-review-request [data-review-request-status] { color: #52647b; font-size: 14px; }
.wt-formula-preview { display: flex; gap: 14px; align-items: center; min-height: 44px; padding: 8px 12px; border-left: 3px solid #0052b4; background: #f4f9ff; }
.wt-formula-preview > span { color: #5c6b80; font-size: 13px; font-weight: 800; text-transform: uppercase; }

.wt-help-dialog { width: min(560px, calc(100% - 48px)); border: 0; border-radius: 12px; color: #071a3a; padding: 30px; box-shadow: 0 24px 70px rgba(7, 26, 58, .25); }
.wt-help-dialog::backdrop { background: rgba(7, 26, 58, .48); }
.wt-dialog-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; font-size: 28px; cursor: pointer; }
.wt-mobile-progress-toggle { display: none; }

.wt-feedback-shell,
.wt-result-shell { padding-top: 50px; }
.wt-feedback,
.wt-result-summary { max-width: 820px; margin: 0 auto; }
.wt-feedback { display: grid; grid-template-columns: 72px 1fr; gap: 24px; padding: 34px; border: 1px solid #b8ddcc; border-radius: 12px; background: #f3fbf7; }
.wt-feedback.is-wrong { border-color: #efd0c9; background: #fff7f5; }
.wt-feedback.is-pending { border-color: #ead49d; background: #fffaf0; }
.wt-feedback.is-information { border-color: #b9d4f3; background: #f2f7fd; }
.wt-feedback.is-joke { border-color: #e7bd66; background: #fff8e8; }
.wt-feedback-symbol { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: #1c9568; color: #fff; font-size: 34px; font-weight: 900; }
.wt-feedback.is-wrong .wt-feedback-symbol { background: #bd4a38; }
.wt-feedback.is-pending .wt-feedback-symbol { background: #b87908; }
.wt-feedback.is-information .wt-feedback-symbol { background: #0052b4; font-family: Georgia, serif; font-style: italic; }
.wt-feedback.is-joke .wt-feedback-symbol { background: #d89219; }
.wt-explanation { margin: 20px 0 24px; line-height: 1.6; }
.wt-answer-form.is-locked { opacity: .82; }
.wt-inline-feedback { max-width: none; margin: 34px 0 0; }
.wt-inline-feedback h2 { margin: 0 0 10px; font-size: 27px; }
.wt-inline-feedback .wt-question-context { margin-bottom: 8px; }

.wt-result-summary { padding: 38px; border: 1px solid #d4dfeb; border-radius: 12px; }
.wt-result-values { display: grid; grid-template-columns: repeat(3, 1fr); margin: 34px 0; border-block: 1px solid #dce3ec; }
.wt-result-values div { display: grid; gap: 7px; padding: 24px; text-align: center; }
.wt-result-values div + div { border-left: 1px solid #dce3ec; }
.wt-result-values strong { color: #0052b4; font-size: 34px; }
.wt-result-values span { color: #5b6a7e; }

.wt-admin-layout { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(0, 1.3fr); gap: 28px; }
.wt-admin-editor,
.wt-admin-list,
.wt-results-table { padding: 24px; border: 1px solid #d6deea; border-radius: 10px; background: #fff; }
.wt-admin-editor h2,
.wt-admin-list h2,
.wt-results-table h2 { margin-top: 0; }
.wt-admin-editor small { color: #68778d; font-weight: 400; }
.wt-inline-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; }
.wt-inline-check input { width: auto; min-height: auto; }
.wt-results-table { margin-top: 28px; }
.wt-table-wrap { overflow-x: auto; }
.wt-table-wrap table { width: 100%; border-collapse: collapse; }
.wt-table-wrap th,
.wt-table-wrap td { padding: 11px 12px; border-bottom: 1px solid #e2e8f0; text-align: left; white-space: nowrap; }
.wt-table-wrap th { color: #526177; font-size: 12px; text-transform: uppercase; }

.wt-admin-kicker { margin: 0 0 6px; color: #0f766e; font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.wt-admin-header-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.wt-admin-header-actions .button-primary,
.wt-admin-header-actions .button-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box; padding: 0 18px; border-radius: 8px; text-decoration: none; }
.wt-admin-workbench { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 24px; align-items: start; }
.wt-question-catalog,
.wt-question-editor { min-width: 0; border: 1px solid #d4deea; border-radius: 12px; background: #fff; box-shadow: 0 12px 34px rgba(20, 44, 75, .06); scroll-margin-top: 20px; }
.wt-question-editor:target { border-color: #8eb9ec; box-shadow: 0 0 0 4px rgba(0, 82, 180, .08), 0 12px 34px rgba(20, 44, 75, .06); }
.wt-question-catalog { position: sticky; top: 18px; overflow: hidden; }
.wt-catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px; border-bottom: 1px solid #dce5ef; }
.wt-catalog-heading > div { display: grid; gap: 3px; }
.wt-catalog-heading span { color: #5b6b81; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.wt-catalog-heading strong { color: #0b1e3b; font-size: 20px; }
.wt-catalog-heading > a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: #0052b4; color: #fff; font-size: 24px; line-height: 1; text-decoration: none; }
.wt-question-list { max-height: min(720px, calc(100vh - 210px)); overflow-y: auto; }
.wt-question-tree { max-height: min(760px, calc(100vh - 190px)); overflow-y: auto; padding: 10px; }
.wt-question-tree details { margin: 0; }
.wt-question-tree summary { cursor: pointer; }
.wt-tree-course > summary { padding: 10px 9px; color: #0b2e57; font-weight: 850; }
.wt-tree-chapter { margin-left: 10px !important; border-left: 2px solid #c7d8eb; }
.wt-tree-chapter > summary { padding: 8px 10px; color: #304968; font-weight: 750; }
.wt-tree-section { margin: 3px 0 8px 12px !important; }
.wt-tree-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 7px; background: #f2f6fb; font-size: 13px; font-weight: 750; }
.wt-tree-section > summary small { display: grid; flex: 0 0 24px; place-items: center; min-height: 24px; border-radius: 999px; background: #dceafb; color: #174a82; }
.wt-tree-section ol { min-height: 30px; margin: 5px 0 0; padding: 4px 0; list-style: none; transition: background .15s; }
.wt-tree-section ol.is-drag-over { outline: 2px dashed #3983d6; border-radius: 8px; background: #eaf4ff; }
.wt-tree-question { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 7px; align-items: center; margin: 4px 0; padding: 8px; border: 1px solid transparent; border-radius: 7px; background: #fff; }
.wt-tree-question:hover { border-color: #cfdae7; }
.wt-tree-question.is-active { border-color: #8eb9ec; background: #edf5ff; }
.wt-tree-question.is-dragging { opacity: .45; }
.wt-tree-question.is-closer { border-color: #e8c47a; background: #fff9e9; }
.wt-tree-question > a { display: grid; gap: 2px; min-width: 0; color: #14233e; text-decoration: none; }
.wt-tree-question > a small { overflow: hidden; color: #68778d; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.wt-tree-question > a strong { overflow: hidden; font-size: 13px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.wt-drag-handle { color: #6c7e94; cursor: grab; font-size: 19px; }
.wt-tree-move-controls { display: flex; gap: 3px; }
.wt-tree-move-controls button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid #c4d0df; border-radius: 5px; background: #fff; color: #174a82; cursor: pointer; }
.wt-move-dialog { width: min(560px, calc(100% - 30px)); padding: 28px; border: 0; border-radius: 12px; box-shadow: 0 24px 70px rgba(9, 28, 53, .3); }
.wt-move-dialog::backdrop { background: rgba(4, 16, 34, .45); }
.wt-question-list-item { display: grid; gap: 8px; padding: 16px 18px; border-bottom: 1px solid #e3e9f1; color: #152640; text-decoration: none; transition: background .15s, box-shadow .15s; }
.wt-question-list-item:hover { background: #f6f9fd; }
.wt-question-list-item.is-active { background: #edf5ff; box-shadow: inset 4px 0 #0052b4; }
.wt-question-list-item > strong { font-size: 16px; line-height: 1.35; }
.wt-question-list-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #627087; font-size: 11px; font-weight: 750; }
.wt-status-dot { color: #7a5b08; }
.wt-status-dot.is-published { color: #14714f; }
.wt-question-list-meta { color: #66758a; font-size: 12px; }
.wt-question-editor { overflow: hidden; }
.wt-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 28px; border-bottom: 1px solid #dce5ef; background: #f8fbff; }
.wt-editor-heading p { margin: 0 0 4px; color: #607089; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.wt-editor-heading h2 { margin: 0; font-size: 28px; }
.wt-type-badge { padding: 7px 11px; border: 1px solid #a9c9ee; border-radius: 999px; background: #edf5ff; color: #0052b4; font-size: 12px; font-weight: 800; }
.wt-editor-form { display: grid; }
.wt-editor-section { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; padding: 28px; border-bottom: 1px solid #e0e7f0; }
.wt-editor-section-title { display: flex; align-items: flex-start; gap: 12px; }
.wt-editor-section-title > span { display: grid; flex: 0 0 30px; place-items: center; width: 30px; height: 30px; border: 1px solid #8eb9ec; border-radius: 50%; color: #0052b4; font-size: 13px; font-weight: 850; }
.wt-editor-section-title h3 { margin: 2px 0 5px; font-size: 18px; }
.wt-editor-section-title p { margin: 0; color: #67768b; font-size: 13px; line-height: 1.45; }
.wt-editor-fields { display: grid; gap: 18px; min-width: 0; }
.wt-editor-fields label { display: grid; gap: 8px; min-width: 0; color: #1f2d43; font-weight: 750; }
.wt-editor-fields label small { color: #68778d; font-weight: 400; line-height: 1.4; }
.wt-editor-fields input,
.wt-editor-fields textarea,
.wt-editor-fields select { box-sizing: border-box; width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid #b9c7d8; border-radius: 8px; background: #fff; color: #071a3a; font: inherit; }
.wt-editor-fields textarea { resize: vertical; line-height: 1.5; }
.wt-editor-fields input:focus,
.wt-editor-fields textarea:focus,
.wt-editor-fields select:focus { outline: 3px solid rgba(0, 82, 180, .15); border-color: #0052b4; }
.wt-answer-field-editor-list { display: grid; gap: 18px; min-width: 0; }
.wt-answer-field-editor { overflow: hidden; border: 1px solid #cfdae7; border-radius: 10px; background: #fbfdff; }
.wt-answer-field-editor > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid #dce5ef; background: #f1f6fc; }
.wt-answer-field-editor > header > div { display: flex; align-items: center; gap: 10px; }
.wt-answer-field-editor > header span { color: #627188; font-size: 12px; font-weight: 800; }
.wt-answer-field-editor > header strong { color: #0a3265; }
.wt-answer-field-editor .wt-editor-fields { padding: 18px; }
.wt-manual-note { padding: 13px 15px; border-left: 3px solid #d69a22; background: #fff8e8; color: #6f4b07; line-height: 1.5; }
.wt-editor-options { display: grid; gap: 12px; min-width: 0; }
.wt-keyword-rule-editor { display: grid; gap: 14px; padding: 18px; border: 1px solid #b9d4f3; border-radius: 10px; background: #f4f8fd; }
.wt-keyword-rule-editor[hidden] { display: none !important; }
.wt-keyword-rule-editor h4 { margin: 0; color: #123258; font-size: 17px; }
.wt-keyword-rule-editor > p { margin: -6px 0 0; color: #52657c; font-size: 14px; line-height: 1.5; }
.wt-keyword-rule-editor label { display: grid; gap: 7px; color: #1f2d43; font-weight: 750; }
.wt-keyword-rule-editor textarea { box-sizing: border-box; width: 100%; padding: 10px 12px; border: 1px solid #b9c7d8; border-radius: 8px; background: #fff; color: #071a3a; font: inherit; line-height: 1.45; }
.wt-review-shell { display: grid; gap: 24px; }
.wt-review-list { display: grid; gap: 20px; }
.wt-review-card,
.wt-empty-review { padding: 26px; border: 1px solid #d2dce8; border-radius: 12px; background: #fff; box-shadow: 0 8px 24px rgba(28, 54, 85, .06); }
.wt-review-card > header { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid #e2e8f0; }
.wt-review-card > header span { color: #0052b4; font-size: 12px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.wt-review-card > header h2 { margin: 4px 0 0; }
.wt-review-meta { display: grid; gap: 5px; justify-items: end; text-align: right; }
.wt-review-meta span { color: #52657c !important; letter-spacing: 0 !important; text-transform: none !important; }
.wt-review-prompt { margin: 20px 0; }
.wt-review-answer { display: grid; gap: 8px; margin: 0 0 20px; padding: 16px; border-radius: 9px; background: #f4f7fb; }
.wt-review-answer > div { display: grid; grid-template-columns: minmax(100px, 180px) 1fr; gap: 12px; }
.wt-review-answer dt { color: #617087; font-weight: 750; }
.wt-review-answer dd { margin: 0; white-space: pre-wrap; }
.wt-review-form { display: grid; grid-template-columns: minmax(150px, 210px) minmax(280px, 1fr); grid-template-areas: "points correct" "points note" ". submit"; gap: 16px 22px; align-items: start; }
.wt-review-form > label { display: grid; gap: 7px; color: #1f2d43; font-weight: 750; }
.wt-review-form label small { color: #68778d; font-weight: 400; line-height: 1.4; }
.wt-review-points { grid-area: points; }
.wt-review-correct { grid-area: correct; }
.wt-review-note { grid-area: note; }
.wt-review-form input[type="number"],
.wt-review-form textarea { box-sizing: border-box; width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #b9c7d8; border-radius: 8px; font: inherit; }
.wt-review-form textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.wt-review-form .button-primary { grid-area: submit; justify-self: end; }
.wt-check-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; padding: 15px 16px; border: 1px solid #d2dce8; border-radius: 9px; background: #fbfdff; cursor: pointer; }
.wt-check-row input { width: 20px !important; min-height: 20px !important; margin: 2px 0 0; accent-color: #0052b4; }
.wt-check-row > span { display: grid; gap: 4px; min-width: 0; }
.wt-check-row strong { color: #14243f; }
.wt-check-row small { color: #68778d; font-weight: 400; line-height: 1.4; }
.wt-section-assignment { min-width: 0; margin: 0; padding: 0; border: 0; }
.wt-section-assignment > legend { margin-bottom: 6px; color: #1f2d43; font-weight: 800; }
.wt-section-assignment > p { margin: 0 0 14px; color: #617087; line-height: 1.5; }
.wt-section-assignment-list { display: grid; gap: 14px; max-height: 420px; overflow-y: auto; padding: 12px; border: 1px solid #cdd9e7; border-radius: 10px; background: #f8fbff; }
.wt-assignment-course { display: grid; gap: 8px; }
.wt-assignment-course h3 { margin: 0; color: #0d3767; font-size: 17px; }
.wt-assignment-course details { overflow: hidden; border: 1px solid #d9e2ec; border-radius: 8px; background: #fff; }
.wt-assignment-course summary { padding: 10px 12px; font-weight: 750; cursor: pointer; }
.wt-assignment-course details > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 10px 10px; }
.wt-assignment-option { display: grid !important; grid-template-columns: 20px minmax(0, 1fr); gap: 9px; align-items: start; padding: 10px; border: 1px solid #d7e0ea; border-radius: 7px; background: #fbfdff; cursor: pointer; }
.wt-assignment-option:has(input:checked) { border-color: #6da5e3; background: #edf6ff; }
.wt-assignment-option input { width: 18px !important; min-height: 18px !important; margin: 2px 0 0; accent-color: #0052b4; }
.wt-assignment-option span { display: grid; gap: 2px; }
.wt-assignment-option small { color: #68778d; font-weight: 400; }
.wt-assignment-status { margin: 10px 0 0 !important; color: #0052b4 !important; font-weight: 750; }
.wt-shared-question-warning { margin: 22px 28px 0; }
.wt-editor-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 20px 28px; background: #f8fbff; }
.wt-editor-footer .button-primary,
.wt-editor-footer .button-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; box-sizing: border-box; padding: 0 20px; border-radius: 8px; text-decoration: none; }
.wt-admin-shell .wt-results-table { margin-top: 24px; }

/* Dedicated authoring screens */
.wt-empty-editor { display: grid; gap: 18px; place-items: start; padding: 38px; }
.wt-empty-editor h2,
.wt-empty-editor p { margin: 0; }
.wt-empty-editor p { max-width: 680px; color: #607089; line-height: 1.55; }
.wt-author-shell,
.wt-structure-shell { display: grid; gap: 24px; }
.wt-author-form { display: grid; gap: 22px; }
.wt-author-form [hidden] { display: none !important; }
.wt-author-card,
.wt-structure-card { padding: 26px 28px; border: 1px solid #d4deea; border-radius: 12px; background: #fff; box-shadow: 0 9px 28px rgba(20, 44, 75, .05); }
.wt-author-card > header { display: grid; gap: 6px; margin-bottom: 22px; }
.wt-author-card > header h2,
.wt-author-card > header p { margin: 0; }
.wt-author-card > header p { color: #64748b; line-height: 1.5; }
.wt-author-card .wt-editor-fields { max-width: 900px; }
.wt-type-panels [data-type-panel][hidden] { display: none !important; }
.wt-type-guide { margin-bottom: 18px; padding: 15px 17px; border-left: 4px solid #0052b4; border-radius: 0 8px 8px 0; background: #eef6ff; color: #23405f; line-height: 1.55; }
.wt-type-guide code { padding: 2px 5px; border-radius: 4px; background: #dcecff; color: #003b7a; }
.wt-author-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 22px 26px; border: 1px solid #d4deea; border-radius: 12px; background: #f8fbff; }
.wt-cloze-author-preview { min-height: 74px; padding: 16px 18px; border: 1px dashed #9eb9d7; border-radius: 9px; background: #fbfdff; color: #1d304b; line-height: 2; }
.wt-cloze-author-preview:empty::before { content: "Die Vorschau erscheint hier."; color: #7b8798; }
.wt-cloze-preview-blank { display: inline-block; min-width: 90px; height: 1.5em; margin: 0 4px; border-bottom: 2px solid #0052b4; vertical-align: baseline; }
.wt-cloze-text { font-size: 18px; line-height: 2.45; }
.wt-cloze-blank { display: inline-block; margin: 0 4px; vertical-align: middle; }
.wt-cloze-blank input { box-sizing: border-box; width: clamp(120px, 20vw, 240px); min-height: 42px; padding: 7px 10px; border: 1px solid #9db2ca; border-radius: 7px; background: #fff; color: #071a3a; font: inherit; }
.wt-cloze-blank input:focus { outline: 3px solid rgba(0, 82, 180, .15); border-color: #0052b4; }
.wt-structure-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.wt-structure-card { display: grid; gap: 17px; }
.wt-structure-card h2,
.wt-structure-card h3,
.wt-structure-card p { margin: 0; }
.wt-structure-card > p { color: #64748b; line-height: 1.5; }
.wt-structure-card form { display: grid; gap: 14px; }
.wt-structure-tree { display: grid; gap: 18px; }
.wt-structure-course { padding: 18px; border: 1px solid #ccd8e6; border-radius: 10px; background: #fbfdff; }
.wt-structure-course > h3 { margin: 0 0 12px; }
.wt-structure-chapter { margin: 12px 0 0 18px; padding: 14px 16px; border-left: 3px solid #8eb9ec; background: #fff; }
.wt-structure-chapter h4 { margin: 0 0 9px; }
.wt-structure-sections { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.wt-structure-sections li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 11px; border-radius: 7px; background: #f2f6fb; }
.wt-structure-sections small { color: #637289; }
.wt-structure-explainer { display: flex; gap: 14px 22px; padding: 18px 22px; border: 1px solid #a9c9ee; border-radius: 10px; background: #eef6ff; color: #24425f; line-height: 1.5; }
.wt-structure-explainer strong { flex: 0 0 auto; color: #0052b4; }
.wt-structure-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px); gap: 24px; align-items: start; }
.wt-structure-tree { padding: 26px; border: 1px solid #d4deea; border-radius: 12px; background: #fff; }
.wt-structure-tree > h2 { margin-top: 0; }
.wt-course-tree { overflow: hidden; margin-top: 18px; border: 1px solid #ccd8e6; border-radius: 10px; }
.wt-course-tree > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 19px; background: #f2f7fd; }
.wt-course-tree > header span { color: #607089; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.wt-course-tree > header h3 { margin: 3px 0 0; }
.wt-chapter-tree { padding: 18px 20px; border-top: 1px solid #dce5ef; }
.wt-chapter-tree h4 { margin: 0 0 12px; }
.wt-chapter-tree ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.wt-chapter-tree li { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px 13px; border-radius: 8px; background: #f7f9fc; }
.wt-chapter-tree li > div { display: grid; gap: 4px; }
.wt-chapter-tree li span,
.wt-chapter-tree li small { color: #637289; }
.wt-structure-forms { display: grid; gap: 14px; position: sticky; top: 18px; }
.wt-structure-forms details { overflow: hidden; border: 1px solid #d4deea; border-radius: 10px; background: #fff; }
.wt-structure-forms summary { padding: 17px 19px; color: #102744; font-weight: 800; cursor: pointer; }
.wt-structure-forms form { padding: 0 19px 20px; }

@media (max-width: 880px) {
    .wt-shell { width: min(100% - 28px, 1240px); }
    .wt-page-header { align-items: stretch; flex-direction: column; }
    .wt-picker-step { grid-template-columns: 1fr; gap: 18px; padding: 22px; }
    .wt-course-description { grid-column: 1; }
    .wt-start-bar { align-items: stretch; flex-direction: column; }
    .wt-training-shell { display: block; min-height: auto; margin: -20px; }
    .wt-mobile-progress-toggle { display: block; width: 100%; min-height: 44px; border: 0; border-bottom: 1px solid #ccd7e5; background: #f4f9ff; color: #0052b4; font: inherit; font-weight: 800; }
    .wt-progress-sidebar { display: none; padding: 24px; }
    .wt-progress-sidebar.is-mobile-open { display: flex; }
    .wt-question-workspace { width: calc(100% - 36px); padding: 30px 0 54px; }
    .wt-admin-layout { grid-template-columns: 1fr; }
    .wt-admin-workbench { grid-template-columns: 1fr; }
    .wt-question-catalog { position: static; }
    .wt-question-editor { order: -1; }
    .wt-question-list { max-height: 360px; }
    .wt-question-tree { max-height: 520px; }
    .wt-editor-section { grid-template-columns: 1fr; gap: 20px; padding: 22px; }
    .wt-admin-header-actions > * { flex: 1 1 180px; }
    .wt-result-values { grid-template-columns: 1fr; }
    .wt-result-values div + div { border-top: 1px solid #dce3ec; border-left: 0; }
    .wt-structure-grid { grid-template-columns: 1fr; }
    .wt-structure-layout { grid-template-columns: 1fr; }
    .wt-structure-forms { position: static; }
}

@media (max-width: 560px) {
    .wt-course-option { flex-basis: 210px; }
    .wt-question-workspace h1 { font-size: 31px; }
    .wt-feedback { grid-template-columns: 1fr; padding: 24px; }
    .wt-answer-actions > * { width: 100%; }
    .wt-editor-heading { align-items: flex-start; padding: 20px; }
    .wt-editor-heading h2 { font-size: 24px; }
    .wt-editor-footer { align-items: stretch; flex-direction: column-reverse; padding: 18px 20px; }
    .wt-editor-footer > * { width: 100%; }
    .wt-review-card > header,
    .wt-review-form { grid-template-columns: 1fr; flex-direction: column; }
    .wt-review-form { grid-template-areas: "points" "correct" "note" "submit"; }
    .wt-review-meta { justify-items: start; text-align: left; }
    .wt-review-form .button-primary { justify-self: stretch; }
    .wt-review-answer > div { grid-template-columns: 1fr; gap: 2px; }
    .wt-assignment-course details > div { grid-template-columns: 1fr; }
    .wt-tree-question { grid-template-columns: 20px minmax(0, 1fr); }
    .wt-tree-move-controls { grid-column: 2; justify-content: flex-end; }
    .wt-drag-handle { display: none; }
    .wt-answer-field-editor > header,
    .wt-answer-field-editor > header > div { align-items: flex-start; flex-direction: column; }
    .wt-author-card,
    .wt-structure-card { padding: 20px; }
    .wt-author-footer { align-items: stretch; flex-direction: column-reverse; }
    .wt-author-footer > * { width: 100%; }
    .wt-structure-chapter { margin-left: 0; }
    .wt-structure-sections li { align-items: flex-start; flex-direction: column; }
    .wt-structure-explainer,
    .wt-course-tree > header,
    .wt-chapter-tree li { align-items: flex-start; flex-direction: column; }
}

.chemistry-shell {
    display: grid;
    gap: 24px;
    box-sizing: border-box;
    width: min(1240px, calc(100% - 48px));
    max-width: none;
    padding: 0;
}

.chemistry-toolbar,
.chemistry-panel,
.chemistry-fact-card {
    border: 1px solid #d7dde5;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.07);
}

.chemistry-toolbar {
    padding: 18px;
}

.chemistry-pse-workbench {
    gap: 18px;
}

.chemistry-pse-header {
    margin-bottom: 0;
}

.chemistry-pse-controls {
    display: grid;
    gap: 12px;
}

.chemistry-search {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.chemistry-search label {
    display: grid;
    gap: 6px;
    min-width: min(320px, 100%);
    color: #334155;
    font-weight: 700;
}

.chemistry-search input {
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    padding: 0 12px;
}

.chemistry-pse-controls .button-primary,
.chemistry-pse-controls .button-secondary {
    min-height: 40px;
    border-radius: 8px;
}

.pse-filter-rows,
.pse-filter-rows div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.pse-filter-rows a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-weight: 800;
    text-decoration: none;
}

.pse-filter-rows {
    display: flex;
    gap: 8px;
}

.pse-filter-rows span {
    min-width: 62px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.pse-filter-rows a:hover,
.pse-filter-rows a.is-active {
    border-color: #0f766e;
    background: #ecfdf5;
    color: #115e59;
}

.pse-admin-toolbar {
    display: grid;
    gap: 14px;
}

.pse-color-accordion {
    display: grid;
    gap: 14px;
}

.pse-color-scheme summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    list-style: none;
}

.pse-color-scheme summary::-webkit-details-marker {
    display: none;
}

.pse-color-scheme summary span {
    display: grid;
    gap: 2px;
}

.pse-color-scheme summary small {
    color: #64748b;
}

.pse-color-summary-action {
    color: #0f766e;
    font-weight: 800;
    text-decoration: none;
}

.pse-color-scheme[open] summary {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.pse-color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: end;
    margin-bottom: 18px;
}

.pse-color-options label {
    display: grid;
    gap: 7px;
    color: #334155;
    font-weight: 800;
}

.pse-color-options label:first-child {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 38px;
}

.pse-color-options input[type="color"] {
    width: 44px;
    min-width: 44px;
    height: 44px;
    box-sizing: border-box;
    padding: 3px;
}

.pse-color-rule-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.pse-color-rule,
.pse-color-new-rule {
    display: grid;
    gap: 16px;
}

.pse-color-rule {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.pse-color-rule-head {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pse-color-rule-head div {
    display: grid;
    gap: 2px;
}

.pse-color-rule-head small {
    color: #64748b;
}

.pse-color-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 2px solid #0052b4;
    font-weight: 900;
}

.pse-color-rule label,
.pse-color-new-rule label {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: #334155;
    font-weight: 800;
}

.pse-color-rule input,
.pse-color-new-rule input,
.pse-color-new-rule select {
    min-height: 38px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    padding: 0 10px;
}

.pse-color-rule input[type="color"],
.pse-color-new-rule input[type="color"] {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 3px;
}

.pse-color-new-rule {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    align-items: end;
}

.pse-color-add-rule {
    margin: 10px 0 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.pse-color-add-rule h3 {
    margin: 0 0 12px;
    color: #0f172a;
}

.pse-color-new-rule button,
.pse-color-delete,
.chemistry-panel > .button-primary,
.chemistry-panel > .button-secondary,
.pse-admin-toolbar .button-secondary,
.chemistry-panel .button-primary,
.chemistry-panel .button-secondary {
    border-radius: 6px;
}

.pse-color-delete {
    justify-self: start;
}

.pse-board-shell {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding: 2px 0 22px;
}

.pse-board {
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 74px repeat(18, 42px);
    grid-template-rows: 30px repeat(7, 42px) 24px repeat(2, 42px);
    gap: 5px;
    width: max-content;
    max-width: none;
    overflow: visible;
    margin: 0 auto;
    padding: 18px;
    border: 0;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 38%),
        #0052b4;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
}

.pse-tile,
.pse-axis,
.pse-series-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 1px solid var(--pse-border, #0052b4);
    border-radius: 0;
    background: var(--pse-accent, #bfc7d1);
    color: var(--pse-text, #0f172a);
    font-weight: 800;
    text-decoration: none;
    outline: 0;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

.pse-axis,
.pse-series-label {
    border-color: transparent;
    background: transparent;
    color: #fff;
    font-size: 14px;
}

.pse-axis:hover,
.pse-axis:focus-visible,
.pse-axis.is-active,
.pse-series-label:hover,
.pse-series-label:focus-visible,
.pse-series-label.is-active {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.72);
    box-shadow: none;
}

.pse-axis-group {
    align-items: end;
    padding-bottom: 3px;
}

.pse-axis-period {
    justify-content: flex-end;
    padding-right: 8px;
}

.pse-series-label {
    justify-content: flex-end;
    padding-right: 10px;
}

.pse-tile:hover,
.pse-tile:focus-visible,
.pse-tile.is-selected {
    z-index: 8;
    background: var(--pse-accent, #bfc7d1);
    border-color: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
    transform: translateY(-1px);
}

.pse-tile.is-selected {
    outline: 3px solid #ffffff;
    outline-offset: 1px;
}

.pse-tile strong {
    font-size: 17px;
    line-height: 1;
}

.pse-tile.is-placeholder {
    background: #c45cff;
    color: var(--pse-text, #0f172a);
    font-size: 13px;
}

.pse-tile.is-muted {
    opacity: 0.24;
}

.pse-tile.is-muted:hover,
.pse-tile.is-muted:focus-visible {
    opacity: 1;
}

.pse-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    z-index: 20;
    display: grid;
    gap: 6px;
    width: 132px;
    padding: 12px;
    border: 1px solid #7aa5df;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.2);
    font-size: 13px;
    line-height: 1.2;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 6px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.pse-board [style*="grid-row:2"] .pse-tooltip,
.pse-axis-group .pse-tooltip {
    top: calc(100% + 10px);
    bottom: auto;
    transform: translate(-50%, -6px);
}

.pse-tooltip-symbol {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.pse-tooltip-symbol small {
    color: #334155;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(5px);
}

.pse-tooltip-symbol b {
    color: #0052b4;
    font-size: 38px;
    line-height: 0.9;
}

.pse-tooltip-name {
    display: block;
    color: #0f172a;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
}

.pse-tile:hover .pse-tooltip,
.pse-tile:focus-visible .pse-tooltip,
.pse-axis:hover .pse-tooltip,
.pse-axis:focus-visible .pse-tooltip,
.pse-series-label:hover .pse-tooltip,
.pse-series-label:focus-visible .pse-tooltip {
    opacity: 1;
    transform: translate(-50%, 0);
}

.pse-selection-panel {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.pse-selection-symbol {
    display: grid;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--pse-border, color-mix(in srgb, var(--pse-accent, #64748b) 55%, #ffffff));
    border-radius: 8px;
    background: color-mix(in srgb, var(--pse-accent, #64748b) 18%, #ffffff);
}

.pse-selection-symbol span {
    color: var(--pse-text, color-mix(in srgb, var(--pse-accent, #64748b) 76%, #0f172a));
    font-weight: 900;
}

.pse-selection-symbol strong {
    color: var(--pse-text, #0f172a);
    font-size: 58px;
    line-height: 1;
}

.pse-selection-symbol em {
    color: #334155;
    font-style: normal;
    font-weight: 800;
}

.pse-selection-main {
    min-width: 0;
}

.pse-selection-main h2 {
    margin: 0 0 14px;
}

.pse-fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}

.pse-fact-grid div {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.pse-fact-grid dt {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.pse-fact-grid dd {
    margin: 3px 0 0;
    color: #0f172a;
    font-weight: 800;
}

.chemistry-panel {
    padding: 22px;
    min-width: 0;
    overflow: hidden;
}

.chemistry-panel h2,
.chemistry-fact-card h2 {
    margin: 0 0 14px;
    color: #0f172a;
}

.chemistry-table-wrap {
    overflow-x: auto;
}

.chemistry-table {
    width: 100%;
    border-collapse: collapse;
}

.chemistry-table th,
.chemistry-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.chemistry-table th {
    color: #334155;
    font-size: 12px;
    text-transform: uppercase;
}

.chemistry-detail-grid {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    min-width: 0;
}

.chemistry-fact-card {
    padding: 0;
    min-width: 0;
    border: 1px solid #d7dde5;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.chemistry-symbol {
    position: relative;
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 22px 16px;
    border-radius: 0;
    background: var(--element-accent, #00e61a);
    color: var(--element-text, #0f172a);
    text-align: center;
}

.chemistry-symbol-mass {
    color: var(--element-text, #0f172a);
    font-size: 18px;
    font-weight: 900;
}

.chemistry-symbol-main {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}

.chemistry-symbol-number {
    color: var(--element-text, #0f172a);
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(7px);
}

.chemistry-symbol strong {
    color: var(--element-text, #0f172a);
    font-size: 58px;
    line-height: 1;
}

.chemistry-symbol em {
    color: var(--element-text, #0f172a);
    font-style: normal;
    font-size: 20px;
    font-weight: 900;
}

.chemistry-fact-card dl {
    display: grid;
    gap: 0;
    margin: 0;
}

.chemistry-fact-card dl div {
    position: relative;
    display: grid;
    gap: 3px;
    padding: 10px 14px;
    border-top: 1px solid #e2e8f0;
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--element-accent, #64748b) 58%, #ffffff);
}

.chemistry-fact-card dt {
    color: #0f172a;
    font-weight: 900;
}

.chemistry-fact-card dd {
    margin: 0;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.chemistry-sidebar-image {
    position: relative;
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid #e2e8f0;
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--element-accent, #64748b) 58%, #ffffff);
}

.chemistry-sidebar-image h2 {
    margin: 0;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.25;
}

.chemistry-sidebar-image img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 210px;
    margin: 0 auto;
    object-fit: contain;
}

.chemistry-has-tooltip {
    outline: 0;
}

.chemistry-info-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    z-index: 25;
    display: grid;
    gap: 6px;
    width: min(220px, calc(100vw - 48px));
    padding: 12px;
    border: 1px solid #7aa5df;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.2);
    font-size: 13px;
    line-height: 1.25;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 6px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.chemistry-symbol .chemistry-info-tooltip {
    width: 132px;
}

.chemistry-info-tooltip b {
    color: #0052b4;
    font-size: 15px;
    font-weight: 900;
}

.chemistry-info-tooltip .pse-tooltip-symbol small {
    color: #334155;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(5px);
}

.chemistry-info-tooltip .pse-tooltip-symbol b {
    color: #0052b4;
    font-size: 38px;
    line-height: 0.9;
}

.chemistry-info-tooltip .pse-tooltip-name {
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
}

.chemistry-has-tooltip:hover .chemistry-info-tooltip,
.chemistry-has-tooltip:focus-visible .chemistry-info-tooltip {
    opacity: 1;
    transform: translate(-50%, 0);
}

.chemistry-content-stack {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.chemistry-richtext {
    line-height: 1.65;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.chemistry-richtext .table-responsive {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.chemistry-richtext img {
    max-width: 100%;
    height: auto;
}

.chemistry-richtext table {
    width: auto;
    max-width: 100%;
    border-collapse: collapse;
}

.chemistry-richtext .chemistry-legacy-table,
.chemistry-richtext table.table {
    width: 100%;
}

.chemistry-richtext > table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.chemistry-richtext td,
.chemistry-richtext th {
    padding: 8px;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.chemistry-richtext td img,
.chemistry-richtext th img {
    max-width: min(260px, 100%);
}

.chemistry-richtext .mitte {
    text-align: center;
}

.chemistry-richtext .rechts {
    text-align: right;
}

.chemistry-richtext nobr {
    white-space: normal;
}

.chemistry-richtext h3:first-child {
    margin-top: 0;
}

.chemistry-note-box {
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid #9bd5ad;
    border-radius: 6px;
    background: #eefbf1;
}

.chemistry-richtext .hidden {
    display: none !important;
}

@media (max-width: 767px) {
    .chemistry-richtext .hidden-xs {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .chemistry-richtext .hidden-sm {
        display: none !important;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .chemistry-richtext .hidden-md {
        display: none !important;
    }
}

@media (min-width: 1200px) {
    .chemistry-richtext .hidden-lg {
        display: none !important;
    }
}

.chemistry-redox-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.chemistry-redox-table {
    min-width: 620px;
    width: 100%;
    border-collapse: collapse;
}

.chemistry-redox-table th,
.chemistry-redox-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.chemistry-redox-table th {
    color: #334155;
    font-size: 12px;
    text-align: left;
    text-transform: uppercase;
}

.chemistry-redox-equation {
    min-width: 340px;
    color: #0f172a;
    font-weight: 700;
    white-space: normal;
}

.chemistry-redox-value {
    white-space: nowrap;
}

.chemistry-redox-value span {
    color: #64748b;
}

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

.chemistry-asset-list div {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.chemistry-asset-list span,
.chemistry-asset-list small {
    overflow-wrap: anywhere;
    color: #64748b;
}

.pse-search-results {
    margin-top: 16px;
}

.pse-search-result-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.pse-search-result-list a {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid #d7dde5;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
}

.pse-search-result-list strong {
    color: #0052b4;
    font-size: 20px;
}

.pse-search-result-list small {
    color: #64748b;
}

.chemistry-table-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
}

.chemistry-table-controls .button-row {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.chemistry-table-controls .button-primary,
.chemistry-table-controls .button-secondary {
    display: inline-flex;
    height: 42px;
    min-height: 42px;
    box-sizing: border-box;
    padding: 0 16px;
    border-radius: 6px;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    text-decoration: none !important;
    white-space: nowrap;
}

.chemistry-table-controls label,
.chemistry-edit-grid label,
.chemistry-admin-editor label,
.chemistry-element-picker label {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: #334155;
    font-weight: 800;
}

.chemistry-table-controls input:not([type="checkbox"]),
.chemistry-table-controls select,
.chemistry-edit-grid input,
.chemistry-edit-grid select,
.chemistry-admin-editor textarea,
.chemistry-element-picker input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    padding: 10px 12px;
}

.chemistry-table-controls input:not([type="checkbox"]),
.chemistry-table-controls select {
    min-height: 42px;
}

.chemistry-column-picker {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 10px 14px;
    align-items: start;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
}

.chemistry-column-picker strong {
    grid-column: 1 / -1;
    color: #0f172a;
}

.chemistry-column-picker label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    min-height: 26px;
    color: #334155;
    font-weight: 700;
    line-height: 1.25;
}

.chemistry-column-picker input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    padding: 0;
    accent-color: #0052b4;
}

.chemistry-table th a {
    color: inherit;
    text-decoration: none;
}

.chemistry-asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.chemistry-asset-grid figure {
    margin: 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.chemistry-asset-grid img {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
}

.chemistry-asset-grid figcaption {
    display: grid;
    gap: 4px;
    margin-top: 10px;
    color: #475569;
    font-size: 14px;
}

.chemistry-admin-content-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.chemistry-element-picker {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow: auto;
}

.chemistry-element-picker form {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.chemistry-element-picker nav {
    display: grid;
    gap: 6px;
}

.chemistry-element-picker nav a {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid #d7dde5;
    border-radius: 6px;
    color: #0f172a;
    text-decoration: none;
}

.chemistry-element-picker nav a.is-active {
    border-color: #0052b4;
    background: #eaf2ff;
}

.chemistry-admin-editor,
.chemistry-admin-section-stack,
.chemistry-admin-media-list,
.chemistry-admin-isotope-list {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.chemistry-sub-edit-card {
    padding: 14px;
    border: 1px solid #d7dde5;
    border-radius: 6px;
    background: #ffffff;
}

.chemistry-edit-card summary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    cursor: pointer;
}

.chemistry-edit-card summary span:first-child {
    display: grid;
    gap: 3px;
}

.chemistry-edit-card summary small {
    color: #64748b;
}

.chemistry-edit-card[open] summary {
    margin-bottom: 14px;
}

.chemistry-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.chemistry-html-editor {
    min-height: 220px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    line-height: 1.45;
}

.chemistry-edit-toggle {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 6px;
}

.chemistry-sticky-actions {
    position: sticky;
    bottom: 0;
    padding: 12px 0;
    background: linear-gradient(rgba(245, 248, 252, 0), #f5f8fc 25%);
}

@media (max-width: 900px) {
    .chemistry-shell {
        width: min(100% - 28px, 720px);
    }

    .chemistry-detail-grid {
        grid-template-columns: 1fr;
    }

    .pse-selection-panel {
        grid-template-columns: 1fr;
    }

    .pse-selection-symbol {
        width: min(130px, 100%);
    }

    .chemistry-admin-content-layout {
        grid-template-columns: 1fr;
    }

    .chemistry-element-picker {
        position: static;
        max-height: none;
    }
}
html {
    min-height: 100%;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    font: 16px/24px "Trebuchet MS", Helvetica, sans-serif;
    background: #f8f8f8;
    color: #4b4b4b;
}

.app-layout {
    background: linear-gradient(90deg, #111827 0 276px, #eef2f7 276px);
}

.app-layout.sidebar-collapsed {
    background: linear-gradient(90deg, #111827 0 76px, #eef2f7 76px);
}

.public-layout {
    background:
        radial-gradient(circle at 20% 10%, rgba(20, 184, 166, 0.14), transparent 34%),
        linear-gradient(135deg, #f8fafc, #eef7f4);
}

.public-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    box-sizing: border-box;
    min-height: 66px;
    padding: 10px 28px;
    border-bottom: 1px solid rgba(203, 213, 225, 0.85);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
}

.brand-mark,
.sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
    text-decoration: none;
}

.brand-mark span,
.sidebar-brand span,
.brand-mark img,
.sidebar-brand img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #0f766e;
    color: #fff;
    font-weight: 900;
}

.brand-mark img,
.sidebar-brand img {
    object-fit: contain;
    border: 0;
    background: transparent;
}

.public-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
}

.public-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    color: #334155;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.public-nav-link:hover {
    color: #0f766e;
}

.public-login-button {
    border: 1px solid #0f766e;
    border-radius: 10px;
    background: #0f766e;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.public-login-button:hover {
    background: #115e59;
}

.public-content {
    min-height: calc(100vh - 65px);
}

.public-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 56px 24px;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.05fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
    min-height: 52vh;
}

.landing-hero h1 {
    max-width: 760px;
    margin: 0 0 20px;
    color: #0f172a;
    font-size: clamp(36px, 5vw, 64px);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.landing-logo-panel {
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-logo {
    display: block;
    width: min(500px, 100%);
    height: auto;
    margin: 0;
    object-fit: contain;
}

.landing-copy {
    max-width: 680px;
}

.landing-copy p {
    max-width: 620px;
    color: #475569;
    font-size: 18px;
    line-height: 1.75;
}

.landing-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 28px;
}

.landing-card,
.register-placeholder {
    border: 1px solid #d7dde5;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(20, 184, 166, 0.22), transparent 42%),
        #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.landing-card {
    display: grid;
    gap: 10px;
    padding: 28px;
}

.landing-card span {
    color: #0f766e;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.landing-card strong {
    color: #0f172a;
    font-size: 28px;
    line-height: 1.05;
}

.landing-card p,
.register-placeholder p {
    color: #475569;
}

.register-placeholder {
    max-width: 680px;
    margin: 48px auto;
    padding: 34px;
}

.app-frame {
    display: grid;
    grid-template-columns: 276px minmax(0, 1fr);
    min-height: 100vh;
    width: 100%;
    overflow-x: clip;
    background: linear-gradient(90deg, #111827 0 276px, #eef2f7 276px);
    transition: grid-template-columns 0.2s ease;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(20, 184, 166, 0.12), transparent 28%),
        #111827;
    color: #dbeafe;
    box-shadow: 14px 0 34px rgba(15, 23, 42, 0.16);
    transition: width 0.2s ease, transform 0.2s ease, padding 0.2s ease;
}

.sidebar-brand {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 6px 18px;
    color: #fff;
}

.sidebar-brand span {
    background: #14b8a6;
}

.sidebar-brand img {
    width: 46px;
    height: 46px;
}

.sidebar-user {
    display: grid;
    gap: 2px;
    margin: 8px 0 18px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.52);
}

.sidebar-user span {
    color: #f8fafc;
    font-weight: 800;
}

.sidebar-user small {
    color: #94a3b8;
}

.sidebar-nav {
    display: grid;
    gap: 7px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sidebar-nav a,
.nav-disabled {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 11px;
    color: #cbd5e1;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.sidebar-nav a:hover {
    background: rgba(20, 184, 166, 0.16);
    color: #fff;
}

.nav-group {
    display: grid;
    gap: 4px;
    border-radius: 13px;
}

.nav-parent-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 2px;
    align-items: center;
    border-radius: 13px;
}

.nav-group.is-open .nav-parent-row {
    background: rgba(15, 23, 42, 0.34);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.sidebar-nav .nav-parent-link {
    min-width: 0;
    border-radius: 13px 8px 8px 13px;
}

.sidebar-nav .nav-parent-link:hover {
    background: transparent;
}

.nav-group-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 40px;
    border: 0;
    border-radius: 8px 13px 13px 8px;
    color: #cbd5e1;
    background: transparent;
    cursor: pointer;
}

.nav-group-toggle:hover {
    color: #fff;
    background: rgba(20, 184, 166, 0.16);
}

.nav-toggle-icon {
    display: inline-block;
    transform: rotate(-90deg);
    transition: transform 0.18s ease;
}

.nav-group.is-open .nav-toggle-icon {
    transform: rotate(0deg);
}

.nav-submenu {
    display: none;
    gap: 4px;
    margin: 1px 0 2px 39px;
    padding-left: 9px;
    border-left: 1px solid rgba(148, 163, 184, 0.22);
}

.nav-group.is-open .nav-submenu {
    display: grid;
}

.sidebar-nav .nav-subitem {
    gap: 9px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 650;
    color: #aebfd3;
}

.sidebar-nav .nav-subitem:hover {
    background: rgba(20, 184, 166, 0.12);
}

.nav-subicon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: #5eead4;
}

.nav-disabled {
    opacity: 0.45;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.13);
}

.nav-icon svg {
    display: block;
}

.nav-icon-stitch {
    color: #99f6e4;
    background: rgba(20, 184, 166, 0.16);
}

.sidebar-collapsed .app-frame {
    grid-template-columns: 76px minmax(0, 1fr);
    background: linear-gradient(90deg, #111827 0 76px, #eef2f7 76px);
}

.sidebar-collapsed .app-sidebar {
    padding: 14px 10px;
}

.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-inline: 0;
}

.sidebar-collapsed .sidebar-brand strong,
.sidebar-collapsed .sidebar-user,
.sidebar-collapsed .nav-text {
    display: none;
}

.sidebar-collapsed .sidebar-nav a,
.sidebar-collapsed .nav-disabled {
    justify-content: center;
    padding-inline: 8px;
}

.sidebar-collapsed .nav-parent-row {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    justify-self: center;
    gap: 4px;
    width: 56px;
    padding: 6px 0;
}

.sidebar-collapsed .nav-group:not(.is-open) .nav-parent-row {
    width: 40px;
    padding: 0;
}

.sidebar-collapsed .sidebar-nav .nav-parent-link {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 11px;
}

.sidebar-collapsed .nav-group:not(.is-open) .nav-group-toggle {
    display: none;
}

.sidebar-collapsed .nav-group-toggle {
    display: inline-flex;
    width: 28px;
    height: 24px;
    border-radius: 8px;
}

.sidebar-collapsed .nav-group.is-open .nav-submenu {
    display: grid;
}

.sidebar-collapsed .nav-submenu {
    justify-items: center;
    gap: 5px;
    margin: 1px 0 0;
    padding: 4px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.sidebar-collapsed .sidebar-nav .nav-subitem {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: 10px;
}

.sidebar-collapsed .nav-subicon {
    flex-basis: 18px;
}

.sidebar-overlay {
    display: none;
}

.app-main {
    min-width: 0;
    overflow-x: clip;
    background: #eef2f7;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 66px;
    padding: 0 26px;
    border-bottom: 1px solid #d7dde5;
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(12px);
}

.topbar-left,
.app-topbar > div {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-left > div {
    display: grid;
    gap: 2px;
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sidebar-toggle:hover {
    border-color: #0f766e;
    background: #ecfdf5;
    color: #0f766e;
}

.sidebar-toggle svg {
    display: block;
}

.topbar-kicker {
    color: #0f766e;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-content {
    min-width: 0;
    overflow-x: clip;
    padding: 1px 0 42px;
}

.header {
    margin: 24px;
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    color: #888;
    box-shadow: 0 0 24px #f4f4f4;
    text-align: center;
}
.header svg {
    height: 48px;
}

.content {
    flex-grow: 1;
    display: flex;
    align-items: center;
}
.content_i {
    flex-grow: 1;
    padding: 24px 5%;
}
.content a {
    color: #00617b;
}
.content a:hover {
    color: #1191b3;
}

.footer {
    border-top: 1px solid #e6e8ec;
    margin: 24px 24px 0;
    padding: 24px;
    text-align: center;
}

.footer_copyright a {
    color: #838b99;
    text-decoration: none;
}

.footer_copyright a:hover {
    color: #0b7794;
    text-decoration: underline;
}

.footer_icons {
    padding-top: 16px;
    display: flex;
    justify-content: center;
}

.footer_icons a {
    margin: 0 12px;
    text-decoration: none;
}

.footer_icons svg {
    height: 32px;
    fill: #838b99;
}

.footer_icons a:hover svg {
    fill: #0b7794;
}

.text-center {
    text-align: center;
}

.home-hero {
    max-width: 760px;
    margin: 24px auto;
    padding: 48px 32px;
    border: 1px solid #d7dde5;
    border-radius: 18px;
    background:
        radial-gradient(circle at 20% 20%, rgba(15, 118, 110, 0.16), transparent 28%),
        linear-gradient(135deg, #ffffff 0%, #f5fbf9 48%, #eef7fb 100%);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
}

.home-hero h1 {
    max-width: 620px;
    margin: 0 auto 18px;
    color: #0f172a;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.02;
}

.home-lead {
    max-width: 620px;
    margin: 0 auto;
    color: #475569;
    font-size: 19px;
    line-height: 1.7;
}

.home-actions {
    margin: 32px 0 0;
}

.button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 26px;
    border-radius: 999px;
    background: #0f766e;
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(15, 118, 110, 0.28);
}

.button-primary:hover {
    background: #115e59;
    color: #fff !important;
}

.auth-shell,
.admin-shell,
.dashboard-shell {
    max-width: 1040px;
    margin: 48px auto;
    padding: 0 24px;
}

.auth-panel {
    max-width: 420px;
    margin: 0 auto;
    padding: 32px;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(17, 24, 39, 0.08);
}

.eyebrow {
    margin: 0 0 8px;
    color: #0f766e;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

.form-stack label {
    display: grid;
    gap: 8px;
    color: #1f2937;
    font-weight: 600;
}

.form-stack input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font: inherit;
}

.fabric-help-box {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    background: #f0f9ff;
    color: #64748b;
    font-size: 14px;
    line-height: 1.45;
}

.fabric-help-box strong {
    display: block;
    margin-bottom: 4px;
    color: #075985;
    font-weight: 900;
}

.fabric-help-box p {
    margin: 0;
}

.form-stack button,
.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    background: #0f766e;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
}

.button-secondary {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #1f2937;
}

.button-primary,
.button-primary:hover,
.button-secondary,
.button-secondary:hover {
    text-decoration: none !important;
}

.button-danger {
    border-color: #fecaca;
    color: #991b1b;
}

.button-danger:hover {
    background: #fef2f2;
}

.alert {
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 6px;
}

.alert-danger {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.admin-header,
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.admin-header h1,
.dashboard-header h1,
.auth-panel h1 {
    margin: 0 0 12px;
    color: #111827;
}

.muted {
    color: #64748b;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.admin-grid article {
    padding: 22px;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    background: #fff;
}

.admin-grid h2 {
    margin-top: 0;
    color: #111827;
    font-size: 20px;
}

.dashboard-shell {
    max-width: 1180px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.module-card {
    display: grid;
    gap: 18px;
    align-content: space-between;
    min-height: 220px;
    padding: 24px;
    border: 1px solid #d7dde5;
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(20, 184, 166, 0.13), transparent 38%),
        #fff;
    box-shadow: 0 16px 44px rgba(15, 23, 42, 0.08);
}

.module-card.is-disabled {
    opacity: 0.62;
    background: #f8fafc;
}

.module-card h2 {
    margin: 8px 0;
    color: #0f172a;
}

.module-card p {
    margin: 0;
    color: #475569;
}

.module-badge {
    display: inline-flex;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #115e59;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.button-secondary.disabled {
    pointer-events: none;
    opacity: 0.75;
}

.module-shell,
.stitch-editor {
    max-width: 1240px;
    margin: 36px auto;
    padding: 0 24px;
}

.module-shell.narrow {
    max-width: 720px;
}

.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.module-header h1,
.module-shell h1 {
    margin: 0 0 10px;
    color: #0f172a;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.module-form {
    padding: 26px;
    border: 1px solid #d7dde5;
    border-radius: 14px;
    background: #fff;
}

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

.empty-state,
.pattern-card,
.editor-panel,
.canvas-panel {
    border: 1px solid #d7dde5;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.07);
}

.empty-state {
    padding: 34px;
    text-align: center;
}

.module-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin: -6px 0 18px;
}

.module-subnav form {
    margin: 0;
}

.module-action-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 42px;
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: none;
    gap: 8px;
}

.module-action-button:hover,
.module-action-button:focus-visible {
    border-color: #0f766e;
    color: #115e59;
    outline: 0;
}

.module-action-button.is-primary {
    border-color: #0f766e;
    background: #0f766e;
    color: #fff;
}

.module-action-button.is-primary:hover,
.module-action-button.is-primary:focus-visible {
    background: #115e59;
    color: #fff;
}

.module-action-button.is-danger {
    border-color: #fecaca;
    color: #991b1b;
}

.module-action-button.is-danger:hover,
.module-action-button.is-danger:focus-visible {
    background: #fef2f2;
    color: #7f1d1d;
}

.button-icon {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
}

.editor-subnav {
    justify-content: flex-end;
    margin-bottom: 12px;
}

.pattern-editor-meta {
    display: flex;
    justify-content: flex-start;
    margin: 0 0 16px;
}

.pattern-editor-meta span {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0 12px;
    border: 1px solid #d7dde5;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
}

.pattern-list {
    display: grid;
    gap: 14px;
}

.pattern-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0;
    overflow: visible;
}

.pattern-card-main {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    padding: 18px 20px;
    color: inherit;
    text-decoration: none !important;
}

.pattern-card-main:hover h2,
.pattern-card-main:focus-visible h2 {
    color: #0f766e;
}

.pattern-card-main:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.18);
    outline-offset: -3px;
}

.pattern-card h2 {
    margin: 0 0 6px;
    color: #0f172a;
}

.pattern-card p {
    margin: 0;
    color: #64748b;
}

.pattern-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    padding: 18px 20px 18px 0;
}

.pattern-actions form {
    margin: 0;
}

.pattern-rename-dialog {
    width: min(460px, calc(100vw - 32px));
    border: 0;
    border-radius: 8px;
    padding: 0;
    color: #0f172a;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.pattern-rename-dialog::backdrop {
    background: rgba(15, 23, 42, 0.42);
}

.pattern-rename-form {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.pattern-rename-form header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.pattern-rename-form h2 {
    margin: 0;
    font-size: 22px;
}

.dialog-close-button {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.pattern-rename-form label {
    display: grid;
    gap: 7px;
    color: #334155;
    font-weight: 800;
}

.pattern-rename-form input {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #0f172a;
    font: inherit;
    padding: 8px 10px;
}

.pattern-rename-form input:focus {
    border-color: #0f766e;
    outline: 3px solid rgba(15, 118, 110, 0.15);
}

.pattern-rename-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 980px) {
    .module-action-button {
        width: 40px;
        height: 40px;
        padding: 0;
    }

    .module-action-button .button-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .module-subnav {
        justify-content: flex-start;
    }

    .pattern-card {
        gap: 10px;
    }

    .pattern-card-main {
        padding-right: 0;
    }
}

/* Wissenstraining: echte app-weite Kontextleiste mit Topbar-Schalter. */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-actions form {
    margin: 0;
}

.wt-topbar-context-toggle {
    border-color: #9db7d5;
    color: #0052b4;
}

.wt-topbar-context-toggle:hover,
.wt-topbar-context-toggle:focus-visible {
    border-color: #0052b4;
    background: #edf5ff;
    color: #003f8c;
}

.app-content:has(> .wt-training-shell),
.app-content:has(> .wt-admin-shell) {
    box-sizing: border-box;
    padding-right: 286px;
    transition: padding-right .18s ease;
}

.app-content:has(> .wt-training-shell.is-context-collapsed),
.app-content:has(> .wt-admin-shell .wt-admin-workbench.is-context-collapsed) {
    padding-right: 0;
}

.wt-training-shell,
.wt-admin-workbench,
.wt-training-shell.is-context-collapsed,
.wt-admin-workbench.is-context-collapsed {
    display: block;
}

.wt-context-sidebar,
.wt-progress-sidebar,
.wt-question-catalog.wt-context-sidebar {
    position: fixed;
    z-index: 20;
    top: 66px;
    right: 0;
    left: auto;
    width: 286px;
    max-width: 286px;
    height: calc(100vh - 66px);
    max-height: calc(100vh - 66px);
    min-height: 0;
    box-sizing: border-box;
    overflow-y: auto;
    border: 0;
    border-left: 1px solid #d7dde5;
    border-radius: 0;
    opacity: 1;
    transform: translateX(0);
}

.wt-question-catalog.wt-context-sidebar {
    overflow: hidden;
}

.wt-question-catalog.wt-context-sidebar .wt-question-tree {
    max-height: calc(100vh - 140px);
}

.wt-training-shell.is-context-collapsed .wt-context-sidebar,
.wt-admin-workbench.is-context-collapsed .wt-context-sidebar {
    opacity: 0;
    pointer-events: none;
    transform: translateX(100%);
}

@media (max-width: 980px) {
    .app-content:has(> .wt-training-shell),
    .app-content:has(> .wt-admin-shell),
    .app-content:has(> .wt-training-shell.is-context-collapsed),
    .app-content:has(> .wt-admin-shell .wt-admin-workbench.is-context-collapsed) {
        padding-right: 0;
    }

    .wt-context-sidebar,
    .wt-progress-sidebar,
    .wt-question-catalog.wt-context-sidebar {
        z-index: 80;
        top: 0;
        width: min(84vw, 340px);
        max-width: 340px;
        height: 100vh;
        max-height: 100vh;
        min-height: 100vh;
        transform: translateX(105%);
    }

    .wt-training-shell.is-context-open .wt-context-sidebar,
    .wt-admin-workbench.is-context-open .wt-context-sidebar {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
    }

    .wt-question-catalog.wt-context-sidebar .wt-question-tree {
        max-height: calc(100vh - 70px);
    }
}

@media (max-width: 560px) {
    .app-topbar {
        gap: 8px;
        padding-inline: 10px;
    }

    .topbar-actions {
        gap: 5px;
    }

    .wt-topbar-context-toggle {
        flex-basis: 44px;
        width: 44px;
        min-width: 44px;
        padding: 0;
    }
}

.thread-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.thread-filter a {
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
}

.thread-filter a.active,
.thread-filter a:hover {
    border-color: #0f766e;
    background: #ecfdf5;
    color: #115e59;
}

.thread-admin-panel {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
    padding: 22px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(20, 184, 166, 0.08), transparent 46%),
        #fff;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.07);
}

.thread-admin-panel h2 {
    margin: 0 0 6px;
    color: #0f172a;
}

.thread-form {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(100px, 0.6fr) minmax(180px, 1.2fr) minmax(110px, 0.7fr) auto;
    gap: 12px;
    align-items: end;
}

.thread-form label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-weight: 700;
}

.thread-form input,
.thread-form select {
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    padding: 0 10px;
}

.form-error {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: #991b1b;
}

.thread-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.thread-card {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid #d7dde5;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.thread-swatch {
    display: block;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(15, 23, 42, 0.2);
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.thread-card strong,
.thread-card p,
.thread-card small {
    display: block;
}

.thread-card p {
    margin: 3px 0;
    color: #475569;
}

.thread-card small {
    color: #64748b;
}

.editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.editor-actions form {
    margin: 0;
}

.editor-actions .button-secondary,
.editor-actions .button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 116px;
    min-height: 46px;
    padding: 10px 14px;
    border-radius: 6px;
    box-shadow: none;
    line-height: 1;
}

.editor-layout {
    display: grid;
    grid-template-columns: minmax(190px, 240px) minmax(320px, 1fr) minmax(190px, 240px);
    gap: 18px;
    align-items: stretch;
}

.editor-panel {
    padding: 18px;
}

.editor-panel h2,
.editor-side-panel > summary {
    margin: 0 0 14px;
    color: #0f172a;
    font-size: 20px;
    font-weight: 850;
}

.editor-side-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
}

.editor-side-panel > summary::-webkit-details-marker {
    display: none;
}

.editor-side-panel > summary::after {
    content: "▾";
    color: #64748b;
    font-size: 16px;
}

.editor-side-panel:not([open]) > summary {
    margin-bottom: 0;
}

.editor-side-panel:not([open]) > summary::after {
    transform: rotate(-90deg);
}

.canvas-panel {
    min-height: 640px;
    overflow: auto;
    background:
        linear-gradient(45deg, rgba(15, 118, 110, 0.06), transparent),
        #eef2f7;
}

#stitchCanvas {
    display: block;
    max-width: none;
    max-height: none;
    cursor: crosshair;
    touch-action: none;
    user-select: none;
}

.palette-list,
.tool-grid {
    display: grid;
    gap: 10px;
}

.palette-entry {
    display: grid;
    gap: 6px;
}

.palette-add-form {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.palette-add-form label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-weight: 700;
}

.palette-add-form input,
.palette-add-form select {
    min-height: 40px;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: #0f172a;
    font: inherit;
}

.palette-item,
.tool-grid button {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    font: inherit;
}

.palette-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 8px 10px;
    align-items: center;
    padding: 10px;
    text-align: left;
}

.palette-item span {
    grid-row: span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--swatch);
    color: var(--swatch-text);
    font-weight: 800;
}

.palette-delete-button {
    width: 100%;
    min-height: 34px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff;
    color: #991b1b;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.palette-delete-button:hover {
    background: #fef2f2;
}

.palette-empty {
    margin: 0;
    padding: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
    background: #f8fafc;
}

.palette-item strong,
.palette-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.palette-item.is-active,
.tool-grid button.is-active {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.tools-panel label {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    font-weight: 700;
}

.tools-panel select {
    min-height: 42px;
    width: 100%;
    min-width: 0;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    font: inherit;
}

.stitch-stats {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.stitch-stats h3 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 16px;
}

.stitch-stats p {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;
}

@media (max-width: 760px) {
    .wt-matching-desktop-copy { display: none; }
    .wt-matching-mobile-copy { display: inline; }
    .wt-matching-board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(48px, 16vw, 78px); }
    .wt-matching-sources,
    .wt-matching-targets { display: grid; gap: 12px; }
    .wt-matching-lines { display: block; }
    .wt-matching-card { min-height: 56px; padding: 9px 11px; border-radius: 9px; font-size: 14px; }
    .wt-matching-card i { width: 13px; height: 13px; border-width: 2px; }
    .wt-matching-source i { right: -7px; }
    .wt-matching-target i { left: -7px; }
    .wt-matching-lines path { stroke-width: 2.5; }
    .wt-order-hint-desktop,
    .wt-order-drag-handle { display: none; }
    .wt-order-list li { grid-template-columns: minmax(0, 1fr) auto; }
    .app-layout,
    .app-layout.sidebar-collapsed {
        background: #eef2f7;
    }

    .public-topbar,
    .app-topbar {
        align-items: center;
        flex-direction: row;
    }

    .public-topbar {
        flex-wrap: wrap;
        padding-inline: 18px;
    }

    .public-nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .landing-hero {
        grid-template-columns: 1fr;
        gap: 26px;
        min-height: auto;
    }

    .landing-logo-panel {
        justify-content: flex-start;
    }

    .landing-logo {
        width: min(420px, 100%);
    }

    .landing-info-grid {
        grid-template-columns: 1fr;
    }

    .app-frame {
        display: block;
        background: #eef2f7;
    }

    .app-sidebar {
        position: fixed;
        z-index: 30;
        left: 0;
        top: 0;
        width: 276px;
        max-width: calc(100vw - 56px);
        transform: translateX(-105%);
        box-shadow: 16px 0 38px rgba(15, 23, 42, 0.26);
    }

    .sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-open .sidebar-overlay {
        display: block;
        position: fixed;
        z-index: 20;
        inset: 0;
        background: rgba(15, 23, 42, 0.42);
    }

    .sidebar-collapsed .app-frame {
        grid-template-columns: 1fr;
    }

    .sidebar-collapsed .sidebar-brand strong,
    .sidebar-collapsed .sidebar-user,
    .sidebar-collapsed .nav-text {
        display: initial;
    }

    .sidebar-collapsed .sidebar-nav a,
    .sidebar-collapsed .nav-disabled {
        justify-content: flex-start;
    }

    .sidebar-collapsed .nav-parent-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 34px;
        justify-items: stretch;
        width: auto;
        padding: 0;
    }

    .sidebar-collapsed .nav-group:not(.is-open) .nav-parent-row {
        width: auto;
        padding: 0;
    }

    .sidebar-collapsed .sidebar-nav .nav-parent-link {
        width: auto;
        height: auto;
        padding: 11px 12px;
        justify-content: flex-start;
        border-radius: 13px 8px 8px 13px;
    }

    .sidebar-collapsed .nav-group-toggle {
        display: inline-flex;
        width: 34px;
        height: 40px;
    }

    .sidebar-collapsed .nav-group:not(.is-open) .nav-group-toggle {
        display: inline-flex;
    }

    .sidebar-collapsed .nav-group.is-open .nav-submenu {
        display: grid;
    }

    .sidebar-collapsed .nav-submenu {
        justify-items: stretch;
        margin: 1px 0 2px 39px;
        padding: 0 0 0 9px;
        border-top: 0;
        border-left: 1px solid rgba(148, 163, 184, 0.22);
    }

    .sidebar-collapsed .sidebar-nav .nav-subitem {
        width: auto;
        height: auto;
        padding: 8px 10px;
        justify-content: flex-start;
    }

    .admin-header,
    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .module-header,
    .button-row,
    .pattern-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .module-subnav {
        margin-top: 0;
    }

    .pattern-card-main {
        box-sizing: border-box;
        width: 100%;
        padding: 16px 16px 0;
    }

    .pattern-actions {
        box-sizing: border-box;
        width: 100%;
        justify-content: flex-start;
        padding: 0 16px 16px;
    }

    .form-grid,
    .thread-form,
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .canvas-panel {
        min-height: 480px;
        order: -1;
    }
}

/* Wissenstraining: rechte Kontextseitenleiste nach dem Kilo-Bravo-Prinzip. */
.wt-training-shell {
    grid-template-columns: minmax(0, 1fr) 260px;
    overflow-x: clip;
    transition: grid-template-columns .18s ease;
}

.wt-training-shell .wt-question-workspace {
    grid-column: 1;
    grid-row: 1;
}

.wt-training-shell .wt-progress-sidebar {
    grid-column: 2;
    grid-row: 1;
}

.wt-progress-sidebar,
.wt-question-catalog.wt-context-sidebar {
    border-right: 0;
    border-left: 1px solid #d7dde5;
    background: #f8fafc;
    box-shadow: -12px 0 26px rgba(15, 23, 42, .07);
    transition: transform .18s ease, opacity .18s ease, padding .18s ease;
}

.wt-progress-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: calc(100vh - 68px);
    min-height: 520px;
    overflow-y: auto;
}

.wt-context-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
}

.wt-training-context-toggle {
    float: right;
    margin: 0 0 10px 14px;
    padding: 8px 12px;
    border: 1px solid #b8c4d1;
    border-radius: 6px;
    background: #fff;
    color: #174a82;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.wt-training-context-toggle:hover,
.wt-training-context-toggle:focus-visible {
    border-color: #0052b4;
    background: #edf5ff;
    color: #003f8c;
}

.wt-context-overlay {
    display: none;
}

.wt-training-shell.is-context-collapsed {
    grid-template-columns: minmax(0, 1fr) 0;
}

.wt-training-shell.is-context-collapsed .wt-context-sidebar,
.wt-admin-workbench.is-context-collapsed .wt-context-sidebar {
    opacity: 0;
    pointer-events: none;
    transform: translateX(100%);
}

.wt-admin-workbench {
    grid-template-columns: minmax(0, 1fr) 292px;
    grid-template-areas: "editor catalog";
    overflow-x: clip;
    transition: grid-template-columns .18s ease;
}

.wt-admin-workbench .wt-question-editor {
    grid-area: editor;
}

.wt-admin-workbench .wt-question-catalog {
    grid-area: catalog;
}

.wt-question-catalog.wt-context-sidebar {
    top: 10px;
    max-height: calc(100vh - 86px);
    overflow: hidden;
}

.wt-admin-workbench.is-context-collapsed {
    grid-template-columns: minmax(0, 1fr) 0;
}

/* Live-Vorschau der noch nicht gespeicherten Frage. */
.wt-preview-dialog {
    width: min(780px, calc(100% - 28px));
    max-height: min(820px, calc(100vh - 28px));
    box-sizing: border-box;
    padding: 0;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #142033;
    box-shadow: 0 24px 70px rgba(7, 26, 58, .28);
}

.wt-preview-dialog::backdrop {
    background: rgba(7, 26, 58, .52);
    backdrop-filter: blur(2px);
}

.wt-preview-dialog-header,
.wt-preview-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    background: #f8fafc;
}

.wt-preview-dialog-header {
    border-bottom: 1px solid #dce5ef;
}

.wt-preview-dialog-header p,
.wt-preview-dialog-header h2,
.wt-preview-dialog-footer p {
    margin: 0;
}

.wt-preview-dialog-header p {
    color: #0052b4;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.wt-preview-dialog-header h2 {
    margin-top: 2px;
    font-size: 21px;
}

.wt-preview-dialog-header .wt-dialog-close {
    position: static;
    flex: 0 0 44px;
    border: 1px solid #cbd5e1;
    background: #fff;
}

.wt-preview-dialog-body {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding: 22px;
}

.wt-question-preview {
    max-width: 680px;
    margin: 0 auto;
}

.wt-question-preview h3 {
    margin: 0 0 12px;
    color: #071a3a;
    font-size: clamp(25px, 4vw, 34px);
    line-height: 1.15;
}

.wt-preview-answer {
    display: grid;
    gap: 9px;
    margin-top: 20px;
}

.wt-preview-answer label,
.wt-preview-answer .wt-preview-match-row {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 48px;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid #c7d1df;
    border-radius: 6px;
    background: #fff;
}

.wt-preview-answer input[type="radio"],
.wt-preview-answer input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #0052b4;
}

.wt-preview-answer :is(input[type="text"], input[type="number"], textarea, select) {
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #b9c6d6;
    border-radius: 6px;
    background: #fff;
    color: #071a3a;
    font: inherit;
}

.wt-preview-answer textarea {
    min-height: 110px;
    resize: none;
}

.wt-preview-dialog-footer {
    border-top: 1px solid #dce5ef;
}

.wt-preview-dialog-footer p {
    color: #64748b;
    font-size: 13px;
}

@media (max-width: 980px) {
    .wt-training-shell,
    .wt-training-shell.is-context-collapsed,
    .wt-admin-workbench,
    .wt-admin-workbench.is-context-collapsed {
        display: block;
    }

    .wt-context-sidebar,
    .wt-progress-sidebar,
    .wt-question-catalog.wt-context-sidebar {
        position: fixed;
        z-index: 80;
        top: 0;
        right: 0;
        left: auto;
        width: min(84vw, 340px);
        max-width: 340px;
        height: 100vh;
        max-height: 100vh;
        min-height: 100vh;
        box-sizing: border-box;
        overflow-y: auto;
        opacity: 1;
        pointer-events: auto;
        transform: translateX(105%);
    }

    .wt-training-shell.is-context-open .wt-context-sidebar,
    .wt-admin-workbench.is-context-open .wt-context-sidebar {
        transform: translateX(0);
    }

    .wt-training-shell.is-context-collapsed .wt-context-sidebar,
    .wt-admin-workbench.is-context-collapsed .wt-context-sidebar {
        opacity: 1;
    }

    .wt-context-overlay {
        position: fixed;
        z-index: 75;
        inset: 0;
        display: block;
        pointer-events: none;
        background: rgba(15, 23, 42, .42);
        opacity: 0;
        transition: opacity .18s ease;
    }

    .is-context-open .wt-context-overlay {
        pointer-events: auto;
        opacity: 1;
    }

    .wt-question-catalog.wt-context-sidebar {
        border: 0;
        border-left: 1px solid #d7dde5;
        border-radius: 0;
    }

    .wt-question-tree {
        max-height: none;
    }
}

@media (max-width: 560px) {
    .wt-training-context-toggle {
        float: none;
        width: 100%;
        margin: 0 0 12px;
    }

    .wt-preview-dialog-body {
        padding: 16px;
    }

    .wt-preview-dialog-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .wt-preview-dialog-footer .button-secondary {
        width: 100%;
    }
}

/* Wissenstraining: abschließende, modulgebundene Prioritäten. */
.wt-shell .button-primary,
.wt-training-shell .button-primary,
.wt-feedback .button-primary,
.wt-result-shell .button-primary,
.wt-admin-shell .button-primary {
    border-color: #0052b4;
    background: #0052b4;
    color: #fff;
}

.wt-shell .button-primary:hover,
.wt-training-shell .button-primary:hover,
.wt-feedback .button-primary:hover,
.wt-result-shell .button-primary:hover,
.wt-admin-shell .button-primary:hover {
    border-color: #003f8c;
    background: #003f8c;
    color: #fff;
}

/* Wissenstraining: einheitlich eckige, interaktive Bedienelemente. */
.wt-shell .button-primary,
.wt-shell .button-secondary,
.wt-training-shell .button-primary,
.wt-training-shell .button-secondary,
.wt-feedback .button-primary,
.wt-feedback .button-secondary,
.wt-result-shell .button-primary,
.wt-result-shell .button-secondary,
.wt-admin-shell .button-primary,
.wt-admin-shell .button-secondary,
.wt-course-option,
.wt-chapter-option,
.wt-section-option,
.wt-help-button,
.wt-matching-card,
.wt-order-list button,
.wt-chem-keyboard button,
.wt-tree-move-controls button,
.wt-catalog-heading > a {
    border-radius: 4px;
}

@media (max-width: 880px) {
    .wt-training-shell {
        position: relative;
        margin: 0 -20px -20px 0;
    }

    .wt-mobile-progress-toggle {
        position: relative;
        z-index: 31;
    }

    .wt-progress-sidebar.is-mobile-open {
        position: absolute;
        z-index: 30;
        top: 44px;
        left: 0;
        display: flex;
        width: min(350px, calc(100% - 28px));
        min-height: calc(100vh - 44px);
        box-sizing: border-box;
        box-shadow: 0 24px 60px rgba(18, 45, 73, 0.24);
    }
}

.pse-topic-content,
.chemistry-legacy-notice {
    display: grid;
    gap: 16px;
}

.pse-topic-header {
    padding-bottom: 12px;
    border-bottom: 1px solid #dbe3ec;
}

.pse-topic-header h2,
.chemistry-legacy-notice h2,
.chemistry-legacy-notice p {
    margin: 0;
}

.chemistry-legacy-notice {
    max-width: 860px;
    margin-inline: auto;
}

.chemistry-legacy-search {
    margin-top: 8px;
}

/* Chemistry module and lexicons */
.chemistry-module-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 22px;
    padding: 4px;
    border: 1px solid #d7e0ea;
    border-radius: 6px;
    background: #fff;
}

.chemistry-module-nav a {
    display: inline-flex;
    min-height: 38px;
    padding: 8px 14px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #334155;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.chemistry-module-nav a:hover,
.chemistry-module-nav a.is-active {
    background: #075985;
    color: #fff;
    text-decoration: none;
}

.chemistry-hub-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
    gap: 20px;
    align-items: stretch;
}

.chemistry-hub-primary,
.chemistry-hub-lexicons,
.chemistry-hub-cosmetics {
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.chemistry-hub-cosmetics {
    display: flex;
    grid-column: 1 / -1;
    min-height: 170px;
    padding: 24px 28px;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    border-left: 5px solid #b45309;
}

.chemistry-hub-cosmetics > div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 20px;
    align-items: center;
}

.chemistry-hub-cosmetics .chemistry-hub-mark {
    grid-row: 1 / 3;
    border-color: #b45309;
    background: #fff7ed;
    color: #9a3412;
}

.chemistry-hub-cosmetics h2,
.chemistry-hub-cosmetics p {
    margin: 0;
}

.chemistry-hub-cosmetics p {
    color: #526174;
    line-height: 1.55;
}

.chemistry-hub-primary {
    display: flex;
    min-height: 320px;
    padding: 28px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    border-top: 5px solid #0052b4;
}

.chemistry-hub-primary h2,
.chemistry-hub-lexicons h2 {
    margin: 14px 0 8px;
    font-size: 24px;
}

.chemistry-hub-primary p {
    max-width: 43ch;
    color: #526174;
    line-height: 1.65;
}

.chemistry-hub-mark {
    display: inline-grid;
    width: 72px;
    aspect-ratio: 1;
    place-items: center;
    border: 2px solid #0052b4;
    background: #eef6ff;
    color: #0052b4;
    font-size: 20px;
    font-weight: 850;
}

.chemistry-hub-lexicons {
    overflow: hidden;
}

.chemistry-hub-lexicons > header {
    display: flex;
    padding: 20px 22px 14px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.chemistry-hub-lexicons > header h2 {
    margin: 0;
}

.chemistry-hub-lexicons > header a {
    color: #075985;
    font-weight: 750;
}

.chemistry-hub-list {
    border-top: 1px solid #e2e8f0;
}

.chemistry-hub-list > a {
    display: flex;
    min-height: 82px;
    padding: 16px 22px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #e2e8f0;
    color: #172033;
    text-decoration: none;
}

.chemistry-hub-list > a:last-child {
    border-bottom: 0;
}

.chemistry-hub-list > a:hover {
    background: #f7fafc;
    text-decoration: none;
}

.chemistry-hub-list span {
    display: grid;
    gap: 4px;
}

.chemistry-hub-list small {
    color: #64748b;
    line-height: 1.4;
}

.chemistry-hub-list b {
    min-width: 42px;
    color: #075985;
    font-size: 20px;
    text-align: right;
}

.lexicon-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 14px;
    border: 1px solid #cfd9e5;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.chemistry-admin-shell .lexicon-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.lexicon-tabs a {
    display: flex;
    min-height: 52px;
    padding: 10px 14px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-right: 1px solid #dbe3ec;
    color: #334155;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.lexicon-tabs a:last-child {
    border-right: 0;
}

.lexicon-tabs a:hover,
.lexicon-tabs a.is-active {
    background: #075985;
    color: #fff;
    text-decoration: none;
}

.lexicon-tabs small {
    font-size: 12px;
    opacity: 0.8;
}

.lexicon-toolbar {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.lexicon-toolbar .chemistry-search {
    display: flex;
    width: 100%;
    align-items: end;
    gap: 10px;
}

.lexicon-toolbar .chemistry-search label {
    flex: 1 1 420px;
}

.lexicon-alphabet {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.lexicon-alphabet a,
.lexicon-alphabet span {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.lexicon-alphabet a:first-child {
    width: auto;
    padding-inline: 12px;
}

.lexicon-alphabet a:hover,
.lexicon-alphabet a.is-active {
    border-color: #075985;
    background: #075985;
    color: #fff;
    text-decoration: none;
}

.lexicon-alphabet span {
    border-color: #e5eaf0;
    background: #f3f5f7;
    color: #a2adba;
}

.lexicon-workbench {
    display: grid;
    grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.lexicon-result-list {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    border: 1px solid #d7e0ea;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.lexicon-result-list > header {
    display: flex;
    padding: 13px 15px;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid #dfe6ee;
    background: #f6f8fb;
    color: #526174;
    font-size: 13px;
}

.lexicon-result-list > div {
    max-height: calc(100vh - 92px);
    overflow-y: auto;
}

.lexicon-result-list a {
    display: grid;
    gap: 4px;
    padding: 13px 15px;
    border-bottom: 1px solid #e6ebf1;
    color: #1e293b;
    text-decoration: none;
}

.lexicon-result-list a:hover,
.lexicon-result-list a.is-active {
    background: #eaf4fb;
    box-shadow: inset 4px 0 #0284a8;
    text-decoration: none;
}

.lexicon-result-list a strong {
    font-size: 14px;
    line-height: 1.35;
}

.lexicon-result-list a small {
    display: -webkit-box;
    overflow: hidden;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.lexicon-empty-list {
    padding: 18px;
}

.lexicon-article {
    min-width: 0;
    overflow: visible;
}

.lexicon-empty-state {
    padding: 34px;
}

.lexicon-empty-state h2 {
    margin-top: 0;
}

.lexicon-article-header {
    display: flex;
    padding: 24px 26px;
    align-items: center;
    gap: 22px;
    border-bottom: 1px solid #dde5ee;
    background: #f8fafc;
}

.lexicon-article-header img {
    width: 116px;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.lexicon-article-header p {
    margin: 0 0 5px;
    color: #087f8c;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.lexicon-article-header h2 {
    margin: 0;
    font-size: clamp(25px, 3vw, 38px);
    line-height: 1.12;
}

.lexicon-article-header strong {
    display: block;
    margin-top: 7px;
    color: #64748b;
}

.lexicon-article-body {
    padding: 10px 26px 30px;
}

.lexicon-content-section {
    padding: 20px 0;
    border-bottom: 1px solid #e2e8f0;
}

.lexicon-content-section:last-child {
    border-bottom: 0;
}

.lexicon-content-section > h3 {
    margin: 0 0 13px;
    font-size: 19px;
}

.lexicon-content-section[data-section-type="equipment"],
.lexicon-content-section[data-section-type="chemicals"] {
    padding: 17px 18px;
    border: 1px solid #d8e2ec;
    border-radius: 6px;
    background: #f8fafc;
}

.lexicon-content-section[data-section-type="procedure"] {
    border-left: 4px solid #0284a8;
    padding-left: 18px;
}

.lexicon-content-section[data-section-type="safety"] {
    border-left: 4px solid #c2410c;
    padding: 16px 18px;
    background: #fff7ed;
}

.chemistry-richtext .chemistry-legacy-table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.chemistry-richtext .chemistry-legacy-table th,
.chemistry-richtext .chemistry-legacy-table td {
    padding: 9px 11px;
    border: 1px solid #d7e0ea;
    vertical-align: top;
}

.chemistry-richtext .chemistry-content-image,
.chemistry-richtext img {
    max-width: 100%;
    height: auto;
}

.chemistry-media-center {
    display: flex;
    justify-content: center;
}

.chemistry-note-box,
.chemistry-related-box,
.chemistry-richtext .well {
    margin: 14px 0;
    padding: 14px 16px;
    border-left: 4px solid #d4a017;
    background: #fffbea;
}

.lexicon-search-result-list a strong {
    min-width: 150px;
}

.cosmetics-toolbar {
    display: grid;
    gap: 15px;
}

.cosmetics-toolbar .chemistry-search {
    display: flex;
    align-items: end;
    gap: 12px;
}

.cosmetics-toolbar .chemistry-search label {
    flex: 1 1 420px;
}

.cosmetics-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.cosmetics-category-nav a {
    display: inline-flex;
    min-height: 38px;
    padding: 8px 12px;
    align-items: center;
    gap: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    color: #263449;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.cosmetics-category-nav a:hover,
.cosmetics-category-nav a.is-active {
    border-color: #0f766e;
    background: #e8f7f4;
    color: #115e59;
    text-decoration: none;
}

.cosmetics-category-nav span {
    color: #64748b;
    font-size: 12px;
}

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

.cosmetics-entry-list {
    position: sticky;
    top: 18px;
    overflow: hidden;
    max-height: calc(100vh - 36px);
    border: 1px solid #d7e0ea;
    border-radius: 7px;
    background: #fff;
}

.cosmetics-entry-list > header {
    display: flex;
    min-height: 54px;
    padding: 13px 15px;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.cosmetics-entry-list > header span,
.cosmetics-entry-list a small {
    color: #64748b;
    font-size: 12px;
}

.cosmetics-entry-list > div {
    max-height: calc(100vh - 92px);
    overflow-y: auto;
}

.cosmetics-entry-list h3 {
    margin: 0;
    padding: 11px 14px 7px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.cosmetics-entry-list a {
    display: grid;
    padding: 11px 14px;
    gap: 3px;
    border-top: 1px solid #edf1f5;
    color: #172033;
    text-decoration: none;
}

.cosmetics-entry-list a:hover,
.cosmetics-entry-list a.is-active {
    background: #e8f7f4;
    color: #115e59;
    text-decoration: none;
}

.cosmetics-empty-list {
    padding: 16px;
}

.cosmetics-article {
    min-width: 0;
    overflow: hidden;
}

.cosmetics-intro {
    display: grid;
    max-width: 780px;
    padding: 34px;
    gap: 13px;
}

.cosmetics-intro h2,
.cosmetics-intro p {
    margin: 0;
}

.cosmetics-intro > p:not(.eyebrow) {
    line-height: 1.65;
}

.cosmetics-safety-note {
    margin-top: 10px !important;
    padding: 14px 16px;
    border-left: 4px solid #b45309;
    background: #fff7ed;
}

.cosmetics-article-header {
    display: flex;
    min-height: 110px;
    padding: 24px 26px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.cosmetics-article-header p,
.cosmetics-article-header h2 {
    margin: 0;
}

.cosmetics-article-header p {
    margin-bottom: 5px;
    color: #0f766e;
    font-size: 13px;
    font-weight: 800;
}

.cosmetics-article-header h2 {
    font-size: 25px;
}

.cosmetics-article-body {
    padding: 8px 26px 30px;
}

.cosmetics-content-section {
    padding: 20px 0;
    border-bottom: 1px solid #e2e8f0;
}

.cosmetics-content-section:last-child {
    border-bottom: 0;
}

.cosmetics-content-section > h3 {
    margin: 0 0 13px;
    font-size: 19px;
}

.cosmetics-content-section[data-section-type="chemicals"] {
    margin: 14px 0;
    padding: 17px 18px;
    border: 1px solid #cfe0dc;
    border-radius: 6px;
    background: #f1faf8;
}

.cosmetics-content-section[data-section-type="procedure"] {
    padding-left: 18px;
    border-left: 4px solid #0f766e;
}

.cosmetics-content-section[data-section-type="safety"] {
    padding: 16px 18px;
    border-left: 4px solid #b45309;
    background: #fff7ed;
}

.cosmetics-article-body .checkbox {
    display: grid;
    gap: 10px;
}

.cosmetics-article-body label:has(input[type="checkbox"]) {
    position: relative;
    display: block;
    min-height: 22px;
    padding-left: 30px;
    line-height: 1.55;
    overflow-wrap: normal;
    word-break: normal;
}

.cosmetics-article-body .checkbox > br {
    display: none;
}

.cosmetics-article-body label:has(input[type="checkbox"]) a {
    display: inline;
    overflow-wrap: break-word;
    word-break: normal;
}

.cosmetics-article-body input[type="checkbox"] {
    position: absolute;
    top: 2px;
    left: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #0f766e;
}

.chemistry-nowrap {
    white-space: nowrap;
}

.lexicon-admin-layout {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    align-items: start;
}

.lexicon-admin-sidebar {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    padding: 16px;
    overflow: hidden;
}

.lexicon-admin-create {
    display: grid;
    gap: 9px;
    margin: 18px 0;
    padding-top: 16px;
    border-top: 1px solid #dfe6ee;
}

.lexicon-admin-create label {
    display: grid;
    gap: 6px;
}

.lexicon-admin-create label span {
    font-weight: 750;
}

.lexicon-admin-entry-list {
    display: grid;
    max-height: calc(100vh - 330px);
    overflow-y: auto;
    border-top: 1px solid #dfe6ee;
}

.lexicon-admin-entry-list a {
    display: flex;
    padding: 10px 8px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid #edf0f4;
    color: #334155;
    font-size: 13px;
    text-decoration: none;
}

.lexicon-admin-entry-list a:hover,
.lexicon-admin-entry-list a.is-active {
    background: #eaf4fb;
    color: #075985;
    text-decoration: none;
}

.lexicon-admin-entry-list small {
    color: #b45309;
}

.lexicon-admin-main,
.lexicon-admin-sections {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.lexicon-entry-meta-form {
    padding: 20px;
}

.lexicon-admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.lexicon-admin-form-grid.is-compact {
    grid-template-columns: minmax(0, 1fr) 150px;
}

.chemistry-checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 9px;
}

.chemistry-checkbox-row input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    padding: 0;
}

.lexicon-admin-sections > header {
    padding: 5px 2px;
}

.lexicon-admin-sections h2,
.lexicon-admin-assets h2 {
    margin: 0 0 4px;
}

.lexicon-admin-sections .chemistry-editor-card {
    overflow: hidden;
}

.lexicon-admin-sections summary {
    display: flex;
    padding: 15px 17px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
}

.lexicon-admin-sections summary span:first-child {
    display: grid;
    gap: 3px;
}

.lexicon-admin-sections summary small {
    color: #64748b;
    font-size: 12px;
}

.lexicon-admin-sections details form {
    padding: 0 17px 18px;
    border-top: 1px solid #e2e8f0;
}

.lexicon-admin-assets {
    margin-top: 4px;
    padding: 20px;
}

.lexicon-asset-upload {
    margin-top: 4px;
    padding: 20px;
}

.lexicon-asset-upload h2 {
    margin: 0;
}

.lexicon-admin-assets > div {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.lexicon-admin-assets article {
    display: flex;
    padding: 9px;
    align-items: center;
    gap: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
}

.lexicon-admin-assets img {
    width: 56px;
    height: 48px;
    object-fit: contain;
    background: #f8fafc;
}

.lexicon-admin-assets article span {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.lexicon-admin-assets small {
    overflow: hidden;
    color: #64748b;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 980px) {
    .chemistry-hub-layout,
    .lexicon-workbench,
    .lexicon-admin-layout {
        grid-template-columns: 1fr;
    }

    .cosmetics-workbench {
        grid-template-columns: 1fr;
    }

    .cosmetics-entry-list {
        position: static;
        max-height: none;
    }

    .cosmetics-entry-list > div {
        max-height: 420px;
    }

    .lexicon-result-list,
    .lexicon-admin-sidebar {
        position: static;
        max-height: none;
    }

    .lexicon-result-list > div,
    .lexicon-admin-entry-list {
        max-height: 360px;
    }
}

@media (max-width: 760px) {
    .chemistry-admin-shell .lexicon-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .chemistry-hub-cosmetics,
    .cosmetics-article-header,
    .cosmetics-toolbar .chemistry-search {
        align-items: stretch;
        flex-direction: column;
    }

    .chemistry-hub-cosmetics > div {
        grid-template-columns: 1fr;
    }

    .chemistry-hub-cosmetics .chemistry-hub-mark {
        grid-row: auto;
    }

    .cosmetics-toolbar .chemistry-search label {
        flex-basis: auto;
    }

    .cosmetics-intro,
    .cosmetics-article-body,
    .cosmetics-article-header {
        padding-inline: 18px;
    }
    .lexicon-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lexicon-tabs a:nth-child(2) {
        border-right: 0;
    }

    .lexicon-tabs a:nth-child(-n+2) {
        border-bottom: 1px solid #dbe3ec;
    }

    .lexicon-toolbar .chemistry-search,
    .lexicon-article-header {
        align-items: stretch;
        flex-direction: column;
    }

    .lexicon-toolbar .chemistry-search label {
        flex-basis: auto;
    }

    .lexicon-article-header img {
        width: 104px;
    }

    .lexicon-article-body,
    .lexicon-article-header {
        padding-inline: 18px;
    }

    .lexicon-admin-form-grid,
    .lexicon-admin-form-grid.is-compact {
        grid-template-columns: 1fr;
    }
}

/* Projektweite Bedienelemente: flach, klar und touchfreundlich. */
:root {
    --control-radius: 6px;
    --control-height: 44px;
    --control-border: #b8c4d1;
    --control-text: #172033;
    --control-primary: #0f766e;
    --control-primary-hover: #115e59;
    --control-focus: #0b7794;
}

.button-primary,
.button-secondary,
.module-action-button,
.public-login-button,
.form-stack button,
.editor-actions .button-primary,
.editor-actions .button-secondary,
.chemistry-panel .button-primary,
.chemistry-panel .button-secondary,
.chemistry-pse-controls .button-primary,
.chemistry-pse-controls .button-secondary,
.chemistry-table-controls .button-primary,
.chemistry-table-controls .button-secondary {
    box-sizing: border-box;
    min-height: var(--control-height);
    padding: 10px 18px;
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
    font: inherit;
    font-weight: 750;
    line-height: 1.25;
    text-align: center;
    text-decoration: none !important;
    box-shadow: none;
    transform: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.button-primary,
.form-stack button,
.public-login-button,
.module-action-button.is-primary {
    border-color: var(--control-primary);
    background: var(--control-primary);
    color: #fff !important;
}

.button-primary:hover,
.form-stack button:hover,
.public-login-button:hover,
.module-action-button.is-primary:hover {
    border-color: var(--control-primary-hover);
    background: var(--control-primary-hover);
    color: #fff !important;
    box-shadow: none;
    transform: none;
}

.button-secondary,
.module-action-button:not(.is-primary),
.editor-actions .button-secondary {
    border-color: var(--control-border);
    background: #fff;
    color: var(--control-text);
    box-shadow: none;
}

.button-secondary:hover,
.module-action-button:not(.is-primary):hover,
.editor-actions .button-secondary:hover {
    border-color: #708297;
    background: #f1f5f9;
    color: #0f172a;
    box-shadow: none;
    transform: none;
}

.button-danger,
.module-action-button.is-danger,
.palette-delete-button,
.pse-color-delete {
    border-color: #e7a4a4;
    background: #fff;
    color: #9f1d1d;
    box-shadow: none;
}

.button-danger:hover,
.module-action-button.is-danger:hover,
.palette-delete-button:hover,
.pse-color-delete:hover {
    border-color: #c24141;
    background: #fff1f2;
    color: #7f1d1d;
}

.module-action-button,
.dialog-close-button,
.wt-dialog-close,
.sidebar-toggle,
.nav-group-toggle,
.wt-tree-move-controls button,
.wt-order-list button {
    min-width: var(--control-height);
    min-height: var(--control-height);
}

.dialog-close-button,
.wt-dialog-close,
.sidebar-toggle,
.nav-group-toggle,
.wt-tree-move-controls button,
.wt-order-list button,
.wt-chem-keyboard button,
.tool-grid button,
.palette-delete-button,
.wt-help-button,
.wt-mobile-progress-toggle {
    border-radius: var(--control-radius);
    box-shadow: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.wt-chem-keyboard button,
.tool-grid button,
.palette-delete-button,
.wt-help-button,
.wt-mobile-progress-toggle {
    min-height: var(--control-height);
}

.wt-course-option,
.wt-chapter-option,
.wt-section-option,
.wt-matching-card,
.wt-catalog-heading > a {
    border-radius: var(--control-radius);
    box-shadow: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.public-nav a,
.sidebar-nav a,
.nav-disabled {
    min-height: var(--control-height);
    box-sizing: border-box;
}

.public-login-button {
    padding-inline: 18px;
}

.sidebar-nav a,
.nav-disabled,
.nav-parent-row,
.sidebar-nav .nav-parent-link,
.sidebar-nav .nav-subitem {
    border-radius: var(--control-radius);
}

:where(
    button,
    [role="button"],
    .button-primary,
    .button-secondary,
    .module-action-button,
    .public-login-button,
    .sidebar-nav a,
    .wt-course-option,
    .wt-chapter-option,
    .wt-section-option,
    .wt-matching-card
):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--control-focus) 38%, transparent);
    outline-offset: 2px;
    box-shadow: none;
}

:where(button, .button-primary, .button-secondary, .module-action-button)[disabled],
:where(.button-primary, .button-secondary, .module-action-button).disabled {
    cursor: not-allowed;
    opacity: .58;
    box-shadow: none;
}

@media (max-width: 600px) {
    .button-row,
    .home-actions,
    .wt-answer-actions,
    .wt-admin-header-actions,
    .wt-editor-footer,
    .wt-author-footer,
    .pattern-rename-actions {
        align-items: stretch;
        width: 100%;
    }

    .button-row > :is(a, button, form),
    .home-actions > :is(a, button),
    .wt-answer-actions > :is(a, button, form),
    .wt-admin-header-actions > :is(a, button),
    .wt-editor-footer > :is(a, button),
    .wt-author-footer > :is(a, button),
    .pattern-rename-actions > :is(a, button) {
        width: 100%;
    }

    .button-row form > button,
    .wt-answer-actions form > button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .button-primary,
    .button-secondary,
    .module-action-button,
    .public-login-button {
        transition: none;
    }
}

/* Wissenstraining: kompaktes, responsives Gesamtlayout. */
.wt-shell {
    width: min(1440px, calc(100% - 32px));
    color: #142033;
}

.wt-page-header {
    gap: 18px;
    margin-bottom: 18px;
}

.wt-page-header h1,
.wt-question-workspace h1,
.wt-feedback h1,
.wt-result-summary h1 {
    margin-bottom: 6px;
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.12;
    letter-spacing: -.025em;
}

.wt-page-header p,
.wt-result-summary > p {
    max-width: 780px;
    font-size: 15px;
    line-height: 1.5;
}

.wt-admin-kicker {
    margin-bottom: 4px;
    color: #0052b4;
}

.wt-picker,
.wt-question-catalog,
.wt-question-editor,
.wt-author-card,
.wt-structure-card,
.wt-structure-tree,
.wt-review-card,
.wt-empty-review,
.wt-result-summary {
    border-radius: 6px;
    box-shadow: none;
}

.wt-picker-step {
    grid-template-columns: minmax(180px, .55fr) minmax(0, 2fr);
    gap: 20px;
    padding: 18px 20px;
}

.wt-step-heading {
    gap: 10px;
}

.wt-step-heading > span {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    font-size: 13px;
}

.wt-step-heading h2 {
    font-size: 17px;
}

.wt-step-heading p {
    margin-top: 3px;
    line-height: 1.35;
}

.wt-course-rail {
    gap: 8px;
    padding-bottom: 4px;
}

.wt-course-option {
    flex-basis: 220px;
    min-height: 72px;
    gap: 3px;
    padding: 11px 13px;
}

.wt-chapter-list,
.wt-section-list {
    gap: 7px;
}

.wt-chapter-option,
.wt-section-option {
    min-height: 50px;
    gap: 9px;
    padding: 8px 12px;
}

.wt-chapter-option > span:last-child,
.wt-section-option > span:last-child {
    gap: 1px;
}

.wt-start-bar {
    gap: 12px;
    padding: 14px 20px;
}

.wt-start-bar label {
    gap: 4px;
    font-size: 14px;
}

.wt-training-shell {
    grid-template-columns: 236px minmax(0, 1fr);
}

.wt-progress-sidebar {
    gap: 22px;
    padding: 24px 20px;
}

.wt-progress-sidebar h2 {
    margin-bottom: 12px;
    font-size: 17px;
}

.wt-progress-track {
    margin-bottom: 15px;
}

.wt-progress-list {
    gap: 9px;
    font-size: 14px;
}

.wt-help-list {
    margin-top: 20px;
    padding-top: 16px;
}

.wt-question-workspace {
    width: min(920px, calc(100% - 40px));
    padding: 26px 0 44px;
}

.wt-question-context {
    margin-bottom: 10px;
    font-size: 14px;
}

.wt-question-copy {
    font-size: 17px;
    line-height: 1.55;
}

.wt-answer-form {
    gap: 17px;
    margin-top: 18px;
}

.wt-choice-list {
    gap: 8px;
}

.wt-choice-list label {
    min-height: 50px;
    gap: 11px;
    padding: 6px 13px;
}

.wt-matching-board {
    gap: clamp(72px, 10vw, 130px);
}

.wt-matching-sources,
.wt-matching-targets {
    gap: 11px;
}

.wt-matching-card {
    min-height: 52px;
    padding: 9px 14px;
}

.wt-feedback-shell,
.wt-result-shell {
    padding-top: 20px;
}

.wt-feedback,
.wt-result-summary {
    max-width: 900px;
}

.wt-feedback {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 18px;
    padding: 22px;
}

.wt-feedback-symbol {
    width: 48px;
    height: 48px;
    font-size: 27px;
}

.wt-explanation {
    margin: 14px 0 18px;
    line-height: 1.5;
}

.wt-inline-feedback {
    margin-top: 22px;
}

.wt-inline-feedback h2 {
    font-size: 23px;
}

.wt-result-summary {
    padding: 24px;
}

.wt-result-values {
    margin: 22px 0;
}

.wt-result-values div {
    gap: 4px;
    padding: 16px;
}

.wt-result-values strong {
    font-size: 28px;
}

/* Verwaltung: mehr Arbeitsfläche, weniger Karten- und Formularleerraum. */
.wt-admin-header-actions {
    gap: 7px;
    justify-content: flex-end;
}

.wt-admin-header-actions .button-primary,
.wt-admin-header-actions .button-secondary {
    padding-inline: 13px;
    font-size: 14px;
}

.wt-admin-workbench {
    grid-template-columns: minmax(260px, 292px) minmax(0, 1fr);
    gap: 14px;
}

.wt-question-catalog {
    top: 10px;
}

.wt-catalog-heading {
    gap: 10px;
    padding: 11px 12px;
}

.wt-catalog-heading strong {
    font-size: 17px;
}

.wt-catalog-heading > a {
    width: 44px;
    height: 44px;
}

.wt-question-tree {
    max-height: min(780px, calc(100vh - 150px));
    padding: 6px;
}

.wt-tree-course > summary {
    padding: 7px 6px;
}

.wt-tree-chapter {
    margin-left: 6px !important;
}

.wt-tree-chapter > summary {
    padding: 6px 7px;
}

.wt-tree-section {
    margin: 2px 0 5px 7px !important;
}

.wt-tree-section > summary {
    min-height: 36px;
    box-sizing: border-box;
    padding: 5px 7px;
}

.wt-tree-section ol {
    margin-top: 2px;
    padding: 1px 0;
}

.wt-tree-question {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 5px;
    margin: 2px 0;
    padding: 5px 6px;
}

.wt-tree-move-controls {
    gap: 2px;
}

.wt-tree-move-controls button {
    min-width: 34px;
    min-height: 34px;
}

.wt-editor-heading {
    gap: 14px;
    padding: 15px 18px;
}

.wt-editor-heading h2 {
    font-size: 23px;
}

.wt-type-badge {
    border-radius: 4px;
    padding: 5px 8px;
}

.wt-editor-section {
    grid-template-columns: minmax(145px, 172px) minmax(0, 1fr);
    gap: 18px;
    padding: 17px 18px;
}

.wt-editor-section-title {
    gap: 8px;
}

.wt-editor-section-title > span {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
    border-radius: 4px;
}

.wt-editor-section-title h3 {
    margin-top: 1px;
    font-size: 16px;
}

.wt-editor-section-title p {
    line-height: 1.35;
}

.wt-editor-fields,
.wt-answer-field-editor-list {
    gap: 12px;
}

.wt-editor-fields label {
    gap: 5px;
}

.wt-answer-field-editor > header {
    padding: 9px 11px;
}

.wt-answer-field-editor .wt-editor-fields {
    padding: 12px;
}

.wt-keyword-rule-editor {
    gap: 10px;
    padding: 12px;
}

.wt-check-row {
    gap: 9px;
    padding: 10px 11px;
}

.wt-section-assignment-list {
    gap: 9px;
    max-height: 330px;
    padding: 8px;
}

.wt-assignment-course {
    gap: 5px;
}

.wt-assignment-option {
    min-height: 44px;
    box-sizing: border-box;
    padding: 7px 8px;
}

.wt-shared-question-warning {
    margin: 12px 18px 0;
}

.wt-editor-footer {
    position: sticky;
    z-index: 4;
    bottom: 0;
    gap: 8px;
    padding: 10px 18px;
    border-top: 1px solid #dce5ef;
}

.wt-admin-shell .wt-results-table {
    margin-top: 14px;
}

.wt-results-table {
    padding: 16px;
}

.wt-table-wrap th,
.wt-table-wrap td {
    padding: 8px 9px;
}

/* Autoren-, Struktur- und Prüfseiten. */
.wt-author-shell,
.wt-structure-shell,
.wt-review-shell {
    gap: 14px;
}

.wt-author-form {
    gap: 10px;
}

.wt-author-card {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
    gap: 18px;
    padding: 16px 18px;
}

.wt-author-card > header {
    margin-bottom: 12px;
}

.wt-type-guide {
    margin-bottom: 0;
    padding: 11px 13px;
    line-height: 1.45;
}

.wt-type-guide h3:first-child {
    margin-top: 0;
}

.wt-editor-options {
    gap: 9px;
}

.wt-author-footer {
    position: sticky;
    z-index: 5;
    bottom: 0;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 6px;
}

.wt-structure-explainer {
    gap: 10px 16px;
    padding: 11px 14px;
    line-height: 1.4;
}

.wt-structure-layout {
    grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
    gap: 14px;
}

.wt-structure-tree {
    gap: 10px;
    padding: 15px;
}

.wt-course-tree {
    margin-top: 10px;
    border-radius: 6px;
}

.wt-course-tree > header {
    gap: 10px;
    padding: 10px 12px;
}

.wt-course-tree > header h3 {
    margin-top: 1px;
}

.wt-chapter-tree {
    padding: 11px 12px;
}

.wt-chapter-tree h4 {
    margin-bottom: 7px;
}

.wt-chapter-tree ol {
    gap: 5px;
}

.wt-chapter-tree li {
    gap: 10px;
    padding: 7px 9px;
}

.wt-structure-forms {
    top: 10px;
    gap: 8px;
}

.wt-structure-forms details {
    border-radius: 6px;
}

.wt-structure-forms summary {
    min-height: 44px;
    box-sizing: border-box;
    padding: 11px 13px;
}

.wt-structure-forms form {
    padding: 0 13px 13px;
}

.wt-review-list {
    gap: 12px;
}

.wt-review-card,
.wt-empty-review {
    padding: 17px 18px;
}

.wt-review-card > header {
    gap: 14px;
    padding-bottom: 11px;
}

.wt-review-prompt {
    margin: 13px 0;
}

.wt-review-answer {
    gap: 5px;
    margin-bottom: 13px;
    padding: 10px 12px;
}

.wt-review-form {
    grid-template-columns: minmax(140px, 190px) minmax(260px, 1fr);
    gap: 11px 14px;
}

.wt-review-form textarea {
    min-height: 100px;
}

@media (max-width: 1100px) {
    .wt-admin-workbench {
        grid-template-columns: minmax(230px, 260px) minmax(0, 1fr);
    }

    .wt-editor-section,
    .wt-author-card {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .wt-editor-section-title > div,
    .wt-author-card > .wt-editor-section-title > div {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 8px;
        align-items: baseline;
    }

    .wt-editor-section-title p {
        margin-top: 1px;
    }
}

@media (max-width: 760px) {
    .wt-shell {
        width: min(100% - 20px, 1440px);
    }

    .wt-page-header {
        gap: 12px;
        margin-bottom: 14px;
    }

    .wt-admin-header-actions {
        justify-content: flex-start;
    }

    .wt-picker-step {
        grid-template-columns: 1fr;
        gap: 11px;
        padding: 14px;
    }

    .wt-course-description {
        grid-column: 1;
    }

    .wt-start-bar {
        padding: 12px 14px;
    }

    .wt-training-shell {
        margin: 0 -20px -20px 0;
    }

    .wt-question-workspace {
        width: calc(100% - 24px);
        padding: 18px 0 32px;
    }

    .wt-admin-workbench,
    .wt-structure-layout {
        grid-template-columns: 1fr;
    }

    .wt-question-catalog,
    .wt-structure-forms {
        position: static;
    }

    .wt-question-editor {
        order: -1;
    }

    .wt-question-tree {
        max-height: 420px;
    }

    .wt-editor-heading,
    .wt-editor-section,
    .wt-author-card,
    .wt-review-card,
    .wt-result-summary {
        padding: 14px;
    }

    .wt-editor-footer,
    .wt-author-footer {
        margin-inline: -1px;
    }
}

@media (max-width: 520px) {
    .wt-page-header h1,
    .wt-question-workspace h1,
    .wt-feedback h1,
    .wt-result-summary h1 {
        font-size: 27px;
    }

    .wt-admin-header-actions > *,
    .wt-start-bar > *,
    .wt-editor-footer > *,
    .wt-author-footer > * {
        width: 100%;
    }

    .wt-course-option {
        flex-basis: min(82vw, 210px);
    }

    .wt-feedback {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px;
    }

    .wt-result-values {
        grid-template-columns: 1fr;
    }

    .wt-result-values div + div {
        border-top: 1px solid #dce3ec;
        border-left: 0;
    }

    .wt-result-values div {
        grid-template-columns: auto 1fr;
        align-items: baseline;
        text-align: left;
    }

    .wt-editor-heading,
    .wt-review-card > header,
    .wt-course-tree > header,
    .wt-chapter-tree li,
    .wt-structure-explainer {
        align-items: flex-start;
        flex-direction: column;
    }

    .wt-review-form {
        grid-template-columns: 1fr;
        grid-template-areas: "points" "correct" "note" "submit";
    }

    .wt-review-form .button-primary {
        width: 100%;
        justify-self: stretch;
    }

    .wt-editor-footer,
    .wt-author-footer {
        flex-direction: column-reverse;
    }
}

/* Wissenstraining: Fortschrittsbereich vollständig im sichtbaren Inhaltsbereich halten. */
.wt-training-shell {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin: 0;
    overflow: visible;
}

.wt-progress-sidebar,
.wt-question-workspace {
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 880px) {
    .wt-training-shell {
        margin: 0;
    }

    .wt-progress-sidebar.is-mobile-open {
        top: 44px;
        left: 0;
        width: min(350px, calc(100% - 16px));
        max-height: calc(100vh - 44px);
        min-height: 0;
        overflow-y: auto;
    }
}

@media (max-width: 760px) {
    .wt-training-shell {
        margin: 0;
    }

    .wt-admin-workbench:has(.wt-empty-editor) .wt-question-catalog {
        order: -1;
    }
}

/* Wissenstraining-Kontextleisten: abschließende Kaskadenpriorität. */
.wt-training-shell {
    display: block;
}

.wt-admin-workbench,
.wt-training-shell.is-context-collapsed,
.wt-admin-workbench.is-context-collapsed {
    display: block;
}

.app-content:has(> .wt-training-shell),
.app-content:has(> .wt-admin-shell) {
    box-sizing: border-box;
    padding-right: 286px;
    transition: padding-right .18s ease;
}

.app-content:has(> .wt-training-shell.is-context-collapsed),
.app-content:has(> .wt-admin-shell .wt-admin-workbench.is-context-collapsed) {
    padding-right: 0;
}

.wt-context-sidebar,
.wt-progress-sidebar,
.wt-question-catalog.wt-context-sidebar {
    position: fixed;
    z-index: 20;
    top: 66px;
    right: 0;
    left: auto;
    display: flex;
    width: 286px;
    max-width: 286px;
    height: calc(100vh - 66px);
    max-height: calc(100vh - 66px);
    min-height: 0;
    box-sizing: border-box;
    overflow-y: auto;
    border: 0;
    border-left: 1px solid #d7dde5;
    border-radius: 0;
    opacity: 1;
    transform: translateX(0);
}

.wt-question-catalog.wt-context-sidebar {
    display: block;
    overflow: hidden;
}

.wt-question-catalog.wt-context-sidebar .wt-question-tree {
    max-height: calc(100vh - 140px);
}

.wt-training-shell.is-context-collapsed .wt-context-sidebar,
.wt-admin-workbench.is-context-collapsed .wt-context-sidebar {
    opacity: 0;
    pointer-events: none;
    transform: translateX(100%);
}

@media (max-width: 980px) {
    .app-content:has(> .wt-training-shell),
    .app-content:has(> .wt-admin-shell),
    .app-content:has(> .wt-training-shell.is-context-collapsed),
    .app-content:has(> .wt-admin-shell .wt-admin-workbench.is-context-collapsed) {
        padding-right: 0;
    }

    .wt-training-shell,
    .wt-training-shell.is-context-collapsed,
    .wt-admin-workbench,
    .wt-admin-workbench.is-context-collapsed {
        display: block;
    }

    .wt-context-sidebar,
    .wt-progress-sidebar,
    .wt-question-catalog.wt-context-sidebar,
    .wt-question-catalog {
        position: fixed;
        z-index: 80;
        top: 0;
        right: 0;
        left: auto;
        width: min(84vw, 340px);
        max-width: 340px;
        height: 100vh;
        max-height: 100vh;
        min-height: 100vh;
        overflow-y: auto;
        opacity: 1;
        pointer-events: auto;
        transform: translateX(105%);
    }

    .wt-progress-sidebar {
        display: flex;
    }

    .wt-training-shell.is-context-open .wt-context-sidebar,
    .wt-admin-workbench.is-context-open .wt-context-sidebar {
        transform: translateX(0);
    }

    .wt-question-catalog.wt-context-sidebar .wt-question-tree {
        max-height: calc(100vh - 70px);
    }
}
