/* =====================================================================
   at0mic Cockpit – Stile für Formulare und die einzelnen Seiten
   (die Grundlagen und Farben stehen in app.css)
   ---------------------------------------------------------------------
   1. Formulare, Reiter, Listen
   2. Objekte-Seite
   3. DNA-Baum
   4. Code & DNA (Editor, Vorschau)
   5. Kleinere Bildschirme
   ===================================================================== */

/* ---------- 1. Formulare, Reiter, Listen ---------- */
.grow {
    flex: 1;
    min-width: 0;
}
.wrap {
    flex-wrap: wrap;
}
.hidden-box {
    display: none;
}
.stack-s {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.input {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 14px;
}
.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.input.small {
    padding: 6px 9px;
    font-size: 13px;
}
.input.mono {
    font-family: var(--mono);
    font-size: 13px;
}
select.input {
    cursor: pointer;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
}
.field-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
}
.field-hint {
    font-size: 12px;
    color: var(--faint);
}
.form-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.form-row > .btn {
    margin-top: 23px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    cursor: pointer;
}
.check input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}
.sub-title {
    font-size: 13.5px;
    margin: 6px 0 4px;
}

/* Reiter */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.tab {
    position: relative;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 13.5px;
    font-weight: 550;
    padding: 9px 14px;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tab:hover {
    color: var(--text);
}
.tab.active {
    color: var(--accent-strong);
    border-bottom-color: var(--accent);
}
.tab-badge {
    margin-left: 6px;
    font-size: 11px;
    background: var(--surface-2);
    border-radius: 99px;
    padding: 0 6px;
}
/* Code-Reiter: grauer Punkt = hat Inhalt, oranger Punkt = ungespeichert */
.tab.has-content::after,
.tab.dirty::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--faint);
}
.tab.dirty::after {
    background: var(--warn);
}
.tab-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 14px;
    min-width: 0;
}

/* Name/Wert-Liste */
.info-list {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 8px 16px;
    margin: 0;
    font-size: 13.5px;
}
.info-list dt {
    color: var(--muted);
}
.info-list dd {
    margin: 0;
    min-width: 0;
    word-break: break-word;
}
.chip-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip {
    display: inline-flex;
    padding: 1px 9px;
    border: 1px solid var(--border-strong);
    border-radius: 99px;
    font-size: 12.5px;
    color: var(--text);
}
.chip:hover {
    border-color: var(--accent);
    text-decoration: none;
}
.versions {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.versions li {
    display: flex;
    gap: 10px;
    align-items: center;
}
details.raw summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}
.steps-log {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ---------- 2. Objekte-Seite ---------- */
.split {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.list-panel {
    position: sticky;
    top: calc(var(--topbar-h) + 12px);
    max-height: calc(100vh - var(--topbar-h) - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.list-panel-head {
    padding: 12px 12px 8px;
    border-bottom: 1px solid var(--border);
}
.list-count {
    padding: 8px 14px 0;
}
.obj-tree-box {
    overflow-y: auto;
    padding: 6px 6px 10px;
}
.obj-tree,
.obj-tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.obj-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-s);
    color: var(--text);
    font-size: 13.5px;
    text-decoration: none !important;
}
.obj-item:hover {
    background: var(--surface-2);
}
.obj-item.active {
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: 600;
}
.obj-item-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Auf-/Zuklappen in der Objekt-Liste (25.10.2026) */
.obj-toggle,
.obj-toggle-space {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
}
.obj-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    background: none;
    color: var(--muted);
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    transition: transform 0.12s ease;
}
.obj-toggle:hover {
    background: var(--surface-2);
    color: var(--text);
}
.obj-toggle.open {
    transform: rotate(90deg);
}
.list-panel-tools {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.list-panel-tools select {
    flex: 1;
    min-width: 0;
}
.obj-kids {
    font-size: 11px;
    color: var(--muted);
    background: var(--surface-2);
    border-radius: 99px;
    padding: 0 7px;
}
.detail {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}
.detail-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.detail-icon {
    display: inline-flex;
    padding: 9px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-strong);
}
.detail-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.detail-title h2 {
    font-size: 19px;
    word-break: break-word;
}
.role-group {
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.role-group.protecting {
    border-color: color-mix(in srgb, var(--ok) 45%, var(--border));
}
.role-group-head {
    display: flex;
    gap: 8px;
    align-items: center;
}
.role-line {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.role-chips {
    display: inline-flex;
    gap: 4px;
}

/* ---------- 3. DNA-Baum ---------- */
.tree {
    list-style: none;
    margin: 0;
    padding: 0 0 0 18px;
    border-left: 1px dashed var(--border-strong);
}
.tree.tree-root {
    padding-left: 0;
    border-left: 0;
}
.tree li {
    margin: 2px 0;
}
.tree summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tree summary::-webkit-details-marker {
    display: none;
}
.tree summary::before {
    content: '▸';
    color: var(--muted);
    font-size: 11px;
    width: 10px;
}
.tree details[open] > summary::before {
    content: '▾';
}
.tree-leaf {
    padding-left: 16px;
}
.tree-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 3px 6px;
    border-radius: 6px;
}
.tree-row:hover {
    background: var(--surface-2);
}
.tree-id {
    font-weight: 600;
}
.tree-source {
    font-size: 11.5px;
}
.tree-count {
    font-size: 11px;
    color: var(--muted);
}
.tree-open {
    display: inline-flex;
    color: var(--accent);
}

/* ---------- 4. Code & DNA ---------- */
.code-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}
.code-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.code-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.code-main .tabs {
    padding: 0 10px;
}
.code-main > .callout {
    margin: 10px 12px 0;
}
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.save-out {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.save-out:not(:empty) {
    padding: 10px 12px 12px;
    border-top: 1px solid var(--border);
}
.code-side-card {
    position: sticky;
    top: calc(var(--topbar-h) + 12px);
    max-height: calc(100vh - var(--topbar-h) - 40px);
    overflow-y: auto;
}
.code-side {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.side-head {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}
.side-head h3 {
    font-size: 15px;
}
.preview-frame {
    width: 100%;
    height: 420px;
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    background: #fff;
}
.issues {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.issues.error {
    color: var(--error);
}
.issues.warn li::marker {
    color: var(--warn);
}
.issues.note {
    color: var(--muted);
}

/* Editor (CodeMirror) im at0mic-Look – folgt Hell/Dunkel über die Farb-Variablen */
.editor {
    --editor-min: 360px;
}
.editor .CodeMirror {
    height: auto;
    min-height: var(--editor-min);
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.6;
    background: var(--surface);
    color: var(--text);
}
.editor .CodeMirror-scroll {
    min-height: var(--editor-min);
    max-height: 70vh;
}
.editor .CodeMirror-gutters {
    background: var(--surface-2);
    border-right: 1px solid var(--border);
}
.editor .CodeMirror-linenumber {
    color: var(--faint);
}
.editor .CodeMirror-cursor {
    border-left-color: var(--text);
}
.editor .CodeMirror-activeline-background {
    background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.editor .CodeMirror-selected,
.editor .CodeMirror-focused .CodeMirror-selected {
    background: color-mix(in srgb, var(--accent) 22%, transparent);
}
.editor .CodeMirror-matchingbracket {
    color: var(--ok) !important;
    text-decoration: underline;
}
.editor .cm-keyword,
.editor .cm-builtin {
    color: var(--j-key);
}
.editor .cm-string,
.editor .cm-string-2 {
    color: var(--j-string);
}
.editor .cm-number {
    color: var(--j-number);
}
.editor .cm-atom {
    color: var(--j-bool);
}
.editor .cm-comment {
    color: var(--faint);
    font-style: italic;
}
.editor .cm-def,
.editor .cm-property {
    color: var(--info);
}
.editor .cm-variable-2,
.editor .cm-variable-3 {
    color: var(--text);
}
.editor .cm-tag {
    color: var(--role-red);
}
.editor .cm-attribute,
.editor .cm-qualifier {
    color: var(--j-number);
}
.editor-fallback {
    width: 100%;
    min-height: var(--editor-min);
    border: 0;
    padding: 12px;
    resize: vertical;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.6;
    background: var(--surface);
    color: var(--text);
    tab-size: 4;
}
.editor-fallback:focus {
    outline: none;
}

/* ---------- 5. Kleinere Bildschirme ---------- */
@media (max-width: 1100px) {
    .code-layout,
    .split {
        grid-template-columns: minmax(0, 1fr);
    }
    .list-panel {
        position: static;
        max-height: 420px;
    }
    .code-side-card {
        position: static;
        max-height: none;
    }
}
@media (max-width: 560px) {
    .form-row,
    .form-grid {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    .form-row > .btn {
        margin-top: 0;
    }
    .info-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }
    .info-list dd {
        margin-bottom: 8px;
    }
}

/* Knöpfe in Reitern nicht auf volle Breite ziehen */
.tab-body > .btn,
.tab-body > div > .btn {
    align-self: flex-start;
}

/* Handy: Knöpfe im Objekt-Kopf unter den Titel, damit der Name Platz hat */
@media (max-width: 560px) {
    .detail-head > .row {
        width: 100%;
    }
    .detail {
        padding: 14px;
    }
}

/* Vorschau: Meldungen (Fehler / console.log) unter dem Rahmen */
.preview-console {
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    background: var(--surface-2);
    font-family: var(--mono);
    font-size: 12px;
    max-height: 160px;
    overflow-y: auto;
}
.pc-line {
    display: flex;
    gap: 8px;
    padding: 5px 10px;
    border-bottom: 1px solid var(--border);
    word-break: break-word;
}
.pc-line:last-child {
    border-bottom: 0;
}
.pc-line.error {
    color: var(--error);
}
.pc-line.warn {
    color: var(--warn);
    font-family: var(--font);
}
.pc-kind {
    font-weight: 700;
    flex-shrink: 0;
}

/* ---------- SSF-Studio ---------- */
.ssf-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
}
.small-editor {
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    overflow: hidden;
}
.run-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 14px 16px;
    border-top: 1px solid var(--border);
}
.run-panel .tabs {
    margin-bottom: 2px;
}
.run-result {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.run-result:empty::before {
    content: 'Noch nicht ausgeführt. Tipp: Strg+Enter.';
    color: var(--faint);
    font-size: 13px;
}
.run-error {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--error);
}
.history-list {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.history-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px;
    border: 0;
    border-radius: var(--radius-s);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.history-item:hover {
    background: var(--surface-2);
}
.example {
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.example:hover {
    border-color: var(--border-strong);
}
.example-head {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.example-n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.example details summary {
    cursor: pointer;
    color: var(--muted);
}
.learn {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.tool-chip {
    font-size: 11.5px;
}
.tool-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tool {
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
}
.tool summary {
    cursor: pointer;
    padding: 7px 10px;
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}
.tool-name {
    font-weight: 600;
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    color: var(--accent-strong);
}
.tool-sig {
    font-family: var(--mono);
}
.tool-body {
    padding: 0 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tool-body .btn {
    align-self: flex-start;
}
.ssf-side .code-side {
    padding-top: 6px;
}
@media (max-width: 1100px) {
    .ssf-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- Daten & Suche ---------- */
.pad-card {
    padding: 6px 18px 18px;
}
.data-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.dsl-examples {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
}
.dsl-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.dsl-group .nav-group-title {
    width: 100%;
    padding: 0;
}
.dsl-example {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    border-radius: 99px;
    padding: 3px 11px;
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
}
.dsl-example:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
}
.results-head:empty {
    display: none;
}
.pager {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    text-align: left;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface-2);
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.data-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.data-table td.obj {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}
.data-table tr.row-main {
    cursor: pointer;
}
.data-table tr.row-main:hover td {
    background: var(--surface-2);
}
.data-table tr.row-detail td {
    background: var(--bg);
}
.danger-icon:hover {
    color: var(--error);
    background: var(--error-soft);
}

/* ---------- Relationen ---------- */
.relations {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.relation {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
}
.rel-arrow {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12px;
}
.preview-rel {
    padding: 8px 10px;
    background: var(--surface-2);
    border-radius: var(--radius-s);
}

/* ---------- Tresor ---------- */
.secret-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.secret-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
}
.secret-icon {
    display: inline-flex;
    color: var(--accent);
}
.secret-mask {
    font-family: var(--mono);
    color: var(--faint);
    letter-spacing: 2px;
}

/* ---------- Rechte ---------- */
.triplet-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.triplet-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}
.triplet-list li a {
    font-weight: 600;
}
.role-removable {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.role-x {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 0 0 3px;
    opacity: 0.55;
}
.role-x:hover {
    opacity: 1;
}
.check-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.check-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: var(--radius-s);
    font-size: 13.5px;
}
.check-list li.pass .icon {
    color: var(--ok);
}
.check-list li.fail {
    background: var(--error-soft);
}
.check-list li.fail .icon {
    color: var(--error);
}
@media (max-width: 1100px) {
    .data-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- Systemcheck ---------- */
.check-hero .card-body {
    gap: 14px;
}
.check-hero-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.btn.big {
    padding: 11px 22px;
    font-size: 15px;
}
.progress-bar {
    height: 8px;
    border-radius: 99px;
    background: var(--surface-2);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 99px;
    transition: width 0.25s ease;
}
.progress-bar.active .progress-fill {
    background: linear-gradient(90deg, var(--accent), #b25cff, var(--accent));
    background-size: 200% 100%;
    animation: progress-move 1.2s linear infinite;
}
@keyframes progress-move {
    to {
        background-position: -200% 0;
    }
}
.check-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-weight: 600;
}
.sum {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.sum.pass {
    color: var(--ok);
}
.sum.fail {
    color: var(--error);
}
.sum.skip {
    color: var(--warn);
}
.sum.zero {
    color: var(--faint);
}
.check-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}
.check-group {
    padding: 12px 12px 8px;
    border-top: 3px solid var(--border-strong);
}
.check-group.pass {
    border-top-color: var(--ok);
}
.check-group.fail {
    border-top-color: var(--error);
}
.check-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 6px;
}
.check-group-head h2 {
    font-size: 14.5px;
}
.check-row summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px;
    border-radius: var(--radius-s);
    cursor: pointer;
    list-style: none;
    font-size: 13.5px;
}
.check-row summary::-webkit-details-marker {
    display: none;
}
.check-row summary:hover {
    background: var(--surface-2);
}
.check-icon {
    display: inline-flex;
    color: var(--faint);
}
.check-row.pass .check-icon {
    color: var(--ok);
}
.check-row.fail .check-icon {
    color: var(--error);
}
.check-row.skip .check-icon {
    color: var(--warn);
}
.check-row.running .check-icon {
    color: var(--accent);
    animation: spin 0.8s linear infinite;
}
.check-title {
    flex-shrink: 0;
}
.check-detail {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}
.check-body {
    padding: 4px 8px 10px 30px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.check-error {
    color: var(--error);
    font-size: 13px;
}
@media (max-width: 1100px) {
    .check-groups {
        grid-template-columns: minmax(0, 1fr);
    }
}
@media (max-width: 560px) {
    .check-detail {
        display: none;
    }
}

/* ---------- KI-Zugänge (Plan "MCP") ---------- */
/* Der Kasten, in dem ein neuer Schlüssel genau EINMAL erscheint */
.token-reveal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    padding: 14px;
    border: 2px solid var(--warn);
    border-radius: var(--radius-s);
    background: var(--warn-soft);
}
.token-value {
    display: block;
    padding: 10px 12px;
    font-family: var(--mono);
    font-size: 13px;
    word-break: break-all;
    user-select: all; /* ein Klick markiert den ganzen Schlüssel */
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
}

/* ---------------------------------------------------------------------
   "Wartet auf dich" – Freigabe-Anfragen (Übersicht, MCP Etappe 5d)
   Was passiert, steht gross; die Begründung der KI klein darunter.
   --------------------------------------------------------------------- */
.request-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
/* Neue Uploads von Website-Besuchern (Plan "R2", R2b): kleines Vorschaubild links */
.upload-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.upload-body {
    flex: 1;
    min-width: 0;
}
.upload-thumb {
    flex: 0 0 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius, 10px);
    overflow: hidden;
    color: var(--muted, #8a919d);
    background: repeating-conic-gradient(#8881 0% 25%, transparent 0% 50%) 50% / 12px 12px;
}
.upload-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.request-item {
    border: 1px solid var(--border);
    border-left: 3px solid var(--warn);
    border-radius: var(--radius-s);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.request-what {
    font-size: 15px;
}
.request-reason {
    margin: 2px 0 0;
    padding: 6px 10px;
    border-left: 2px solid var(--border-strong);
    color: var(--muted);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.request-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}
.request-actions .input {
    flex: 1 1 220px;
    width: auto;
}

/* Agent anlegen (Seite KI-Zugänge): ein Werkzeugkasten zum Ankreuzen */
.agent-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0;
}
.agent-box .muted {
    padding-left: 26px; /* unter dem Text, nicht unter dem Häkchen */
}

/* Agenten im Griff (pages/agents.js): Rechte eines Agenten als kurze Liste */
.agent-rights {
    list-style: none;
    margin: 4px 0 8px;
    padding: 0;
}
.agent-rights li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

/* --- Reiter "Datei" (Plan "Dateien mit R2", D2) --- */
.file-drop {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    margin-bottom: 12px;
    border: 2px dashed var(--border);
    border-radius: var(--radius, 10px);
    color: var(--muted);
}
.file-drop.is-over {
    border-color: var(--accent);
    background: var(--accent-soft, rgba(99, 102, 241, 0.08));
    color: inherit;
}
.file-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
/* Text-Dateien (csv, ics, json, txt – Plan "R1"): als reiner Text, mit Rollbalken */
.file-preview-text {
    max-height: 320px;
    overflow: auto;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius, 10px);
    font:
        12px/1.5 ui-monospace,
        SFMono-Regular,
        Menlo,
        Consolas,
        monospace;
    white-space: pre-wrap;
    word-break: break-word;
}
.file-preview-img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    align-self: flex-start;
    border: 1px solid var(--border);
    border-radius: var(--radius, 10px);
    /* Karomuster: so sieht man auch durchsichtige Bilder (PNG, SVG) */
    background: repeating-conic-gradient(#8881 0% 25%, transparent 0% 50%) 50% / 16px 16px;
}
