/* Page-specific styles on top of app.css. */

.accent { color: var(--accent); }
.accent-text { color: var(--accent); }
.align-start { align-self: flex-start; }
.pre-wrap { white-space: pre-wrap; }
.input.compact { height: 32px; width: auto; min-width: 130px; font-size: 13px; }
.sub-head { margin: 0; font-size: 13px; font-weight: 600; }
.accent-link { color: var(--accent); font-size: 13px; font-weight: 550; align-self: flex-start; }
.accent-link:hover { color: var(--accent-hover); }
.filter-bar { gap: 8px; padding: 14px 20px; }
.filter-bar .search-field input { width: 160px; }
.error-cell { color: #FF9C9C; font-size: 12px; max-width: 24rem; }
.lg-btn { height: 44px; font-size: 14px; }

/* ---------- Jobs ---------- */
.job-row { cursor: pointer; }
.job-row:hover > td { background: var(--s2); }
.job-row.open > td { background: var(--s2); border-bottom-color: transparent; }
.job-chevron { color: var(--dim); vertical-align: -2px; transition: transform .15s ease; }
.job-row.open .job-chevron { transform: rotate(90deg); color: var(--accent); }
.job-source { max-width: 18rem; }
.job-source a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job-detail-row > td { background: var(--s2); padding: 4px 20px 18px 44px; }
.job-detail { display: flex; flex-direction: column; gap: 14px; }
.job-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 14px 28px; }
.job-detail-block { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.job-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.job-files li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.job-files a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-error { max-width: none; }
.job-log { font-size: 13px; border-left: 2px solid var(--line3); padding-left: 12px; }
.job-log h2 { font-size: 13px; margin: 0 0 6px; }
.job-log ul { margin: 0; }

/* ---------- Live updates ---------- */
.live-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 0 rgba(126, 226, 168, 0.5);
    animation: sb-live 2.4s ease-out infinite;
}
@keyframes sb-live {
    0% { box-shadow: 0 0 0 0 rgba(126, 226, 168, 0.55); }
    70%, 100% { box-shadow: 0 0 0 6px rgba(126, 226, 168, 0); }
}

/* A row/card that just changed glows briefly (two names so the animation restarts on the next change). */
tr.fresh-a > td, .fresh-a:not(tr) { animation: sb-fresh-a 1.6s ease-out; }
tr.fresh-b > td, .fresh-b:not(tr) { animation: sb-fresh-b 1.6s ease-out; }
@keyframes sb-fresh-a { 0% { background-color: rgba(200, 241, 105, 0.12); } 100% { background-color: transparent; } }
@keyframes sb-fresh-b { 0% { background-color: rgba(200, 241, 105, 0.12); } 100% { background-color: transparent; } }

.run-live { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }

/* Toasts (LiveToasts.razor): finished jobs, bottom right. */
.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1080;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}
.live-toast {
    pointer-events: auto;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--s2);
    box-shadow: inset 0 0 0 1px var(--line2), inset 3px 0 0 var(--tone, var(--accent)), 0 12px 30px rgba(0, 0, 0, 0.45);
    animation: sb-toast-in 0.35s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.live-toast.ok { --tone: var(--ok); }
.live-toast.fail { --tone: var(--fail); }
.live-toast .toast-icon { color: var(--tone); flex-shrink: 0; margin-top: 1px; }
.live-toast .toast-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.live-toast .toast-title { font-size: 13px; font-weight: 600; color: var(--text); }
.live-toast .toast-text { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.live-toast .toast-text a { color: var(--body-text); }
.live-toast .toast-close { background: none; border: 0; color: var(--dim); padding: 0 2px; line-height: 1; font-size: 14px; cursor: pointer; }
.live-toast .toast-close:hover { color: var(--text); }
@keyframes sb-toast-in {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: none; }
}
@media (max-width: 767.98px) {
    .toast-stack { right: 16px; bottom: calc(88px + var(--safe-bottom)); }
}

/* Wiki page changed while being read (WikiBrowser.razor). */
.page-changed {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: rgba(122, 162, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(122, 162, 255, 0.3);
    color: var(--body-text);
    font-size: 13px;
    animation: sb-toast-in 0.3s ease-out;
}
.page-changed .icon { color: var(--info); flex-shrink: 0; }
.page-changed .grow { flex: 1; }

@media (prefers-reduced-motion: reduce) {
    .live-dot, tr.fresh-a > td, tr.fresh-b > td, .fresh-a, .fresh-b, .live-toast, .page-changed { animation: none; }
}

/* ---------- Dashboard ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.stat {
    background: var(--s1);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.stat-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.stat-value {
    font-size: 38px;
    font-weight: 650;
    letter-spacing: -0.04em;
    line-height: 1;
}

.stat-delta {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent);
}

.stat-sub {
    font-size: 12px;
    color: var(--muted);
}

.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.age {
    width: 36px;
    text-align: right;
    font-size: 12px;
    flex-shrink: 0;
}

.feed-item {
    display: flex;
    gap: 14px;
    padding: 12px 20px;
    border-top: 1px solid var(--line);
}

.feed-time {
    width: 40px;
    flex-shrink: 0;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--dim);
    padding-top: 3px;
}

.feed-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.feed-title {
    font-size: 14px;
    font-weight: 550;
    color: var(--text);
}

.feed-title:hover {
    color: var(--accent);
}

.mini-graph {
    height: 250px;
    position: relative;
    background: radial-gradient(circle at 50% 45%, #13161B 0%, var(--s1) 75%);
}

.ask-box {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 8px 0 14px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--line2);
}

.ask-box:focus-within {
    border-color: rgba(200, 241, 105, 0.5);
    box-shadow: var(--focus-ring);
}

.ask-box input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 14px;
    color: var(--text);
}

/* ---------- Graph ---------- */
.graph-canvas {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.graph-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    color: var(--muted);
    text-align: center;
}

.graph-frame {
    position: relative;
    display: flex;
    height: calc(100dvh - 190px);
    min-height: 460px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.graph-controls {
    width: 250px;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 18px;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 22px;
    background: var(--s1);
    overflow-y: auto;
    z-index: 4;
}

.graph-search {
    position: relative;
}

.search-hits {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line2);
    border-radius: 10px;
    background: var(--bg);
    overflow: hidden;
}

.search-hits button, .nb-list button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 6px 10px;
    border: none;
    border-top: 1px solid var(--line);
    background: transparent;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.search-hits button:first-child {
    border-top: none;
}

.search-hits button:hover, .nb-list button:hover {
    background: var(--s2);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.control-group .micro-label {
    margin-bottom: 6px;
}

.type-check {
    height: 30px;
}

.range {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 6px 0 10px;
    font-size: 13px;
}

.range-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.range input {
    width: 100%;
}

.graph-stage {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    background: radial-gradient(circle at 50% 45%, #13161B 0%, var(--bg) 70%);
}

.graph-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 0.8px, transparent 0.8px);
    background-size: 40px 40px;
    pointer-events: none;
}

.graph-topbar {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 3;
    pointer-events: none;
}

.graph-topbar > * {
    pointer-events: auto;
}

.graph-chips {
    display: flex;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.graph-chips .chip-btn {
    color: var(--text);
    background: var(--s1);
    flex-shrink: 0;
}

.graph-detail {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 290px;
    box-sizing: border-box;
    padding: 18px;
    border-radius: 14px;
    background: rgba(18, 20, 24, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 5;
    max-height: calc(100% - 40px);
    overflow-y: auto;
}

.graph-detail .icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.detail-title {
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.nb-list {
    display: flex;
    flex-direction: column;
}

.nb-list button {
    padding: 7px 0;
    background: transparent;
}

.nb-list button:hover {
    background: transparent;
    color: var(--accent);
}

.detail-actions {
    display: flex;
    gap: 8px;
}

.detail-actions .icon-btn {
    width: 38px;
    height: 38px;
}

.sheet-handle {
    display: none;
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: var(--line2);
    align-self: center;
}

.graph-tools {
    position: absolute;
    left: 20px;
    bottom: 20px;
    display: flex;
    gap: 6px;
    z-index: 3;
}

.graph-stats {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--dim);
    z-index: 2;
    pointer-events: none;
}

/* ---------- Quellen ---------- */
.upload-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 24px;
    padding: 20px;
}

.drop-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 34px 24px;
    border-radius: 12px;
    border: 1px dashed var(--line3);
    background: repeating-linear-gradient(135deg, var(--bg) 0 10px, #0C0E11 10px 20px);
    text-align: center;
    transition: border-color 0.15s;
}

.drop-zone:hover, .drop-zone:focus-within {
    border-color: rgba(200, 241, 105, 0.6);
}

.drop-zone input[type=file] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.dz-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--s2);
    box-shadow: inset 0 0 0 1px var(--line2);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dz-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.formats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 340px;
}

.formats span {
    font-family: var(--mono);
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 5px;
    background: var(--s2);
    color: var(--muted);
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.file-row, .upload-result {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    flex-wrap: wrap;
}

.file-row .icon-btn {
    width: 28px;
    height: 28px;
}

.sources-grid {
    --cols: minmax(0, 1fr) 100px 150px 80px 130px;
}

.cell-main.child {
    padding-left: 28px;
}

/* ---------- Quelle-Detail, Einstellungen, Admin ---------- */
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 12px;
    align-items: start;
}

.kv-list {
    display: grid;
    grid-template-columns: minmax(110px, 0.6fr) minmax(0, 1fr);
    gap: 8px 16px;
    margin: 0;
    padding: 16px 20px;
    font-size: 13px;
}

.kv-list dt {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--dim);
    padding-top: 2px;
}

.kv-list dd {
    margin: 0;
    color: var(--text);
    min-width: 0;
}

.settings-grid, .account-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 1100px;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.endpoint-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 12px;
}

.token-form, .reset-form, .diff-controls, .search-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.cron-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
    gap: 12px;
}

.cron-input {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--s1);
    min-width: 0;
}

.cron-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cron-head-end {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.cron-run {
    gap: 5px;
}

.cron-label {
    font-weight: 600;
    color: var(--text);
}

.cron-code {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 2px 8px;
    white-space: nowrap;
}

.cron-input .seg {
    align-self: stretch;
}

.cron-input .seg button {
    flex: 1 1 auto;
    padding: 0 8px;
}

.cron-body {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    min-height: 60px;
}

.cron-body .field {
    flex: 1 1 140px;
}

.cron-body .cron-custom, .cron-body .cron-days-field {
    flex-basis: 100%;
}

.cron-days {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.cron-days .chip-btn {
    min-width: 34px;
    justify-content: center;
    padding: 0 6px;
}

.cron-summary {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.cron-summary .icon {
    margin-top: 2px;
    flex-shrink: 0;
}

.cron-last {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin-top: 4px;
}

.cron-results {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cron-describe {
    color: var(--text);
    font-size: 13px;
}

.cron-summary.cron-error, .cron-summary.cron-error .cron-describe {
    color: var(--fail);
}

.diff-controls .field {
    flex: 1 1 220px;
}

.search-form {
    align-items: center;
    max-width: 820px;
}

.schema-editor {
    min-height: 420px;
    font-size: 13px;
}

.actions-end {
    justify-content: flex-end;
}

/* ---------- Suche ---------- */
.hit {
    align-items: flex-start;
}

.hit-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hit-title {
    font-size: 14px;
    font-weight: 600;
}

.hit-snippet {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

/* ---------- Wiki ---------- */
.wiki-frame {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 290px;
    min-height: calc(100dvh - 190px);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: clip;
}

.wiki-tree {
    background: var(--s1);
    border-right: 1px solid var(--line);
    min-width: 0;
}

.tree-inner {
    position: sticky;
    top: 0;
    max-height: 100dvh;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
}

.tree-folder > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 28px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    list-style: none;
    border-radius: 6px;
    padding: 0 4px;
}

.tree-folder > summary::-webkit-details-marker {
    display: none;
}

.tree-folder > summary:hover {
    color: var(--text);
}

.tree-folder > summary .count {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--dim);
}

.tree-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 14px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--muted);
    min-width: 0;
}

.tree-link .type-dot {
    width: 6px;
    height: 6px;
    opacity: 0.8;
}

.tree-link.top {
    margin-left: 0;
    padding-left: 8px;
}

.tree-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-link:hover {
    color: var(--text);
}

.tree-link.on {
    color: var(--text);
    background: var(--s2);
    box-shadow: inset 2px 0 0 var(--accent);
}

.tree-empty {
    margin: 10px 8px;
}

.wiki-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.wiki-main > .alert {
    margin: 20px 44px 0;
}

.wiki-mobile-bar {
    display: none;
}

.wiki-article {
    padding: 30px 44px 40px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--body-text);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.article-meta .stamp {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--dim);
}

.article-title {
    margin: 4px 0;
    font-size: 44px;
    line-height: 1.05;
    font-weight: 650;
    letter-spacing: -0.04em;
    color: var(--text);
    overflow-wrap: anywhere;
}

.history-title {
    margin: 0;
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.wiki-article .callout-warn .markdown-body {
    font-size: 14px;
}

.wiki-article .callout-warn .markdown-body ul {
    margin-bottom: 0;
}

.wiki-rail {
    padding: 20px;
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--s1);
    min-width: 0;
}

.rail-graph {
    position: relative;
    height: 190px;
    border-radius: 10px;
    background: radial-gradient(circle at 50% 45%, #13161B 0%, var(--bg) 75%);
    border: 1px solid var(--line);
    overflow: hidden;
    flex-shrink: 0;
}

.rail-graph-tools {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.rail-graph-tools .icon-btn {
    width: 32px;
    height: 32px;
}

.kv {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.rail-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
    min-width: 0;
}

.rail-link:hover {
    color: var(--accent);
}

.src-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 5px;
    background: var(--s2);
    font-family: var(--mono);
    font-size: 10px;
    color: var(--accent);
    flex-shrink: 0;
}

.rail-commit {
    display: flex;
    gap: 10px;
    font-size: 12px;
    min-width: 0;
}

.rail-commit .muted {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail-compare {
    margin-top: auto;
}

.rail-correction {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.rail-correction .pill {
    flex-shrink: 0;
}

/* Correction dialog of a wiki page */
.correction-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.correction-form .seg {
    align-self: flex-start;
    flex-wrap: wrap;
}

.removal-steps {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Processing mode of an integration (radio cards) */
.mode-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mode-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line2);
    border-radius: 8px;
    cursor: pointer;
}

.mode-option.on {
    border-color: var(--accent);
    background: var(--s2);
}

.mode-option input {
    margin-top: 3px;
}

.mode-option > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Rendered Markdown (wiki pages, answers, extracts) */
.markdown-body {
    overflow-wrap: anywhere;
    color: var(--body-text);
}

.markdown-body > :first-child {
    margin-top: 0;
}

.markdown-body > :last-child {
    margin-bottom: 0;
}

.wiki-article .markdown-body > h1:first-child {
    display: none;
}

.markdown-body h1 {
    font-size: 26px;
    font-weight: 650;
    letter-spacing: -0.03em;
    margin: 18px 0 8px;
}

.markdown-body h2 {
    margin: 22px 0 8px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
}

.markdown-body h3, .markdown-body h4 {
    margin: 16px 0 6px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.markdown-body p {
    margin: 0 0 10px;
}

.markdown-body ul, .markdown-body ol {
    padding-left: 20px;
    margin: 0 0 10px;
}

.markdown-body li {
    margin: 4px 0;
}

.markdown-body li::marker {
    color: var(--dim);
}

.markdown-body strong {
    color: var(--text);
    font-weight: 600;
}

.markdown-body a {
    color: var(--text);
    border-bottom: 1px solid var(--line3);
    transition: border-color 0.12s, color 0.12s;
}

.markdown-body a:hover {
    color: var(--accent);
}

.markdown-body a[href^="/wiki/kunden/"] { border-bottom-color: var(--t-kunde); }
.markdown-body a[href^="/wiki/projekte/"] { border-bottom-color: var(--t-projekt); }
.markdown-body a[href^="/wiki/personen/"] { border-bottom-color: var(--t-person); }
.markdown-body a[href^="/wiki/entscheidungen/"] { border-bottom-color: var(--t-entscheidung); }
.markdown-body a[href^="/wiki/themen/"] { border-bottom-color: var(--t-thema); }
.markdown-body a[href^="/wiki/quellen/"], .markdown-body a[href^="/quellen/"] { border-bottom-color: var(--t-quelle); }

.markdown-body a.src-ref {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 5px;
    background: var(--s2);
    border: none;
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1;
    color: var(--accent);
    vertical-align: 2px;
    margin: 0 1px;
}

.markdown-body a.src-ref:hover {
    background: var(--accent);
    color: var(--on-accent);
}

.markdown-body code {
    background: var(--s2);
    border-radius: 5px;
    padding: 1px 5px;
    font-size: 0.86em;
    color: var(--text);
}

.markdown-body pre {
    background: var(--s1);
    border: 1px solid var(--line);
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    overflow-x: auto;
}

.markdown-body pre code {
    background: none;
    padding: 0;
}

.markdown-body table {
    width: 100%;
    margin: 0 0 12px;
    border-collapse: collapse;
    font-size: 14px;
    display: block;
    overflow-x: auto;
}

.markdown-body th, .markdown-body td {
    border: 1px solid var(--line);
    padding: 6px 10px;
    vertical-align: top;
}

.markdown-body th {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dim);
    background: var(--s1);
}

.markdown-body blockquote {
    margin: 0 0 10px;
    border-left: 2px solid var(--line3);
    padding-left: 14px;
    color: var(--muted);
}

.markdown-body hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 18px 0;
}

.markdown-body .task-list-item {
    list-style: none;
    margin-left: -18px;
}

.markdown-body .task-list-item input {
    margin-right: 8px;
}

/* Inline diff */
.diff {
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.55;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--s1);
    max-height: 70vh;
    overflow: auto;
    padding: 8px 0;
}

.diff div {
    white-space: pre-wrap;
    padding: 0 14px;
    min-height: 1.2em;
    color: var(--muted);
}

.diff .diff-ins {
    background: rgba(126, 226, 168, 0.08);
    color: #B5F0CD;
}

.diff .diff-del {
    background: rgba(255, 122, 122, 0.08);
    color: #FFB4B4;
    text-decoration: line-through;
    text-decoration-color: rgba(255, 122, 122, 0.5);
}

/* ---------- Fragen ---------- */
.chat {
    display: flex;
    flex-direction: column;
    gap: 26px;
    max-width: 900px;
    width: 100%;
    flex: 1 1 auto;
}

.bubble-q {
    align-self: flex-end;
    max-width: min(560px, 90%);
    padding: 12px 16px;
    border-radius: 14px 14px 4px 14px;
    background: var(--s2);
    box-shadow: inset 0 0 0 1px var(--line2);
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.answer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.answer-name {
    font-size: 13px;
    font-weight: 600;
}

.bot-mark {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--accent);
    color: var(--on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot-mark.lg {
    width: 40px;
    height: 40px;
    border-radius: 11px;
}

.tool-steps {
    padding-left: 36px;
    display: flex;
    gap: 6px;
    align-items: center;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--dim);
}

.ok-mark {
    color: var(--ok);
}

.answer-body {
    padding-left: 36px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-body .markdown-body {
    font-size: 16px;
    line-height: 1.65;
}

.cites {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cite {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 10px;
    border-radius: 7px;
    background: var(--s2);
    box-shadow: inset 0 0 0 1px var(--line2);
    font-size: 12px;
    color: var(--text);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cite:hover {
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--line3);
}

.cite .type-dot {
    width: 7px;
    height: 7px;
}

.chat-empty {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px dashed var(--line2);
    font-size: 14px;
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.composer {
    position: sticky;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: var(--s1);
    border: 1px solid var(--line2);
    box-shadow: 0 0 0 4px rgba(200, 241, 105, 0.05), 0 20px 50px rgba(0, 0, 0, 0.45);
    z-index: 5;
}

.composer textarea {
    border: none;
    outline: none;
    resize: none;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    background: transparent;
    width: 100%;
    min-height: 48px;
}

.composer textarea::placeholder {
    color: var(--dim);
}

.composer-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.send-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

/* ---------- Tablet (icon rail) ---------- */
@media (max-width: 1199.98px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-grid, .detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .wiki-frame {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .wiki-rail {
        grid-column: 2;
        border-left: none;
        border-top: 1px solid var(--line);
        background: var(--bg);
        padding: 20px 40px 30px;
    }

    .rail-graph {
        height: 240px;
    }

    .wiki-article {
        padding: 30px 40px;
        font-size: 17px;
    }

    .article-title {
        font-size: 40px;
    }

    .tree-link {
        padding: 8px 10px;
    }

    .graph-frame {
        height: calc(100dvh - 170px);
    }

    .graph-controls {
        display: none;
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5);
    }

    .graph-frame.show-controls .graph-controls {
        display: flex;
    }

    .graph-topbar {
        display: flex;
    }

    .graph-frame.show-controls .graph-topbar {
        left: 296px;
    }

    .graph-detail {
        top: auto;
        bottom: 24px;
        right: 24px;
        width: 300px;
    }

    .graph-tools {
        left: 24px;
        bottom: 24px;
        gap: 8px;
    }

    .graph-tools .icon-btn {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .graph-stats {
        display: none;
    }

    .upload-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .endpoint-grid, .account-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .sources-grid {
        --cols: minmax(0, 1fr) 90px 140px 130px;
    }

    .sources-grid > :nth-child(4) {
        display: none;
    }
}

/* ---------- Phone ---------- */
@media (max-width: 767.98px) {
    .stats {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 16px;
        margin: 0 -16px;
        padding: 0 16px;
        scrollbar-width: none;
    }

    .stat {
        flex: 0 0 132px;
        padding: 14px;
        gap: 10px;
        scroll-snap-align: start;
    }

    .stat-value {
        font-size: 30px;
    }

    .stat-sub {
        display: none;
    }

    .list-row .pill {
        display: none;
    }

    .mini-graph {
        height: 220px;
    }

    .sources-grid {
        --cols: minmax(0, 1fr) auto;
    }

    .sources-grid > :nth-child(4) {
        display: none;
    }

    .filter-bar {
        padding: 12px 16px;
    }

    .filter-bar .search-field, .filter-bar .search-field input, .filter-bar select {
        width: 100%;
    }

    .filter-bar .search-field {
        flex: 1 1 100%;
        height: 44px;
    }

    .filter-bar .spacer {
        display: none;
    }

    .drop-zone {
        padding: 24px 16px;
    }

    .upload-grid {
        padding: 16px;
        gap: 18px;
    }

    .kv-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
        padding: 14px 16px;
    }

    .kv-list dd {
        margin-bottom: 8px;
    }

    /* Wiki: list at /wiki, article with back bar on a page. */
    .wiki-frame {
        display: block;
        border: none;
        background: transparent;
        min-height: 0;
        overflow: visible;
    }

    .wiki-frame.is-page .wiki-tree {
        display: none;
    }

    .wiki-tree {
        border: 1px solid var(--line);
        border-radius: 14px;
        margin-bottom: 14px;
    }

    .tree-inner {
        position: static;
        max-height: none;
    }

    .tree-link {
        min-height: 44px;
        font-size: 15px;
    }

    .tree-folder > summary {
        height: 40px;
    }

    .wiki-frame.is-page .wiki-mobile-bar {
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 0 -8px;
    }

    .wiki-mobile-bar .icon-btn {
        border: none;
        background: transparent;
    }

    .wiki-main > .alert {
        margin: 10px 0 0;
    }

    .wiki-article {
        padding: 8px 0 20px;
        gap: 14px;
        font-size: 16px;
        line-height: 1.65;
    }

    .article-title {
        font-size: 32px;
        line-height: 1.08;
    }

    .article-meta .stamp {
        margin-left: 0;
        width: 100%;
    }

    .wiki-rail {
        border: none;
        border-top: 1px solid var(--line);
        padding: 18px 0 0;
        background: transparent;
    }

    .rail-link {
        min-height: 36px;
    }

    .page-header:has(+ .wiki-frame.is-page) {
        display: none;
    }

    /* Graph: full-height stage, detail as bottom sheet. */
    .graph-page .subtitle {
        display: none;
    }

    .graph-frame {
        height: calc(100dvh - 215px - var(--safe-bottom) - var(--safe-top));
        min-height: 320px;
        margin: 0 -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .graph-controls {
        width: 100%;
        box-shadow: none;
    }

    .graph-frame.show-controls .graph-topbar {
        left: auto;
    }

    .graph-frame.show-controls .graph-chips {
        visibility: hidden;
    }

    .graph-detail {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        border-radius: 18px;
        padding: 16px;
        gap: 10px;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
        max-height: 60%;
    }

    .sheet-handle {
        display: block;
    }

    .detail-title {
        font-size: 19px;
    }

    .detail-actions .btn-ui, .detail-actions .icon-btn {
        height: 44px;
        min-height: 44px;
    }

    .detail-actions .icon-btn {
        width: 44px;
    }

    .graph-detail .cell-sub, .graph-detail .nb-list {
        display: none;
    }

    .graph-tools {
        left: 12px;
        bottom: 12px;
    }

    .graph-frame:has(.graph-detail) .graph-tools {
        display: none;
    }

    /* Fragen: composer above the tab bar. */
    .chat {
        gap: 18px;
    }

    .answer-body, .tool-steps {
        padding-left: 0;
    }

    .answer-body .markdown-body {
        font-size: 15px;
        line-height: 1.6;
    }

    .bubble-q {
        max-width: 85%;
    }

    .suggestions {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: auto -16px 0;
        padding: 0 16px;
        scrollbar-width: none;
    }

    .composer {
        bottom: calc(84px + var(--safe-bottom));
        flex-direction: row;
        align-items: flex-end;
        gap: 8px;
        padding: 8px 8px 8px 14px;
        border-radius: 18px;
    }

    .composer textarea {
        min-height: 44px;
        padding: 10px 0;
        font-size: 16px;
    }

    .composer-row {
        gap: 6px;
    }

    .composer-row .check {
        display: none;
    }

    .send-btn {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .cron-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .endpoint-grid, .token-form, .diff-controls {
        grid-template-columns: minmax(0, 1fr);
        flex-direction: column;
        align-items: stretch;
    }

    .diff-controls .field {
        flex: 1 1 auto;
    }

    .schema-editor {
        min-height: 300px;
    }
}

/* ---------- Ask dialog (Ctrl Ctrl, every page) ---------- */
.ask-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: min(80vh, 820px);
    margin: 10vh auto auto;
    padding: 0;
    border-radius: 16px;
    border: 1px solid var(--line2);
    background: var(--s1);
    color: var(--text);
    box-shadow: 0 0 0 4px rgba(200, 241, 105, 0.05), 0 30px 80px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.ask-dialog[open] {
    display: flex;
    flex-direction: column;
}

.ask-dialog::backdrop {
    background: rgba(5, 6, 8, 0.6);
    backdrop-filter: blur(2px);
}

.ask-dialog-input {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 14px 18px;
    border-bottom: 1px solid var(--line);
    margin: 0;
}

.ask-dialog-input > svg {
    margin-top: 10px;
    flex-shrink: 0;
}

.ask-dialog-input textarea {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    resize: none;
    font: inherit;
    font-size: 16px;
    line-height: 1.5;
    padding: 7px 0;
    color: var(--text);
    background: transparent;
    field-sizing: content;
    max-height: 30vh;
}

.ask-dialog-input textarea::placeholder {
    color: var(--dim);
}

.ask-dialog-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px;
    overflow-y: auto;
    min-height: 0;
}

.ask-dialog-body .alert {
    margin: 0;
}

.ask-dialog-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-top: 1px solid var(--line);
}

@media (max-width: 767.98px) {
    .ask-dialog {
        margin-top: 12px;
        max-height: calc(100dvh - 24px);
    }

    .ask-dialog-foot > span:first-child {
        display: none;
    }
}

/* ---------- Integrationen / Rückfragen ---------- */
.plugin-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.plugin-fields .span-2 {
    grid-column: 1 / -1;
}

.plugin-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
}

.plugin-section-title {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.inbox-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
}

.inbox-item-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.inbox-item-head .cell-title {
    flex: 1 1 320px;
    min-width: 0;
}

.speaker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px 12px;
}

.question-context {
    padding: 10px 14px;
    border-left: 3px solid var(--line);
    font-size: 13px;
}

.question-context .markdown-body > :last-child {
    margin-bottom: 0;
}

.question-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.question-error {
    color: var(--fail);
}

.inbox-preview {
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
}

@media (max-width: 767.98px) {
    .plugin-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .inbox-item {
        padding: 12px 16px;
    }
}

/* ---------- Modal (Blazor-controlled) ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(5, 6, 8, 0.6);
    backdrop-filter: blur(2px);
}

.modal-box {
    position: fixed;
    z-index: 1001;
    top: 8vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(560px, calc(100vw - 32px));
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1px solid var(--line2);
    background: var(--s1);
    color: var(--text);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    outline: none;
}

.modal-box.wide {
    width: min(920px, calc(100vw - 32px));
}

.modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 14px 20px;
    border-bottom: 1px solid var(--line);
}

.modal-head h2 {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    padding: 18px 20px 20px;
    overflow-y: auto;
    min-height: 0;
}

.plugin-settings {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---------- Integration list and picker ---------- */
.integration-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}

.integration-row .cell-title {
    flex: 1 1 260px;
    min-width: 0;
}

.integration-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.integration-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.addin-steps {
    margin: 0 0 14px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plugin-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plugin-choice {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--line2);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.plugin-choice:hover, .plugin-choice:focus-visible {
    border-color: var(--accent);
    background: var(--s2);
    outline: none;
}

.plugin-choice-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

@media (max-width: 767.98px) {
    .modal-box {
        top: 16px;
        max-height: calc(100vh - 32px);
    }

    .integration-row {
        padding: 12px 16px;
    }
}

/* ---------- Onboarding wizard (/willkommen) ---------- */
.onboarding {
    max-width: 1100px;
}

.ob-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ob-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--s1);
    color: var(--dim);
    font-size: 13px;
    min-width: 0;
}

.ob-steps li.active {
    border-color: rgba(200, 241, 105, 0.5);
    color: var(--text);
    box-shadow: var(--focus-ring);
}

.ob-steps li.done {
    color: var(--muted);
}

.ob-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--s2);
    box-shadow: inset 0 0 0 1px var(--line2);
    font-family: var(--mono);
    font-size: 12px;
}

.ob-steps li.active .ob-step-num {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: none;
}

.ob-steps li.done .ob-step-num {
    color: var(--ok);
    box-shadow: inset 0 0 0 1px rgba(126, 226, 168, 0.4);
}

.ob-step-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ob-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
    padding: 24px;
}

.ob-explain h2, .ob-done h2 {
    margin: 6px 0 10px;
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.ob-explain p {
    color: var(--body-text);
    line-height: 1.6;
}

.ob-facts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 13px;
}

.ob-facts li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ob-facts .icon {
    color: var(--accent);
}

.ob-note {
    margin-bottom: 12px;
}

.ob-note .icon {
    color: var(--ok);
}

.ob-form, .ob-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.ob-drop {
    min-height: 200px;
}

/* Stage illustrations: the four steps of the pipeline, synced to the source status. */
.ob-stages {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 16px;
    list-style: none;
    border-top: 1px solid var(--line);
}

.ob-stage {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--bg);
    transition: border-color 0.3s, opacity 0.3s;
}

.ob-stage.pending {
    opacity: 0.45;
}

.ob-stage.active {
    border-color: rgba(200, 241, 105, 0.55);
    box-shadow: var(--focus-ring);
}

.ob-stage.failed {
    border-color: rgba(255, 122, 122, 0.6);
}

.ob-art {
    height: 90px;
    border-radius: 8px;
    background: radial-gradient(circle at 50% 45%, #13161B 0%, var(--s1) 80%);
}

.ob-art svg {
    display: block;
    width: 100%;
    height: 100%;
}

.ob-stage-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--muted);
}

.ob-stage-text strong {
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
}

.ob-stage-state {
    font-family: var(--mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--dim);
}

.ob-stage.active .ob-stage-state {
    color: var(--accent);
}

.ob-stage.done .ob-stage-state {
    color: var(--ok);
}

.ob-stage.failed .ob-stage-state {
    color: var(--fail);
}

.ob-art .a-paper {
    fill: var(--s2);
    stroke: var(--line3);
    stroke-width: 1.5;
}

.ob-art .a-paper.dim {
    opacity: 0.55;
}

.ob-art .a-fold, .ob-art .a-arrow {
    fill: none;
    stroke: var(--line3);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ob-art .a-line {
    stroke: var(--muted);
    stroke-width: 2.5;
    stroke-linecap: round;
}

.ob-art .a-shelf {
    fill: var(--line2);
}

.ob-art .a-text {
    fill: var(--accent);
    font: 600 11px var(--sans);
}

.ob-art .a-card {
    fill: var(--s2);
    stroke-width: 1.5;
}

.ob-art .a-card.t1 { stroke: var(--t-person); }
.ob-art .a-card.t2 { stroke: var(--t-kunde); }
.ob-art .a-card.t3 { stroke: var(--t-projekt); }
.ob-art .a-card.t4 { stroke: var(--t-thema); }

.ob-art .a-spark {
    fill: var(--accent);
}

.ob-art .a-edge {
    stroke: var(--line3);
    stroke-width: 1.5;
}

.ob-art .a-node {
    fill: var(--s2);
    stroke-width: 2;
}

.ob-art .a-node.hub { stroke: var(--t-quelle); fill: var(--line2); }
.ob-art .a-node.n1 { stroke: var(--t-person); }
.ob-art .a-node.n2 { stroke: var(--t-kunde); }
.ob-art .a-node.n3 { stroke: var(--t-projekt); }
.ob-art .a-node.n4 { stroke: var(--t-thema); }

/* Motion only for the stage that is running. */
.ob-stage.active .a-paper:not(.dim) {
    animation: ob-float 2.4s ease-in-out infinite;
}

.ob-stage.active .a-line.scan {
    stroke: var(--accent);
    animation: ob-scan 1.6s ease-in-out infinite;
}

.ob-stage.active .a-line.scan.d1 { animation-delay: 0.2s; }
.ob-stage.active .a-line.scan.d2 { animation-delay: 0.4s; }

.ob-stage.active .a-card {
    animation: ob-pop 2.8s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.ob-stage.active .a-card.t2 { animation-delay: 0.35s; }
.ob-stage.active .a-card.t3 { animation-delay: 0.7s; }
.ob-stage.active .a-card.t4 { animation-delay: 1.05s; }

.ob-stage.active .a-spark {
    animation: ob-twinkle 1.4s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.ob-stage.active .a-node, .ob-stage.done .a-node.hub {
    animation: ob-pulse 2s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.ob-stage.done .a-edge {
    stroke: rgba(200, 241, 105, 0.45);
}

@keyframes ob-float {
    50% { transform: translateY(-3px); }
}

@keyframes ob-scan {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

@keyframes ob-pop {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    30% { transform: scale(1.08); opacity: 1; }
}

@keyframes ob-twinkle {
    50% { transform: scale(0.6) rotate(45deg); opacity: 0.6; }
}

@keyframes ob-pulse {
    50% { transform: scale(1.18); }
}

/* Live ticker and growing graph. */
.ob-live {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
    border-top: 1px solid var(--line);
}

.ob-ticker, .ob-graph {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.ob-graph .mini-graph {
    border-radius: 12px;
    border: 1px solid var(--line);
    overflow: hidden;
}

.ob-ticker-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
}

.ob-ticker-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 250px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.ob-tick {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    font-size: 13px;
    animation: ob-tick-in 0.35s ease-out;
}

.ob-tick:first-child {
    background: var(--s2);
}

.ob-tick-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 12px;
}

.ob-tick-mark.new {
    background: rgba(200, 241, 105, 0.14);
    color: var(--accent);
}

.ob-tick-mark.upd {
    background: rgba(122, 162, 255, 0.14);
    color: var(--info);
}

@keyframes ob-tick-in {
    from { opacity: 0; transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
    .ob-stage .ob-art *, .ob-tick {
        animation: none !important;
    }
}

.ob-watch-foot {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Step 4. */
.ob-done {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-color: rgba(200, 241, 105, 0.35);
}

.ob-done-head {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.ob-done-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(200, 241, 105, 0.12);
    color: var(--accent);
}

.ob-questions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ob-question {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--line2);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.ob-question:hover, .ob-question:focus-visible {
    border-color: rgba(200, 241, 105, 0.6);
    background: var(--s2);
}

.ob-question > span {
    flex: 1;
    min-width: 0;
}

.ob-question .icon:first-child {
    color: var(--accent);
}

.ob-question .ob-go {
    transform: rotate(45deg);
    color: var(--dim);
}

.ob-next {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ob-next-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ob-next-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--s1);
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.ob-next-card:hover, .ob-next-card:focus-visible {
    border-color: var(--line3);
}

.ob-next-card strong {
    color: var(--text);
    font-size: 13px;
}

.ob-next-card .icon {
    color: var(--accent);
}

@media (max-width: 991.98px) {
    .ob-card-grid, .ob-live {
        grid-template-columns: minmax(0, 1fr);
    }

    .ob-stages, .ob-next-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .ob-steps {
        grid-template-columns: repeat(4, auto);
    }

    .ob-step-label {
        display: none;
    }

    .ob-steps li.active .ob-step-label {
        display: inline;
    }

    .ob-stages, .ob-next-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ob-card-grid, .ob-done {
        padding: 16px;
    }
}

.mcp-connect {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
}

.mcp-steps {
    margin: 6px 0 0;
    padding-left: 20px;
    line-height: 1.6;
}
