:root {
    --bg: #f4f6f9;
    --card: #fff;
    --text: #1a2332;
    --muted: #5c6b7e;
    --border: #d8dee9;
    --primary: #1e4d8c;
    --primary-hover: #163a6b;
    --danger: #a32020;
    --ok: #1a6b3a;
    --warn: #8a6a00;
    --err: #a32020;
    --unknown: #555;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-hover);
}

code, pre {
    font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
    font-size: 0.9em;
}

.layout-public .main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    min-width: 0;
    box-sizing: border-box;
}

.site-header, .site-footer {
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.site-footer {
    border-top: 1px solid var(--border);
    border-bottom: none;
    color: var(--muted);
    font-size: 0.85rem;
}

.site-header .inner, .site-footer .inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 1rem;
}

.page-head {
    margin-bottom: 1.25rem;
}

.page-head h1 {
    margin: 0 0 0.25rem;
    font-size: 1.75rem;
}

.lead {
    margin: 0;
    color: var(--muted);
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.stack label {
    display: block;
    margin-bottom: 0.75rem;
}

.stack input[type="text"],
.stack input[type="url"],
.stack input[type="search"],
.stack input[type="password"],
.stack input[type="number"],
.stack input[type="file"],
.stack textarea,
.stack select {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
}

.inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.filters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: flex-end;
}

.filters-grid .filter-field {
    flex: 1 1 11rem;
    min-width: 0;
}

.filters-grid .filter-field-search {
    flex: 2 1 14rem;
}

.filters-grid .filter-field-status {
    flex: 2 1 16rem;
}

.filters-grid .filter-field-tags {
    flex: 1 1 100%;
}

.filters-grid .filter-input {
    display: block;
    width: 100%;
    max-width: none;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
}

.filters-grid .filter-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.filters-grid .filter-actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: auto;
}

@media (min-width: 720px) {
    .filters-grid .filter-field-tags {
        flex: 1 1 calc(100% - 12rem);
    }
}

@media (min-width: 960px) {
    .filters-grid {
        display: grid;
        grid-template-columns: minmax(12rem, 1.4fr) minmax(14rem, 2fr) auto;
        align-items: end;
    }

    .filters-grid .filter-field-tags {
        grid-column: 1 / -1;
    }

    .filters-grid .filter-actions {
        grid-column: 3;
        grid-row: 1;
        margin-left: 0;
        align-self: end;
    }

    .filters-grid .filter-field-search {
        grid-column: 1;
        grid-row: 1;
    }

    .filters-grid .filter-field-status {
        grid-column: 2;
        grid-row: 1;
    }
}

.filters .filter-row {
    margin-bottom: 0.75rem;
}

.filter-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.input-grow {
    width: 100%;
    max-width: 28rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.chip-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 0.75rem;
    font-weight: normal;
}

.tag-pick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-cb {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    background: #eef2f7;
    border-radius: 6px;
    font-size: 0.9rem;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn {
    display: inline-block;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

.btn-secondary {
    background: #e8ecf3;
    color: var(--text);
    border-color: var(--border);
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border-color: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-small {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
}

.table-wrap {
    overflow-x: auto;
}

/* Tooltips dürfen aus Karten ragen; nur breite Tabellen horizontal scrollen */
.table-wrap--repo-list,
.table-wrap--target-list,
.table-wrap--history,
.table-wrap--build-list {
    overflow: visible;
}

.card.table-wrap--repo-list,
.card.table-wrap--target-list,
.card:has(.table-wrap--repo-list),
.card:has(.table-wrap--target-list) {
    overflow: visible;
}

.data-table--repo-list tbody,
.data-table--target-list tbody {
    overflow: visible;
}

.data-table--repo-list tbody tr.status-row,
.data-table--target-list tbody tr.status-row,
.data-table--repo-list .col-field,
.data-table--target-list .col-field {
    overflow: visible;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th, .data-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.data-table tr.row-selected {
    background: #eef4ff;
    font-weight: 600;
}

.data-table tr.history-row {
    cursor: pointer;
}

.data-table tr.history-row:hover:not(.row-selected) {
    background: #f4f7fb;
}

.data-table tr.history-row:focus {
    outline: 2px solid var(--accent, #3b6fd8);
    outline-offset: -2px;
}

.data-table th {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table .empty {
    text-align: center;
    color: var(--muted);
    padding: 2rem;
}

.data-table--targets {
    table-layout: fixed;
    width: 100%;
    max-width: 100%;
}

.data-table--targets th,
.data-table--targets td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.data-table--targets .col-thumb {
    width: 2.75rem;
    max-width: 2.75rem;
    vertical-align: middle;
    padding-right: 0.35rem;
}

.data-table--targets .col-thumb img {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    background: #eef2f7;
}

.data-table--targets .col-name {
    width: 20%;
    max-width: 0;
}

.data-table--targets .col-name a {
    word-break: break-word;
}

.data-table--targets .col-yaml {
    width: 50%;
    max-width: 0;
}

.data-table--targets .col-yaml .table-edit-link {
    display: block;
    min-width: 0;
}

.data-table--targets .col-yaml code {
    white-space: normal;
}

.data-table--targets .col-status {
    width: 14%;
}

.data-table--targets .col-delete {
    width: 12%;
    white-space: nowrap;
    vertical-align: top;
}

.data-table .table-edit-link {
    color: inherit;
    text-decoration: none;
}

.data-table .table-edit-link:hover {
    color: var(--primary);
}

.head-actions {
    margin: 0.35rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.path-break {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.thumb img {
    border-radius: 6px;
    object-fit: cover;
    background: #eef2f7;
}

.tag {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    margin: 0 0.15rem 0.15rem 0;
    background: #e8ecf3;
    border-radius: 4px;
    font-size: 0.8rem;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-ok { background: #d4edda; color: var(--ok); }
.badge-warning { background: #fff3cd; color: var(--warn); }
.badge-error { background: #f8d7da; color: var(--err); }
.badge-unknown { background: #e2e3e5; color: var(--unknown); }
.badge-stale { background: #fde6d2; color: #8a4b00; }
.badge-running { background: #cfe2ff; color: #084298; }
.badge-muted { background: #eee; color: var(--muted); }

.running-pulse {
    animation: running-pulse 1.6s ease-in-out infinite;
}

@keyframes running-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.running-builds-card {
    border-left: 4px solid #0d6efd;
    margin-bottom: 1rem;
}

.running-builds-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.running-builds-head h2 {
    margin: 0;
}

.running-build-banner {
    border-left: 4px solid #0d6efd;
    background: #f0f6ff;
}

.running-build-banner p {
    margin: 0;
}

.status-row.status-error { border-left: 3px solid var(--err); }
.status-row.status-warning { border-left: 3px solid #c9a100; }
.status-row.status-ok { border-left: 3px solid var(--ok); }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.break { word-break: break-all; }
.nowrap { white-space: nowrap; }

.msg-ok { color: var(--ok); }
.msg-error { color: var(--err); }
.msg-warn { background: #fff8e6; border: 1px solid #f0d78c; padding: 1rem; border-radius: var(--radius); }

.banner-warn {
    background: #fff3cd;
    color: #664d03;
    padding: 0.75rem 1rem;
    text-align: center;
    border-bottom: 1px solid #e6d89c;
}

.banner-warn a {
    color: inherit;
    font-weight: 600;
}

.layout-admin {
    min-height: 100vh;
    overflow-x: clip;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-nav {
    width: 220px;
    flex-shrink: 0;
    background: #1a2332;
    color: #e8ecf3;
    padding: 1rem 0;
}

.admin-nav a {
    color: #dbe4f0;
    text-decoration: none;
    display: block;
    padding: 0.45rem 1.25rem;
    font-size: 0.95rem;
}

.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.admin-brand {
    padding: 0 1.25rem 1rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.admin-brand a {
    color: #fff;
    padding: 0;
}

.admin-brand a:hover {
    background: none;
}

.admin-nav .logout {
    margin-top: 1rem;
    padding: 0 1rem;
}

.admin-nav .logout button {
    width: 100%;
}

.admin-main {
    flex: 1;
    min-width: 0;
}

.admin-content {
    padding: 1.5rem 2rem 3rem;
    max-width: 960px;
    min-width: 0;
    box-sizing: border-box;
}

.layout-admin .card {
    min-width: 0;
    max-width: 100%;
}

.narrow, .narrow-form {
    max-width: 420px;
    margin: 0 auto;
}

.danger-zone {
    border-color: #f5c6cb;
    background: #fff5f5;
    margin-top: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 800px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .admin-shell {
        flex-direction: column;
    }
    .admin-nav {
        width: 100%;
    }
}

.detail-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.detail-img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: var(--radius);
    background: #eef2f7;
}

.dl dt {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

.dl dd {
    margin: 0.15rem 0 0;
}

.pre-block {
    background: #1e2430;
    color: #e8ecf3;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.82rem;
    max-height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.pre-block--log {
    max-height: min(480px, 60vh);
}

.log-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.log-card-head h2 {
    margin: 0;
}

.data-table .col-log {
    width: 4.5rem;
    white-space: nowrap;
    vertical-align: top;
}

/* Build-Verlauf: kompakte Zeilen (Desktop + Mobil) */
.data-table--history .col-meta {
    width: 11rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.data-table--history .history-date {
    font-size: 0.88rem;
    color: var(--muted);
}

.data-table--history .history-message {
    word-break: break-word;
}

.layout-log {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #1e2430;
    color: #e8ecf3;
}

.log-page-header {
    flex-shrink: 0;
    background: var(--card);
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.log-page-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.log-page-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.log-page-body {
    flex: 1;
    margin: 0;
    padding: 1rem 1.25rem 2rem;
    overflow: auto;
    font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    background: transparent;
    color: inherit;
    border: none;
    border-radius: 0;
    max-height: none;
}

.secrets-table input[type="text"] {
    width: 100%;
    min-width: 8rem;
    padding: 0.35rem 0.5rem;
    font: inherit;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.secrets-preview {
    margin-top: 0.5rem;
}

.secrets-preview summary {
    cursor: pointer;
    font-weight: 600;
}

.stats-dashboard {
    margin-bottom: 1.25rem;
    max-width: 100%;
    min-width: 0;
}

.stats-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #eef4ff 0%, #f8fafc 55%, #fff 100%);
    border-color: #c5d4eb;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.stats-hero-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.stats-hero-value {
    margin: 0.15rem 0 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stats-hero-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    flex: 1 1 14rem;
    min-width: 0;
    align-self: center;
}

.stat-pill {
    text-align: center;
    padding: 0.5rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 0;
}

.stat-pill-warn {
    border-color: #f0d78c;
    background: #fffbeb;
}

.stat-pill-num {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-pill-lbl {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.stats-grid > * {
    min-width: 0;
}

.stats-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.stats-card-wide {
    grid-column: 1 / -1;
    overflow: visible;
}

.stats-card-title {
    margin: 0 0 0.1rem;
    font-size: 1rem;
    line-height: 1.2;
}

.stats-card-desc {
    margin: 0 0 0.45rem;
    line-height: 1.3;
}

.stats-card-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: nowrap;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.donut-sm {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 0.62rem var(--card);
}

.stats-bars {
    flex: 1;
    min-width: 0;
}

.stats-card-footnote {
    margin: 0.4rem 0 0;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ok);
    line-height: 1.25;
}

.stats-bar-row {
    display: grid;
    grid-template-columns: minmax(2.75rem, 3.5rem) minmax(0, 1fr) 1.65rem;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.22rem;
    font-size: 0.8rem;
}

.stats-bar-row:last-child {
    margin-bottom: 0;
}

.stats-bar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-bar-track {
    height: 0.4rem;
    background: #e8ecf3;
    border-radius: 3px;
    overflow: hidden;
}

.stats-bar-fill {
    height: 100%;
    border-radius: 4px;
    min-width: 2px;
}

.stats-bar-ok { background: var(--ok); }
.stats-bar-warning { background: #c9a100; }
.stats-bar-error { background: var(--err); }
.stats-bar-unknown { background: #8a9199; }

.stats-bar-num {
    text-align: right;
    font-weight: 600;
}

.stats-bar-row--link {
    text-decoration: none;
    color: inherit;
    border-radius: 4px;
    transition: background 0.12s ease;
}

.stats-bar-row--link:hover,
.stats-bar-row--link:focus-visible {
    background: rgba(30, 77, 140, 0.08);
    outline: none;
}

.stats-bar-row--link:focus-visible {
    box-shadow: 0 0 0 2px var(--primary);
}

.filters-grid select.filter-input {
    width: 100%;
    max-width: none;
}

.empty-inline {
    margin: 0;
    padding: 0.5rem 0;
}

.sparkline {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    height: 8rem;
    padding-top: 0.5rem;
    max-width: 100%;
    min-width: 0;
}

.spark-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-width: 0;
    position: relative;
    cursor: help;
    outline: none;
}

.spark-bar .spark-tooltip {
    left: 50%;
    bottom: calc(100% + 0.4rem);
    transform: translateX(-50%);
}

.spark-bar .spark-tooltip::after {
    left: 50%;
    margin-left: -5px;
}

.spark-bar:hover .spark-tooltip,
.spark-bar:focus .spark-tooltip,
.spark-bar:focus-visible .spark-tooltip {
    visibility: visible;
    opacity: 1;
}

.spark-tooltip-line--head {
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.spark-stack {
    width: 100%;
    max-width: 2.5rem;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
    background: #e8ecf3;
}

.spark-ok {
    display: block;
    background: var(--ok);
}

.spark-warning {
    display: block;
    background: #c9a100;
}

.spark-error,
.spark-err {
    display: block;
    background: var(--err);
}

.spark-unknown {
    display: block;
    background: #8a9199;
}

.spark-stack--idle {
    height: 4px;
    min-height: 4px;
    width: 100%;
    max-width: 2.5rem;
    margin-top: auto;
    background: #c8cfd8;
    border-radius: 2px;
    overflow: hidden;
}

.spark-stack--idle .spark-empty {
    display: block;
    height: 100%;
    width: 100%;
    background: #c8cfd8;
}

.spark-empty {
    display: block;
    background: #e8ecf3;
}

.spark-label {
    font-size: 0.65rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.status-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: help;
    outline: none;
}

.status-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 50;
    left: 50%;
    bottom: calc(100% + 0.4rem);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
    width: max-content;
    min-width: 7.5rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    color: #fff;
    background: #1a2332;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    transition: opacity 0.12s ease, visibility 0.12s ease;
}

.status-tooltip-line {
    display: block;
    white-space: nowrap;
}

.status-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #1a2332;
}

.status-tooltip-wrap:hover .status-tooltip,
.status-tooltip-wrap:focus .status-tooltip,
.status-tooltip-wrap:focus-visible .status-tooltip {
    visibility: visible;
    opacity: 1;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-hero-facts {
        width: 100%;
        flex: none;
    }

    .stats-grid .stats-card {
        padding: 0.65rem 0.75rem;
    }

    .stats-card-desc {
        margin-bottom: 0.35rem;
    }

    .stats-card-body {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .donut-sm {
        width: 3.25rem;
        height: 3.25rem;
        box-shadow: inset 0 0 0 0.52rem var(--card);
        align-self: center;
    }

    .stats-bar-row {
        grid-template-columns: minmax(2.35rem, 2.75rem) minmax(0, 1fr) 1.45rem;
        gap: 0.3rem;
        margin-bottom: 0.18rem;
        font-size: 0.76rem;
    }

    .stats-bar-track {
        height: 0.32rem;
    }

    .stats-card-footnote {
        margin-top: 0.35rem;
        padding-top: 0.3rem;
        font-size: 0.78rem;
    }
}

/* --- Responsive: Mobil & schmale Viewports --- */

@media (max-width: 720px) {
    .layout-public .main {
        padding: 1rem 0.75rem 2.5rem;
    }

    .site-header .inner,
    .site-footer .inner {
        padding: 0.65rem 0.75rem;
    }

    .site-header .inner {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.5rem 1rem;
    }

    .nav {
        flex: 1 1 100%;
        flex-wrap: wrap;
        gap: 0.5rem 0.85rem;
        font-size: 0.9rem;
    }

    .page-head h1 {
        font-size: 1.4rem;
        line-height: 1.25;
    }

    .page-head .lead {
        font-size: 0.95rem;
    }

    .page-head .lead code {
        display: inline-block;
        max-width: 100%;
        word-break: break-all;
    }

    .breadcrumb {
        line-height: 1.4;
        word-break: break-word;
    }

    .card {
        padding: 1rem;
    }

    .filters-grid .filter-field,
    .filters-grid .filter-field-search,
    .filters-grid .filter-field-status,
    .filters-grid .filter-field-tags {
        flex: 1 1 100%;
    }

    .filters-grid .filter-actions {
        width: 100%;
        margin-left: 0;
        justify-content: stretch;
    }

    .filters-grid .filter-actions .btn {
        flex: 1 1 auto;
        min-height: 2.75rem;
    }

    .chip-group label {
        margin-right: 0.5rem;
        margin-bottom: 0.35rem;
    }

    .stats-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.65rem 0.75rem;
    }

    .stats-hero-facts {
        width: 100%;
    }

    .stats-hero-value {
        font-size: 1.45rem;
    }

    .stat-pill {
        padding: 0.4rem 0.3rem;
    }

    .stat-pill-lbl {
        font-size: 0.65rem;
        line-height: 1.2;
    }

    .stat-pill-num {
        font-size: 1.15rem;
    }

    .sparkline {
        height: 6.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding-bottom: 0.35rem;
    }

    .spark-bar {
        flex: 0 0 1.6rem;
        min-width: 1.6rem;
    }

    .spark-bar .spark-tooltip {
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100vw - 1.5rem);
    }

    .col-field .status-tooltip-wrap {
        position: static;
    }

    .col-field .status-tooltip {
        left: 0;
        transform: none;
        width: max-content;
        max-width: calc(100vw - 1.5rem);
    }

    .col-field .status-tooltip::after {
        left: 1.25rem;
        margin-left: 0;
    }

    /* Startseite + Repo-Detail: kompakte Karten, Label und Wert in einer Zeile */
    .data-table--repo-list thead,
    .data-table--target-list thead {
        display: none;
    }

    .data-table--repo-list tbody tr.status-row,
    .data-table--target-list tbody tr.status-row {
        display: grid;
        grid-template-columns: 2.35rem minmax(0, 1fr);
        gap: 0.12rem 0.5rem;
        padding: 0.45rem 0.55rem;
        margin-bottom: 0.45rem;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--card);
        border-left-width: 3px;
    }

    .data-table--repo-list tbody tr.status-row:last-child,
    .data-table--target-list tbody tr.status-row:last-child {
        margin-bottom: 0;
    }

    .data-table--repo-list tbody tr.status-row td,
    .data-table--target-list tbody tr.status-row td {
        display: block;
        padding: 0;
        border-bottom: none;
        text-align: left;
        line-height: 1.3;
    }

    .data-table--repo-list .col-thumb,
    .data-table--target-list .col-thumb {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
    }

    .data-table--repo-list .col-thumb img,
    .data-table--target-list .col-thumb img {
        width: 36px;
        height: 36px;
        display: block;
    }

    .data-table--repo-list .col-repo,
    .data-table--target-list .col-name {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        font-size: 1rem;
    }

    .data-table--repo-list .col-repo::before,
    .data-table--target-list .col-name::before {
        display: none;
    }

    .data-table--repo-list .col-field,
    .data-table--target-list .col-field {
        grid-column: 1 / -1;
        font-size: 0.88rem;
    }

    .data-table--repo-list .col-field::before,
    .data-table--target-list .col-field::before {
        content: attr(data-label) ": ";
        display: inline;
        font-weight: 600;
        font-size: 0.8rem;
        text-transform: none;
        letter-spacing: 0;
        color: var(--muted);
        margin: 0 0.2rem 0 0;
    }

    .data-table--repo-list .col-field .tag {
        margin-bottom: 0.05rem;
    }

    .data-table--target-list .col-yaml code {
        font-size: 0.85rem;
    }

    .data-table--repo-list .col-message {
        color: var(--muted);
    }

    .data-table--repo-list .col-message .small {
        font-size: inherit;
    }

    .data-table--repo-list td.empty,
    .data-table--target-list td.empty {
        display: block;
        grid-column: 1 / -1;
        text-align: center;
        padding: 1rem 0.5rem;
    }

    .data-table--repo-list td.empty::before,
    .data-table--target-list td.empty::before {
        display: none;
    }

    .data-table--repo-list tbody tr:has(> td.empty),
    .data-table--target-list tbody tr:has(> td.empty) {
        display: block;
    }

    .data-table--history thead {
        display: none;
    }

    .data-table--history tbody tr.history-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        grid-template-areas:
            "meta log"
            "msg log";
        gap: 0.2rem 0.65rem;
        padding: 0.55rem 0;
        margin: 0;
        border: none;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        background: transparent;
        border-left: 3px solid transparent;
    }

    .data-table--history tbody tr.history-row:last-child {
        border-bottom: none;
    }

    .data-table--history tbody tr.history-row.row-selected {
        background: #eef4ff;
        border-left-color: #5a8fd4;
        padding-left: 0.45rem;
    }

    .data-table--history tbody tr.history-row td {
        display: block;
        padding: 0;
        border-bottom: none;
        text-align: left;
    }

    .data-table--history tbody tr.history-row td::before {
        display: none;
    }

    .data-table--history .col-meta {
        grid-area: meta;
        width: auto;
        white-space: normal;
    }

    .data-table--history .history-message {
        grid-area: msg;
        font-size: 0.9rem;
        line-height: 1.35;
        color: var(--text);
    }

    .data-table--history .col-log {
        grid-area: log;
        align-self: center;
        width: auto;
    }

    .data-table--history .col-log .btn {
        width: auto;
        min-height: 0;
        padding: 0.3rem 0.55rem;
    }

    .data-table--build-list thead {
        display: none;
    }

    .data-table--build-list tbody tr.build-list-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "when log"
            "repo repo"
            "target target"
            "status status"
            "msg msg";
        gap: 0.2rem 0.65rem;
        padding: 0.55rem 0;
        margin: 0;
        border: none;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        background: transparent;
        border-left: 3px solid transparent;
        cursor: pointer;
    }

    .data-table--build-list tbody tr.build-list-row:last-child {
        border-bottom: none;
    }

    .data-table--build-list tbody tr.build-list-row td {
        display: block;
        padding: 0;
        border-bottom: none;
    }

    .data-table--build-list tbody tr.build-list-row td::before {
        content: attr(data-label) ": ";
        display: inline;
        font-weight: 600;
        font-size: 0.8rem;
        color: var(--muted);
        margin-right: 0.2rem;
    }

    .data-table--build-list .col-when {
        grid-area: when;
    }

    .data-table--build-list .col-when::before {
        display: none;
    }

    .data-table--build-list .col-repo {
        grid-area: repo;
        font-size: 0.88rem;
    }

    .data-table--build-list .col-target {
        grid-area: target;
    }

    .data-table--build-list .col-field {
        grid-area: status;
    }

    .data-table--build-list .col-msg {
        grid-area: msg;
        font-size: 0.88rem;
        color: var(--muted);
    }

    .data-table--build-list .col-log {
        grid-area: log;
        align-self: center;
    }

    .data-table--build-list .col-log::before {
        display: none;
    }

    .data-table--build-list .col-log .btn {
        width: auto;
        min-height: 0;
        padding: 0.3rem 0.55rem;
    }

    .admin-main {
        min-width: 0;
        max-width: 100%;
    }

    .layout-admin .admin-content {
        max-width: 100%;
        box-sizing: border-box;
    }

    .layout-admin .page-head {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 1rem;
    }

    .layout-admin .page-head h1 {
        flex: 1 1 auto;
        margin: 0;
    }

    .layout-admin .page-head .btn {
        flex: 0 0 auto;
    }

    .data-table--stack-md thead {
        display: none;
    }

    .data-table--stack-md tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        padding: 0.75rem;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--card);
    }

    .data-table--stack-md tbody tr:last-child {
        margin-bottom: 0;
    }

    .data-table--stack-md tbody tr.status-row,
    .data-table--stack-md tbody tr.history-row {
        border-left-width: 3px;
    }

    .data-table--stack-md tbody tr.row-selected {
        background: #eef4ff;
        border-color: #a8c4e8;
    }

    .data-table--stack-md tbody tr.history-row {
        cursor: pointer;
    }

    .data-table--stack-md td {
        display: block;
        padding: 0.35rem 0;
        border-bottom: none;
        text-align: left;
    }

    .data-table--stack-md td[data-label]:not([data-label=""])::before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--muted);
        margin-bottom: 0.15rem;
    }

    .data-table--stack-md td.empty {
        text-align: center;
        padding: 1.5rem 0.5rem;
    }

    .data-table--stack-md td.empty::before {
        display: none;
    }

    .data-table--stack-md .thumb {
        margin-bottom: 0.35rem;
    }

    .data-table--stack-md .thumb img {
        width: 48px;
        height: 48px;
    }

    .data-table--stack-md td.col-log {
        padding-top: 0.5rem;
    }

    .data-table--stack-md td.col-log .btn {
        width: 100%;
        justify-content: center;
        min-height: 2.5rem;
    }

    .data-table--stack-md td.nowrap,
    .data-table--stack-md td.col-actions {
        white-space: normal;
    }

    .data-table--stack-md .action-links {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem;
    }

    .data-table--stack-md .action-stack {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .data-table--stack-md .action-stack .btn {
        width: 100%;
        justify-content: center;
    }

    .data-table--stack-md.data-table--targets tbody tr {
        display: grid;
        grid-template-columns: 2.35rem minmax(0, 1fr);
        gap: 0.12rem 0.5rem;
        padding: 0.45rem 0.55rem;
        margin-bottom: 0.45rem;
    }

    .data-table--stack-md.data-table--targets tbody tr:last-child {
        margin-bottom: 0;
    }

    .data-table--stack-md.data-table--targets tbody tr td {
        display: block;
        padding: 0;
    }

    .data-table--stack-md.data-table--targets .col-thumb {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
        max-width: none;
        width: auto;
        padding: 0;
    }

    .data-table--stack-md.data-table--targets .col-thumb::before {
        display: none;
    }

    .data-table--stack-md.data-table--targets .col-thumb img {
        width: 36px;
        height: 36px;
    }

    .data-table--stack-md.data-table--targets .col-name {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        max-width: none;
        width: auto;
    }

    .data-table--stack-md.data-table--targets .col-name::before {
        display: none;
    }

    .data-table--stack-md.data-table--targets .col-yaml,
    .data-table--stack-md.data-table--targets .col-status,
    .data-table--stack-md.data-table--targets .col-delete {
        grid-column: 1 / -1;
        max-width: none;
        width: auto;
    }

    .data-table--stack-md.data-table--targets .col-yaml::before,
    .data-table--stack-md.data-table--targets .col-status::before,
    .data-table--stack-md.data-table--targets .col-delete::before {
        content: attr(data-label) ": ";
        display: inline;
        font-weight: 600;
        font-size: 0.8rem;
        text-transform: none;
        letter-spacing: 0;
        color: var(--muted);
        margin: 0 0.2rem 0 0;
    }

    .data-table--stack-md.data-table--targets .col-delete::before {
        display: none;
    }

    .data-table--stack-md td.col-form .inline-form,
    .layout-admin .data-table--stack-md .inline-form {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .data-table--stack-md td.col-form .inline-form input[type="text"],
    .data-table--stack-md td.col-form .inline-form input[type="password"],
    .data-table--stack-md td.col-form .inline-form input[type="url"],
    .data-table--stack-md td.col-form .inline-form input[type="search"] {
        width: 100%;
        max-width: none;
        box-sizing: border-box;
    }

    .data-table--stack-md td.col-form .inline-form .btn,
    .data-table--stack-md td.col-delete .btn,
    .data-table--stack-md td.col-actions .btn,
    .data-table--stack-md.secrets-table td.col-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 2.5rem;
    }

    .data-table--stack-md td.col-form .inline-form .inline {
        width: 100%;
    }

    .data-table--stack-md.secrets-table input[type="text"] {
        width: 100%;
        min-width: 0;
    }

    .layout-admin #secrets-form > p {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .layout-admin #secrets-form > p .btn {
        width: 100%;
        justify-content: center;
    }

    .detail-row {
        flex-direction: column;
    }

    .detail-img {
        width: 100%;
        max-width: 8rem;
        height: auto;
        aspect-ratio: 1;
    }

    .log-page-header-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-content {
        padding: 1rem 0.75rem 2rem;
    }

    .admin-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0;
        padding: 0.5rem 0;
    }

    .admin-nav a {
        padding: 0.5rem 0.85rem;
        font-size: 0.88rem;
    }

    .admin-brand {
        width: 100%;
        padding-bottom: 0.5rem;
        margin-bottom: 0.25rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .page-head .btn,
    .head-actions {
        flex-wrap: wrap;
    }

    .log-card-head .btn {
        width: 100%;
        justify-content: center;
    }

    .pre-block--log {
        max-height: min(360px, 50vh);
        font-size: 0.78rem;
    }
}

@media (max-width: 400px) {
    .stat-pill-num {
        font-size: 1.05rem;
    }

    .stat-pill-lbl {
        font-size: 0.58rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 2.75rem;
    }

    .btn-small {
        min-height: 2.35rem;
        padding: 0.4rem 0.65rem;
    }

    .history-row,
    .data-table--stack-md tbody tr.history-row {
        -webkit-tap-highlight-color: rgba(30, 77, 140, 0.12);
    }
}

.issue-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.issue-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.issue-error { border-left: 3px solid var(--err); padding-left: 0.75rem; }
.issue-warning { border-left: 3px solid #c9a100; padding-left: 0.75rem; }

.breadcrumb {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.head-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.token-box {
    word-break: break-all;
    background: #1e2430;
    color: #a8e6cf;
    padding: 1rem;
    border-radius: 6px;
}

form.inline {
    display: inline;
}

.inline form {
    display: inline;
}
