/* 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-row.superseded > td:not(.job-select) { opacity: .55; }
.job-select { width: 1%; padding-right: 0 !important; }
.job-select input { width: 15px; height: 15px; margin: 0; vertical-align: -2px; cursor: pointer; }
.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; }

/* Anfragen (request log) */
.request-origin { min-width: 10rem; max-width: 16rem; }
.request-origin > .small-text { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-text { max-width: 28rem; }
.request-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
.request-facts dt { color: var(--dim); font-weight: 400; }
.request-facts dd { margin: 0; overflow-wrap: anywhere; }
.request-tools { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }

/* ---------- 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)); }
}

/* Wissen page changed while being read (WissenBrowser.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;
}

/* The brain (BrainView.razor, js/brain-graph.js): the canvas fills the frame, all controls float above it. */
.graph-frame {
    position: relative;
    height: calc(100dvh - 58px);
    min-height: 460px;
    margin-top: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 45%, #14171D 0%, var(--bg) 72%);
    transition: border-color 0.6s, box-shadow 0.6s;
}

.graph-frame.is-asking {
    border-color: rgba(177, 140, 255, 0.45);
    box-shadow: inset 0 0 80px rgba(177, 140, 255, 0.08);
}

.graph-frame:fullscreen, .graph-frame.is-full {
    position: fixed;
    inset: 0;
    z-index: 1000;
    height: 100dvh;
    margin: 0;
    border: none;
    border-radius: 0;
}

.graph-frame::backdrop {
    background: var(--bg);
}

.brain-view {
    touch-action: none;
    cursor: grab;
    outline: none;
}

.brain-view.dragging {
    cursor: grabbing;
}

.brain-view:focus-visible {
    box-shadow: inset 0 0 0 2px var(--accent);
}

.brain-canvas {
    display: block;
}

.brain-top, .brain-bottom {
    position: absolute;
    left: 14px;
    right: 14px;
    display: flex;
    gap: 10px;
    z-index: 3;
    pointer-events: none;
}

.brain-top > *, .brain-bottom > * {
    pointer-events: auto;
}

.brain-top {
    top: 14px;
    align-items: flex-start;
}

.brain-bottom {
    bottom: 14px;
    align-items: flex-end;
}

.brain-search {
    position: relative;
    width: 280px;
    flex-shrink: 0;
}

.brain-search .search-field, .brain-actions .icon-btn, .graph-tools .icon-btn, .brain-activity {
    background: rgba(18, 20, 24, 0.82);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.brain-search .search-field {
    height: 36px;
}

/* What the brain works with right now; fades out unless a question keeps it (.steady). */
.brain-activity {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    box-sizing: border-box;
    max-width: min(560px, 100%);
    min-width: 0;
    margin: 0 auto;
    padding: 0 14px;
    border: 1px solid var(--line2);
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--body-text);
    pointer-events: none;
    animation: brain-activity 7s ease-out forwards;
}

.brain-activity.steady {
    animation: none;
}

.brain-activity .grow {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brain-activity.read .live-dot { background: var(--accent); }
.brain-activity.search .live-dot { background: var(--info); }
.brain-activity.cited .live-dot { background: var(--t-thema); }
.brain-activity.written .live-dot { background: var(--ok); }

@keyframes brain-activity {
    0% { opacity: 0; transform: translateY(-4px); }
    6%, 75% { opacity: 1; transform: none; }
    100% { opacity: 0; }
}

.brain-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.brain-actions .icon-btn, .graph-tools .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.brain-menu {
    position: relative;
}

.brain-popover {
    position: absolute;
    top: 44px;
    right: 0;
    width: 250px;
    box-sizing: border-box;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-radius: 12px;
    border: 1px solid var(--line2);
    background: rgba(18, 20, 24, 0.94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.brain-fullscreen .when-full,
.graph-frame:fullscreen .brain-fullscreen .when-normal,
.graph-frame.is-full .brain-fullscreen .when-normal {
    display: none;
}

.graph-frame:fullscreen .brain-fullscreen .when-full,
.graph-frame.is-full .brain-fullscreen .when-full {
    display: block;
}

.graph-chips {
    display: flex;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    flex-wrap: wrap;
}

.graph-chips .chip-btn {
    color: var(--text);
    background: rgba(18, 20, 24, 0.82);
    flex-shrink: 0;
}

.graph-chips .chip-btn .count {
    color: var(--dim);
}

.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);
}

.graph-detail {
    position: absolute;
    right: 14px;
    top: 64px;
    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% - 140px);
    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 {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.graph-stats {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--dim);
    flex-shrink: 0;
    padding-bottom: 8px;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .brain-activity { animation: 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-failures {
    flex-basis: 100%;
    margin: 4px 0 0;
    padding: 8px 10px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 122, 122, 0.25);
    background: rgba(255, 122, 122, 0.06);
    color: var(--fail);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.cron-failure-user {
    display: block;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}

.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;
}

/* ---------- Wissen ---------- */
.wissen-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;
}

.wissen-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);
}

/* „weitere anzeigen“ below a long folder: a button that looks like a tree entry. */
.tree-more {
    width: calc(100% - 14px);
    border: 0;
    background: none;
    font: inherit;
    font-size: 12px;
    color: var(--accent);
    text-align: left;
    cursor: pointer;
}

/* Month folders of the source pages sit one level deeper. */
.tree-folder .tree-folder {
    margin-left: 12px;
}

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

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

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

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

.wissen-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;
}

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

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

.wissen-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 Wissen 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;
}

/* Retention of originals: number of days inside its radio card */
.retention-days {
    display: flex;
    align-items: center;
    gap: 8px;
}

.retention-days .input {
    width: 96px;
    margin-top: 0;
}

/* Rendered Markdown (Wissen 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;
}

.wissen-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^="/wissen/kunden/"] { border-bottom-color: var(--t-kunde); }
.markdown-body a[href^="/wissen/projekte/"] { border-bottom-color: var(--t-projekt); }
.markdown-body a[href^="/wissen/personen/"] { border-bottom-color: var(--t-person); }
.markdown-body a[href^="/wissen/entscheidungen/"] { border-bottom-color: var(--t-entscheidung); }
.markdown-body a[href^="/wissen/themen/"] { border-bottom-color: var(--t-thema); }
.markdown-body a[href^="/wissen/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);
    }

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

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

    .rail-graph {
        height: 240px;
    }

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

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

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

    .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;
    }

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

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

    .wissen-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;
    }

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

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

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

    .wissen-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%;
    }

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

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

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

    /* Graph: the brain fills the screen between header and tab bar, detail as bottom sheet. */
    .graph-frame {
        height: calc(100dvh - 150px - var(--safe-bottom) - var(--safe-top));
        min-height: 320px;
        margin: 6px -16px 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .brain-top {
        flex-wrap: wrap;
        left: 10px;
        right: 10px;
        top: 10px;
    }

    .brain-search {
        width: auto;
        flex: 1 1 0;
    }

    .brain-activity {
        order: 3;
        flex-basis: 100%;
        margin: 0;
    }

    .brain-bottom {
        left: 10px;
        right: 10px;
        bottom: 10px;
        flex-wrap: wrap;
    }

    .graph-chips {
        order: -1;
        flex-basis: 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .graph-tools .icon-btn, .brain-actions .icon-btn {
        width: 42px;
        height: 42px;
    }

    .brain-search .search-field {
        height: 42px;
    }

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

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

    .sheet-handle {
        display: block;
    }

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

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

    .graph-detail .cell-sub, .graph-detail .nb-list {
        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;
    }
}

/* ---------- Quellen hinzufügen (+, N, drop anywhere) ---------- */
.source-dialog {
    width: min(980px, calc(100vw - 32px));
    max-height: min(88vh, 900px);
    margin: 6vh 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;
}

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

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

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

.source-dialog-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.source-dialog-head form {
    margin: 0;
}

.source-dialog .source-upload {
    overflow-y: auto;
    min-height: 0;
}

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

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

    .source-dialog-foot {
        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(260px, 1fr));
    gap: 12px;
}

.speaker-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.speaker-quotes {
    margin: 0;
    padding: 0 0 0 10px;
    list-style: none;
    border-left: 2px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.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;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 16px;
    cursor: pointer;
}

.check-row input {
    margin-top: 3px;
    accent-color: var(--accent);
}

.pairing-code {
    display: inline-block;
    margin: 4px 0 14px;
    padding: 10px 18px;
    border: 1px solid var(--line2);
    border-radius: 8px;
    background: var(--s2);
    color: var(--accent);
    font-size: 1.6rem;
    letter-spacing: 0.12em;
}

.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);
}

.mail-inbox-brain {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

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

/* Backup page */
.notice strong {
    color: var(--text);
    font-weight: 600;
}

.mode-option.disabled {
    cursor: not-allowed;
}

.mode-option.disabled > input,
.mode-option.disabled > span > :not(.mode-hint) {
    opacity: 0.5;
}

.mode-hint {
    color: var(--busy);
}

.drop-zone.compact {
    gap: 10px;
    padding: 22px 20px;
}

.drop-zone.has-file {
    border-style: solid;
    border-color: rgba(200, 241, 105, 0.45);
}

.drop-zone .dz-title.mono {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.backup-actions {
    display: inline-flex;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.backup-result {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
}

/* Chronological Wissen rebuild on the backup page. */
.rebuild-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.rebuild-status .meter {
    height: 6px;
}

.rebuild-import {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

/* ---------- Landing page (Pages/Landing.razor, shown at / when not signed in) ---------- */
.lp {
    --lp-max: 1200px;
    --lp-gutter: 24px;
    position: relative;
    isolation: isolate;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    overflow-x: clip;
}

/* The firing neural net of the auth pages (js/synapses.js), fixed behind all sections. */
.lp > .synapse-bg {
    opacity: 0.7;
}

/* The tablet rail hides .brand-name; the auth and landing headers always show it. */
.auth-brand .brand-name, .lp-nav .brand-name {
    display: inline;
}

.lp-alpha {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    border-radius: 6px;
    border: 1px solid rgba(242, 201, 76, 0.4);
    background: rgba(242, 201, 76, 0.1);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--busy);
}

html:has(.lp) {
    scroll-behavior: smooth;
}

.lp main > section, .lp-foot {
    width: 100%;
    max-width: calc(var(--lp-max) + 2 * var(--lp-gutter));
    box-sizing: border-box;
    margin: 0 auto;
    padding-left: var(--lp-gutter);
    padding-right: var(--lp-gutter);
}

.lp section[id] {
    scroll-margin-top: 72px;
}

.lp h1, .lp h2, .lp h3 {
    margin: 0;
    color: var(--text);
}

.lp p {
    margin: 0;
}

.btn-ui.lg {
    height: 46px;
    padding: 0 20px;
    font-size: 15px;
    border-radius: 11px;
}

/* Nav: sticky and blurred, content scrolls beneath it. */
.lp-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 24px;
    box-sizing: border-box;
    height: calc(64px + var(--safe-top));
    padding: var(--safe-top) max(var(--lp-gutter), calc((100% - var(--lp-max)) / 2)) 0;
    background: rgba(10, 11, 13, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(35, 39, 46, 0.6);
}

.lp-nav .brand {
    padding: 0;
}

.lp-nav .logo-mark {
    width: 30px;
    height: 30px;
}

.lp-nav-links {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.lp-nav-links a {
    padding: 6px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 13.5px;
    text-decoration: none;
    transition: color 0.12s, background-color 0.12s;
}

.lp-nav-links a:hover {
    color: var(--text);
    background: var(--s1);
}

/* Hero: copy left, the sample brain right. */
.lp-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
    min-height: min(calc(100dvh - 64px), 820px);
    padding-top: 48px;
    padding-bottom: 48px;
}

.lp-hero::before {
    content: "";
    position: absolute;
    inset: -10% -20% auto 30%;
    height: 90%;
    background:
        radial-gradient(closest-side, rgba(177, 140, 255, 0.14), transparent 70%) 70% 40% / 60% 70% no-repeat,
        radial-gradient(closest-side, rgba(200, 241, 105, 0.1), transparent 70%) 30% 70% / 55% 60% no-repeat;
    filter: blur(20px);
    pointer-events: none;
    z-index: 0;
}

.lp-hero > * {
    position: relative;
    z-index: 1;
}

.lp-hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
}

.lp-kicker {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    min-height: 28px;
    box-sizing: border-box;
    padding: 4px 12px 4px 4px;
    border-radius: 16px;
    border: 1px solid var(--line2);
    background: rgba(18, 20, 24, 0.7);
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.04em;
    color: var(--body-text);
}

.lp-hero h1 {
    font-size: clamp(38px, 4.3vw, 58px);
    line-height: 1.02;
    font-weight: 680;
    letter-spacing: -0.045em;
}

.lp-hl {
    background: linear-gradient(95deg, var(--accent) 0%, var(--ok) 45%, var(--t-thema) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lp-lead {
    max-width: 540px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--muted);
}

.lp-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lp-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--dim);
}

.lp-brain-frame {
    position: relative;
    height: clamp(420px, 64vh, 640px);
    border-radius: 22px;
    border: 1px solid var(--line);
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 45%, #15181F 0%, #0C0D10 75%);
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* The page must stay scrollable on phones: vertical swipes scroll, horizontal ones turn the brain. */
.lp-brain-frame .brain-view {
    touch-action: pan-y;
}

.lp-ticker {
    position: absolute;
    top: 16px;
    left: 16px;
    width: fit-content;
    max-width: calc(100% - 32px);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line2);
    background: rgba(13, 15, 18, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 12.5px;
    color: var(--body-text);
    pointer-events: none;
}

.lp-ticker .live-dot {
    flex-shrink: 0;
}

.lp-ticker-label {
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ok);
    white-space: nowrap;
}

.lp-ticker-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lp-ticker[data-kind=cited] .live-dot { background: var(--t-thema); }
.lp-ticker[data-kind=cited] .lp-ticker-label { color: var(--t-thema); }
.lp-ticker[data-kind=search] .live-dot { background: var(--info); }
.lp-ticker[data-kind=search] .lp-ticker-label { color: var(--info); }

.lp-ticker.is-new {
    animation: lp-ticker-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes lp-ticker-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.lp-brain-hint {
    position: absolute;
    right: 16px;
    bottom: 14px;
    font-size: 10.5px;
    color: var(--dim);
    pointer-events: none;
}

/* Strip of what can go in. */
.lp main > .lp-formats {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 22px;
    padding-bottom: 22px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.lp-formats ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lp-formats li {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--body-text);
}

.lp-formats .icon {
    color: var(--dim);
}

/* Sections */
.lp main > .lp-section {
    padding-top: 104px;
    padding-bottom: 8px;
}

.lp-section-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 760px;
    margin: 0 auto 48px;
    text-align: center;
}

.lp-section-head .micro-label, .lp-privacy-copy .micro-label {
    color: var(--accent);
}

.lp h2 {
    font-size: clamp(28px, 3.4vw, 42px);
    line-height: 1.1;
    font-weight: 650;
    letter-spacing: -0.035em;
}

.lp-section-head p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--muted);
}

.lp h3 {
    font-size: 17px;
    font-weight: 620;
    letter-spacing: -0.015em;
}

/* How it works: three steps with a small illustration each. */
.lp-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lp-step {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--s1) 0%, rgba(18, 20, 24, 0.4) 100%);
}

.lp-step-no {
    font-size: 12px;
    color: var(--accent);
}

.lp-step p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
}

.lp-art {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--bg);
    font-size: 12.5px;
}

.lp-file {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 9px;
    border: 1px solid var(--line2);
    background: var(--s1);
    color: var(--body-text);
}

.lp-file > span:first-of-type {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lp-file .icon { color: var(--t-person); }
.lp-file:nth-child(2) { margin-left: 14px; }
.lp-file:nth-child(2) .icon { color: var(--info); }
.lp-file:nth-child(3) { margin-left: 28px; }
.lp-file:nth-child(3) .icon { color: var(--t-entscheidung); }

.lp-art-diff {
    gap: 3px;
    font-size: 11.5px;
}

.lp-diff-path {
    margin-bottom: 6px;
    color: var(--dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lp-diff-line {
    padding: 2px 8px;
    border-radius: 4px;
    white-space: pre;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--muted);
}

.lp-diff-line.add {
    background: rgba(126, 226, 168, 0.08);
    color: var(--ok);
}

.lp-diff-line u {
    text-decoration-color: rgba(126, 226, 168, 0.5);
    text-underline-offset: 3px;
}

.lp-ask {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(242, 201, 76, 0.3);
    background: rgba(242, 201, 76, 0.07);
    font-family: var(--sans);
    font-size: 12px;
    color: var(--busy);
}

.lp-q {
    align-self: flex-end;
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px 12px 4px 12px;
    background: var(--s2);
    color: var(--text);
}

.lp-a {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px 12px 12px 4px;
    border: 1px solid rgba(177, 140, 255, 0.3);
    background: rgba(177, 140, 255, 0.06);
    line-height: 1.5;
    color: var(--body-text);
}

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

.lp-cite {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    background: var(--s2);
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--muted);
}

.lp-cite.t-quelle { --tc: var(--t-thema); }

/* Features */
.lp-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.lp-feature {
    --fc: var(--accent);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--s1);
    transition: border-color 0.2s, transform 0.2s;
}

.lp-feature:hover {
    border-color: var(--line3);
    transform: translateY(-2px);
}

.lp-feature:nth-child(3n+2) { --fc: var(--t-thema); }
.lp-feature:nth-child(3n) { --fc: var(--info); }

.lp-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: color-mix(in srgb, var(--fc) 12%, transparent);
    color: var(--fc);
}

.lp-feature p {
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
}

/* Privacy: copy left, folder tree right. */
.lp main > .lp-privacy {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: 56px;
}

.lp-privacy-copy {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lp-privacy-copy > p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--muted);
}

.lp-checks {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.lp-checks li {
    display: flex;
    gap: 12px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
}

.lp-checks .icon {
    margin-top: 2px;
    color: var(--accent);
}

.lp-checks strong {
    color: var(--text);
    font-weight: 600;
}

.lp-callout {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(242, 201, 76, 0.28);
    background: rgba(242, 201, 76, 0.06);
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--body-text);
}

.lp-callout .icon {
    margin-top: 2px;
    color: var(--busy);
}

.lp-tree {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--s1);
    font-size: 12.5px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.lp-tree-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.lp-tree-user {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line2);
    background: var(--bg);
}

.lp-tree-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.lp-tree-item {
    position: relative;
    padding-left: 18px;
    color: var(--body-text);
    overflow-wrap: anywhere;
}

.lp-tree-item::before {
    content: "";
    position: absolute;
    left: 3px;
    top: -6px;
    width: 8px;
    height: 14px;
    border-left: 1px solid var(--line3);
    border-bottom: 1px solid var(--line3);
}

.lp-tree-wall {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--fail);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lp-tree-wall::before, .lp-tree-wall::after {
    content: "";
    flex: 1;
    border-top: 1px dashed rgba(255, 122, 122, 0.4);
}

/* FAQ */
.lp-faq-list {
    max-width: 780px;
    margin: 0 auto;
    border-top: 1px solid var(--line);
}

.lp-faq-list details {
    border-bottom: 1px solid var(--line);
}

.lp-faq-list summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
}

.lp-faq-list summary::-webkit-details-marker {
    display: none;
}

.lp-faq-list summary::after {
    content: "+";
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--line2);
    font-family: var(--mono);
    font-weight: 400;
    color: var(--muted);
    transition: transform 0.2s, color 0.2s, border-color 0.2s;
}

.lp-faq-list details[open] summary::after {
    transform: rotate(45deg);
    color: var(--accent);
    border-color: rgba(200, 241, 105, 0.4);
}

.lp-faq-list summary:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: 8px;
}

.lp-faq-list details p {
    padding: 0 48px 22px 4px;
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--muted);
}

/* Final call to action */
.lp main > .lp-final {
    padding-top: 112px;
    padding-bottom: 72px;
}

.lp-final-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 56px 24px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background:
        radial-gradient(ellipse at 50% 0%, rgba(200, 241, 105, 0.12), transparent 60%),
        radial-gradient(ellipse at 50% 120%, rgba(177, 140, 255, 0.12), transparent 60%),
        var(--s1);
    text-align: center;
}

.lp-final-logo {
    width: 64px;
    height: 64px;
}

.lp-final-card p {
    max-width: 480px;
    font-size: 16px;
    color: var(--muted);
}

.lp-final-card .lp-cta {
    justify-content: center;
    margin-top: 8px;
}

.lp-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    padding-top: 22px;
    padding-bottom: calc(28px + var(--safe-bottom));
    border-top: 1px solid var(--line);
    font-size: 11.5px;
    color: var(--muted);
}

/* Section variants: problem cards and the four team items. */
.lp-pains .lp-feature { --fc: var(--busy); }

.lp-features-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Persona portraits (Components/Landing/PersonaFigure.razor): round photo with a ring in the persona's colour. */
.pf {
    --pc: var(--accent);
    display: block;
    flex-shrink: 0;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--pc) 70%, transparent);
    background: color-mix(in srgb, var(--pc) 18%, var(--s1));
    box-sizing: border-box;
}

.pf-studentin { --pc: var(--t-thema); }
.pf-projektleiter { --pc: var(--t-kunde); }
.pf-geschaeftsfuehrerin { --pc: var(--t-entscheidung); }
.pf-mutter { --pc: var(--t-person); }
.pf-insolvenzverwalterin { --pc: var(--ok); }
.pf-handwerksmeister { --pc: var(--fail); }

/* Persona cards: landing carousel, /fuer-wen overview and the other examples on a use-case page. */
.lp-persona {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    height: 100%;
    box-sizing: border-box;
    padding: 22px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--s1);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
}

.lp-persona:hover {
    border-color: var(--line3);
    transform: translateY(-2px);
}

.lp-persona:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-color: var(--accent);
}

.lp-persona-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.lp-persona-name {
    font-size: 18px;
    font-weight: 620;
    letter-spacing: -0.015em;
    color: var(--text);
}

.lp-persona-role {
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
}

.lp-persona-tagline {
    margin-top: 8px;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--body-text);
}

.lp-persona.compact {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.lp-persona.compact .lp-persona-name {
    font-size: 15px;
}

.lp-persona.compact .lp-persona-role {
    font-size: 12px;
}

/* Carousel: a scroll-snapping track; the buttons are driven by js/landing.js. */
.lp-carousel-track {
    display: flex;
    gap: 16px;
    margin: 0;
    padding: 4px 2px 8px;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.lp-carousel-track::-webkit-scrollbar {
    display: none;
}

.lp-carousel-track > li {
    flex: 0 0 calc((100% - 32px) / 3);
    scroll-snap-align: start;
}

.lp-carousel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
}

.lp-carousel-buttons {
    display: flex;
    gap: 8px;
}

.lp-carousel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--line2);
    background: var(--s1);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.12s, background-color 0.12s;
}

.lp-carousel-btn:hover {
    border-color: var(--line3);
    background: var(--s2);
}

.lp-carousel-btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.lp-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
}

.lp-more:hover {
    color: var(--accent-hover);
}

/* Use-case pages (Pages/FuerWen.razor) */
.lp-persona-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lp-persona-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
    gap: 12px;
}

.lp main > .lp-persona-hero {
    padding-top: 40px;
}

.lp-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: var(--muted);
    text-decoration: none;
}

.lp-back:hover {
    color: var(--text);
}

.lp-persona-hero-body {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-top: 28px;
}

.lp-persona-hero .pf {
    width: clamp(120px, 22vw, 200px);
    height: auto;
}

.lp-persona-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.lp-persona-hero-copy .micro-label {
    color: var(--accent);
}

.lp-persona-hero h1 {
    font-size: clamp(36px, 4.3vw, 54px);
    line-height: 1.05;
    font-weight: 680;
    letter-spacing: -0.045em;
}

.lp main > .lp-detail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding-top: 48px;
}

.lp-detail-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    padding: 24px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--s1);
}

.lp-detail-card.wide {
    grid-column: 1 / -1;
}

.lp .lp-detail-card h2, .lp .lp-others h2 {
    font-size: 20px;
    letter-spacing: -0.02em;
}

.lp-detail-card .lp-art {
    margin-top: 0;
}

.lp-detail-card .lp-checks {
    margin: 0;
}

.lp-pain-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lp-pain-list li {
    position: relative;
    padding-left: 18px;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--body-text);
}

.lp-pain-list li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.6em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--busy);
}

.lp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lp-chips li {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line2);
    background: var(--bg);
    font-size: 13px;
    color: var(--body-text);
}

/* Flow diagram (Components/Landing/BrainFlow.razor): ways in → brain(s) → ways out. Pure CSS connectors: every node
   draws a stub to the bus and its share of the bus (first and last stop at their centre), the links meet the bus. */
.bf-wrap {
    container: brain-flow / inline-size;
}

.bf {
    --bf-stub: 20px;
    --bf-gap: 10px;
    --bf-line: var(--line3);
    --bf-dash: color-mix(in srgb, var(--accent) 85%, transparent);
    --bf-arrow: color-mix(in srgb, var(--accent) 80%, var(--line3));
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1.15fr) 72px minmax(0, 1fr);
    grid-template-areas:
        "lin . lcore . lout"
        "in lk1 core lk2 out"
        ". . . . note";
    align-items: center;
}

.bf-label {
    align-self: end;
    margin-bottom: 14px;
    color: var(--muted);
}

.bf-label-in { grid-area: lin; padding-right: var(--bf-stub); }
.bf-label-core { grid-area: lcore; text-align: center; }
.bf-label-out { grid-area: lout; padding-left: var(--bf-stub); }

.bf-nodes {
    display: flex;
    flex-direction: column;
    gap: var(--bf-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.bf-in {
    --fc: var(--info);
    grid-area: in;
    padding-right: var(--bf-stub);
}

.bf-out {
    --fc: var(--t-thema);
    grid-area: out;
    padding-left: var(--bf-stub);
}

.bf-node {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--s1);
}

.bf-node-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--fc) 12%, transparent);
    color: var(--fc);
}

.bf-node-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

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

.bf-node-text span {
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
}

.bf-node::before, .bf-node::after {
    content: "";
    position: absolute;
}

.bf-node::before {
    top: calc(50% - 1px);
    width: var(--bf-stub);
    height: 2px;
}

.bf-node::after {
    top: calc(var(--bf-gap) / -2 - 1px);
    bottom: calc(var(--bf-gap) / -2 - 1px);
    width: 2px;
    background: var(--bf-line);
}

.bf-node:first-child::after { top: calc(50% - 1px); }
.bf-node:last-child::after { bottom: calc(50% - 1px); }

.bf-in .bf-node::before { left: calc(100% + 1px); }
.bf-in .bf-node::after { left: calc(100% + var(--bf-stub) - 1px); }
.bf-out .bf-node::before { right: calc(100% + 1px); }
.bf-out .bf-node::after { right: calc(100% + var(--bf-stub) - 1px); }

/* Moving dashes: towards the brain on the left, away from it on the right. */
.bf-node::before, .bf-link {
    background: linear-gradient(90deg, transparent 0 9px, var(--bf-dash) 9px 14px, transparent 14px) 0 0 / 18px 100% repeat-x, var(--bf-line);
    animation: bf-flow 1.1s linear infinite;
}

@keyframes bf-flow {
    to { background-position: 18px 0; }
}

@keyframes bf-flow-y {
    to { background-position: 0 18px; }
}

.bf-link {
    position: relative;
    height: 2px;
}

.bf-link-in { grid-area: lk1; }
.bf-link-out { grid-area: lk2; }

.bf-link::after, .bf-link-out::before {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-style: solid;
}

.bf-link::after {
    right: -1px;
    border-width: 6px 0 6px 9px;
    border-color: transparent transparent transparent var(--bf-arrow);
}

/* The AI tools read and also deliver sources via MCP: arrow heads on both ends. */
.bf-link-out::before {
    left: -1px;
    border-width: 6px 9px 6px 0;
    border-color: transparent var(--bf-arrow) transparent transparent;
}

.bf-link-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    font-size: 9.5px;
    line-height: 1.35;
    letter-spacing: 0.03em;
    text-align: center;
    color: var(--dim);
}

.bf-link-label span {
    display: block;
}

.bf-core {
    grid-area: core;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--line2);
    background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%), var(--s1);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.bf-core.single {
    padding: 34px 20px 26px;
}

.bf-core-brain {
    position: relative;
    display: flex;
}

.bf-core-brain::before {
    content: "";
    position: absolute;
    inset: -30%;
    border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, transparent), transparent);
    filter: blur(10px);
    animation: bf-glow 4.5s ease-in-out infinite;
}

.bf-core-brain img {
    position: relative;
    width: 112px;
    height: 112px;
}

@keyframes bf-glow {
    50% { opacity: 0.55; transform: scale(0.9); }
}

.bf-core-name {
    font-size: 18px;
    font-weight: 620;
    letter-spacing: -0.015em;
    color: var(--text);
}

.bf-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bf-tags li {
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    background: color-mix(in srgb, var(--accent) 7%, transparent);
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--accent);
}

.bf-brains {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bf-brain {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line2);
    background: var(--bg);
}

.bf-brain-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.bf-brain-head img {
    flex-shrink: 0;
}

.bf-brain-head strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.bf-members {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bf-member {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    box-sizing: border-box;
    padding: 3px 10px 3px 3px;
    border-radius: 14px;
    border: 1px solid var(--line2);
    background: var(--s1);
    font-size: 12.5px;
}

.bf-member-name {
    min-width: 0;
    color: var(--text);
}

.bf-member-role {
    min-width: 0;
    font-size: 11.5px;
    color: var(--muted);
}

.bf-member .pf {
    width: 22px;
    height: 22px;
    border-width: 1.5px;
}

.bf-avatar {
    --ac: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ac) 20%, var(--s1));
    color: var(--ac);
    font-size: 11px;
    font-weight: 650;
}

.bf-avatar.c0 { --ac: var(--t-person); }
.bf-avatar.c1 { --ac: var(--t-kunde); }
.bf-avatar.c2 { --ac: var(--t-projekt); }
.bf-avatar.c3 { --ac: var(--t-thema); }
.bf-avatar.c4 { --ac: var(--t-entscheidung); }

/* Landing page: the external AI tools combine their own access with the brain. */
.bf-access {
    --bf-access: color-mix(in srgb, var(--t-thema) 60%, var(--line3));
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 26px;
    padding: 10px;
    border-radius: 12px;
    border: 1px dashed var(--line3);
}

.bf-access::before, .bf-access::after {
    content: "";
    position: absolute;
}

.bf-access::before {
    bottom: 100%;
    left: calc(50% - 1px);
    width: 2px;
    height: 26px;
    background: repeating-linear-gradient(180deg, var(--bf-access) 0 4px, transparent 4px 7px);
}

.bf-access::after {
    bottom: calc(100% + 18px);
    left: calc(50% - 5px);
    border-style: solid;
    border-width: 0 5px 8px;
    border-color: transparent transparent var(--bf-access);
}

.bf-access-label {
    font-size: 10.5px;
    letter-spacing: 0.04em;
    text-align: center;
    color: var(--muted);
}

.bf-access ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bf-access li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--line2);
    background: var(--bg);
    font-size: 12px;
    color: var(--body-text);
}

.bf-access .icon {
    color: var(--muted);
}

.bf-note {
    grid-area: note;
    margin-top: 14px;
    padding-left: var(--bf-stub);
    font-size: 13px;
    line-height: 1.55;
    color: var(--muted);
}

/* Inside a card of the use-case page the diagram needs the darker ground to stand out. */
.lp-detail-card .bf-node, .lp-detail-card .bf-core { background-color: var(--bg); }
.lp-detail-card .bf-core { box-shadow: none; }
.lp-detail-card .bf-brain { background: var(--s1); }
.lp-detail-card .bf-member { background: var(--bg); }

/* Team diagram (Components/Landing/BrainTeams.razor): inline SVG, colours only via these classes. */
.bt {
    margin: 40px 0 0;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--s1);
}

.bt-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

/* Only when the figure is narrower than the SVG's min-width (560px) and scrolls. */
.bt-hint {
    display: none;
    margin-bottom: 8px;
    font-size: 10.5px;
    text-align: right;
    color: var(--dim);
}

@media (max-width: 639.98px) {
    .bt-hint {
        display: block;
    }
}

.bt-svg {
    display: block;
    width: 100%;
    min-width: 560px;
    max-width: 820px;
    height: auto;
    margin: 0 auto;
    font-family: var(--sans);
}

.bt-link {
    fill: none;
    stroke: var(--dim);
    stroke-width: 1.6;
    stroke-linecap: round;
}

.bt-link.verwalter { stroke-width: 3.2; }
.bt-link.leser { stroke-dasharray: 5 6; }

.bt-link.hot {
    stroke: var(--accent);
    filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 55%, transparent));
}

.bt-pulse {
    fill: none;
    stroke: var(--accent-hover);
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-dasharray: 3 17;
    animation: bt-pulse 1.4s linear infinite;
}

@keyframes bt-pulse {
    to { stroke-dashoffset: -20; }
}

.bt-role rect {
    fill: var(--s1);
    stroke: var(--line2);
}

.bt-role text {
    fill: var(--muted);
    font-size: 12.5px;
    text-anchor: middle;
}

.bt-role.hot rect { stroke: color-mix(in srgb, var(--accent) 45%, transparent); }
.bt-role.hot text { fill: var(--accent); }

.bt-person { --ac: var(--muted); }
.bt-person.c-person { --ac: var(--t-person); }
.bt-person.c-thema { --ac: var(--t-thema); }
.bt-person.c-kunde { --ac: var(--t-kunde); }
.bt-person.c-entscheidung { --ac: var(--t-entscheidung); }

.bt-person circle {
    fill: color-mix(in srgb, var(--ac) 16%, var(--s1));
    stroke: var(--ac);
    stroke-width: 2;
}

.bt-initial {
    fill: var(--ac);
    font-size: 17px;
    font-weight: 650;
    text-anchor: middle;
}

.bt-name {
    fill: var(--text);
    font-size: 15px;
    font-weight: 600;
    text-anchor: middle;
}

.bt-brain circle {
    fill: var(--bg);
    stroke: color-mix(in srgb, var(--accent) 55%, transparent);
    stroke-width: 2;
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 25%, transparent));
}

.bt-ask rect, .bt-ask path {
    fill: color-mix(in srgb, var(--accent) 12%, var(--s1));
    stroke: color-mix(in srgb, var(--accent) 50%, transparent);
}

.bt-ask text {
    fill: var(--accent);
    font-size: 13.5px;
    font-weight: 550;
    text-anchor: middle;
}

.bt figcaption {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    text-align: center;
}

.bt-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
    color: var(--muted);
}

.bt-legend li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bt-legend i {
    width: 24px;
    border-top: 1.5px solid var(--dim);
}

.bt-legend i.verwalter { border-top-width: 3.5px; }
.bt-legend i.leser { border-top-style: dashed; }
.bt-legend i.hot { border-top: 3.5px solid var(--accent); }

.bt figcaption p {
    max-width: 560px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--body-text);
}

/* Stacked when the diagram itself is narrow: phones, and the use-case card on tablets. */
@container brain-flow (max-width: 759.98px) {
    .bf {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "lin" "in" "lk1" "core" "lk2" "lout" "out" "note";
    }

    .bf-label-core {
        display: none;
    }

    .bf-label-in, .bf-label-out {
        padding: 0;
        margin-bottom: 10px;
        text-align: center;
    }

    .bf-in, .bf-out {
        padding: 0;
    }

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

    .bf-node:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .bf-node::before, .bf-node::after {
        display: none;
    }

    .bf-link {
        justify-self: center;
        width: 2px;
        height: 40px;
        margin: 12px 0;
        background: linear-gradient(180deg, transparent 0 9px, var(--bf-dash) 9px 14px, transparent 14px) 0 0 / 100% 18px repeat-y, var(--bf-line);
        animation-name: bf-flow-y;
    }

    .bf-link::after {
        top: auto;
        right: auto;
        bottom: -1px;
        left: 50%;
        transform: translateX(-50%);
        border-width: 9px 6px 0;
        border-color: var(--bf-arrow) transparent transparent;
    }

    .bf-link-out::before {
        top: -1px;
        left: 50%;
        transform: translateX(-50%);
        border-width: 0 6px 9px;
        border-color: transparent transparent var(--bf-arrow);
    }

    .bf-link-label {
        top: 50%;
        right: auto;
        bottom: auto;
        left: 16px;
        transform: translateY(-50%);
        white-space: nowrap;
        text-align: left;
    }

    .bf-link-label span {
        display: inline;
    }

    .bf-link-label span + span::before {
        content: " · ";
    }

    .bf-note {
        padding-left: 0;
        text-align: center;
    }
}

/* Phone width: two narrow node columns, icon above the text. */
@container brain-flow (max-width: 479.98px) {
    .bf-node {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px;
    }
}

@media (max-width: 767.98px) {
    .bt {
        padding: 16px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bf-node::before, .bf-link, .bf-core-brain::before { animation: none; }
    .bt-pulse { display: none; }
}

.lp-tree-members {
    margin: -2px 0 2px;
    font-size: 11.5px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.lp main > .lp-others {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: 72px;
}

@media (max-width: 991.98px) {
    .lp-features-4, .lp-persona-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lp-carousel-track > li {
        flex-basis: calc((100% - 16px) / 2);
    }

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

@media (max-width: 575.98px) {
    .lp-features-4, .lp-persona-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .lp-carousel-track > li {
        flex-basis: 80%;
    }

    .lp-carousel-foot {
        flex-wrap: wrap;
    }

    .lp-persona-hero-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .lp-detail-card {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lp-persona { transition: none; }
    .lp-persona:hover { transform: none; }
}

@media (max-width: 991.98px) {
    .lp-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
        min-height: 0;
        padding-top: 40px;
    }

    .lp-brain-frame {
        height: clamp(360px, 60vh, 520px);
    }

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

    .lp-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lp main > .lp-privacy {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
    }

    .lp main > .lp-formats {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 767.98px) {
    .lp-nav-links {
        display: none;
    }

    .lp-nav .btn-ui {
        margin-left: auto;
    }
}

@media (max-width: 575.98px) {
    .lp {
        --lp-gutter: 16px;
    }

    .lp-hero h1 {
        font-size: 36px;
    }

    .lp-lead {
        font-size: 15.5px;
    }

    .lp-cta, .lp-cta .btn-ui {
        width: 100%;
    }

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

    .lp main > .lp-section {
        padding-top: 72px;
    }

    .lp-brain-hint {
        display: none;
    }

    .lp-faq-list details p {
        padding-right: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html:has(.lp) { scroll-behavior: auto; }
    .lp-ticker.is-new { animation: none; }
    .lp-feature { transition: none; }
    .lp-feature:hover { transform: none; }
}

.create-user-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
    align-items: end;
    gap: 12px;
    margin-bottom: 8px;
}

/* Two-factor setup */
.twofactor-setup-grid {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

@media (max-width: 640px) {
    .twofactor-setup-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.qr-box {
    display: inline-flex;
    padding: 12px;
    background: #fff;
    border-radius: 10px;
    line-height: 0;
}

.qr-box svg {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
}

.twofactor-key {
    display: block;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    letter-spacing: 0.05em;
    word-break: break-all;
}

.recovery-codes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
}

/* Brain choice for Fragen/Suche (Paket 6D): compact select next to the input. */
.brain-choice {
    width: auto;
    max-width: 240px;
    height: 34px;
    font-size: 13px;
}

.hit-brain {
    color: var(--muted);
}
