:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --ink: #1c2530;
    --muted: #6b7684;
    --line: #e2e6eb;
    --accent: #2f6fed;
    --error: #c0392b;
    --warning: #b9770e;
    --notice: #2c7a7b;
    --ok: #2e7d32;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

a { color: var(--accent); }

html { scroll-padding-top: 3.5rem; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--ink);
    color: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
}
.topbar-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: .8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: .4rem 1rem;
    flex-wrap: wrap;
}
.topbar .brand {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.15rem;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}
.topbar .brand img { display: block; border-radius: 50%; }
.topbar .tagline { color: #aeb8c4; font-size: .95rem; }

.breadcrumb {
    min-width: 0;
    font-size: 1rem;
    color: #aeb8c4;
    display: flex;
    align-items: baseline;
    gap: .4rem;
    overflow: hidden;
    white-space: nowrap;
}
.breadcrumb a { color: #cfd8e3; text-decoration: none; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }
.breadcrumb .sep { color: #6b7684; }
.breadcrumb .current { color: #fff; overflow: hidden; text-overflow: ellipsis; }

.topbar-user {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: .8rem;
    font-size: .9rem;
    color: #aeb8c4;
    white-space: nowrap;
}
.topbar-user-name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; }
.topbar-user a { color: #cfd8e3; text-decoration: none; }
.topbar-user a:hover { color: #fff; text-decoration: underline; }

/* Einstellungen: Unterpunkte beim Hover/Fokus (nur Admin); der Link zur Seite bleibt als Touch-Fallback */
.topbar-menu { position: relative; }
.topbar-menu-list {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 20;
    margin: 0;
    padding: .3rem 0;
    min-width: 11rem;
    list-style: none;
    background: #1f2933;
    border: 1px solid #3a4654;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.topbar-menu:hover .topbar-menu-list,
.topbar-menu:focus-within .topbar-menu-list { display: block; }
.topbar-menu-list a { display: block; padding: .35rem .9rem; }
.topbar-menu-list a:hover { background: #2c3947; text-decoration: none; }

.login-card { max-width: 26rem; margin: 3rem auto; }

.impersonation-banner {
    background: #fff4e0;
    color: #8a5300;
    border-bottom: 1px solid #f0d7a8;
    padding: .55rem 1.5rem;
    text-align: center;
    font-size: .92rem;
}
.impersonation-banner a { font-weight: 600; margin-left: .5rem; }

.container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 1.5rem;
}

footer.container { padding-top: .5rem; padding-bottom: 3rem; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.card-head h1, .card-head h2 { margin-bottom: .4rem; }
.btn-link { font-size: .9rem; font-weight: 600; }
.card-head-links { display: inline-flex; flex-wrap: wrap; gap: .4rem 1.2rem; }

/* ---- Project dashboard ---- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.project-group { margin-top: 1.75rem; }
.project-group-head {
    padding-bottom: .3rem;
    border-bottom: 1px solid var(--line);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.project-group-head::-webkit-details-marker { display: none; }
.project-group-head::before {
    content: '▸';
    display: inline-block;
    width: 1em;
    color: var(--muted);
    transition: transform .15s;
}
.project-group[open] > .project-group-head::before { transform: rotate(90deg); }
.project-group-head .small { font-weight: normal; margin-left: .35rem; }
.project-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.project-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.project-card-name { display: flex; align-items: center; gap: .5rem; min-width: 0; }

/* ---- Projekt-Avatar (Favicon oder Monogramm) ---- */
.avatar {
    flex: none;
    display: inline-block;
    vertical-align: middle;
    border-radius: 5px;
    object-fit: contain;
}
.avatar-monogram {
    --avatar-size: 24px;
    width: var(--avatar-size);
    height: var(--avatar-size);
    line-height: var(--avatar-size);
    font-size: calc(var(--avatar-size) * .42);
    font-weight: 700;
    text-align: center;
    letter-spacing: -.02em;
    color: #fff;
    background: hsl(var(--avatar-hue, 210) 45% 45%);
    user-select: none;
}
.title-with-avatar { display: flex; align-items: center; gap: .6rem; }
.title-with-avatar h1 { margin: 0; }
td .avatar { margin-right: .35rem; }
.favicon-refresh { margin-top: .8rem; }
.video-table td, .image-table td { vertical-align: top; }
.dup-summary { margin: .6rem 0; display: flex; flex-direction: column; gap: .15rem; }
.sd-score { margin: .8rem 0 .4rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px; }
.sd-score-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.sd-score-parts { font-size: .88rem; }
.sd-score-parts th { font-weight: 600; white-space: nowrap; width: 1%; padding-right: .8rem; }
.sd-score-parts td, .sd-score-parts th { padding: .25rem .4rem; }
.sd-rich { margin: .4rem 0 0; }
.social-preview { border: 1px solid var(--line); border-radius: 8px; padding: .7rem .9rem; margin: .6rem 0; max-width: 34rem; }
.social-site { font-size: .72rem; letter-spacing: .04em; color: var(--muted, #667); }
.social-title { font-weight: 600; margin: .15rem 0; }
.social-desc { font-size: .9rem; margin-bottom: .3rem; }
.sd-entity { border: 1px solid var(--line); border-radius: 6px; padding: .5rem .7rem; margin: .6rem 0; }
.sd-entity.sd-incomplete, .sd-entity.sd-invalid { border-color: color-mix(in srgb, var(--error) 45%, var(--line)); }
.sd-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .5rem; }
.sd-type { font-size: .98rem; }
.sd-ok { color: var(--ok); }
.sd-fields { margin-top: .4rem; }
.sd-raw pre { max-height: 22rem; overflow: auto; background: var(--bg); padding: .6rem; border-radius: 6px; font-size: .78rem; }
.sd-test { margin: .3rem 0 1rem; display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; }
table.depth-distribution { margin: .6rem 0; max-width: 30rem; font-size: .88rem; }
table.depth-distribution td, table.depth-distribution th { padding: .2rem .5rem; }
.depth-bar-cell { width: 45%; }
.depth-bar { display: block; height: .55rem; border-radius: 3px; background: var(--accent); opacity: .55; }
tr.sev-notice .depth-bar { background: var(--notice); opacity: .8; }
tr.sev-warning .depth-bar { background: var(--warning); opacity: .8; }
.page-tag {
    display: inline-block;
    margin-left: .35rem;
    padding: 0 .4rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: .72rem;
    color: var(--muted);
    vertical-align: middle;
}
.page-tag-orphan { border-color: var(--warning); color: var(--warning); font-weight: 600; }
.page-tag-error { border-color: var(--error); color: var(--error); font-weight: 600; }
.page-tag-warning { border-color: var(--warning); color: var(--warning); }
.page-tag-notice { border-color: var(--notice); color: var(--notice); }

/* ---- Seitentabelle ---- */
.table-tools { display: flex; gap: .5rem; margin: .4rem 0 .2rem; max-width: 32rem; }
.table-tools input[type=search] {
    flex: 1 1 auto;
    min-width: 0;
    padding: .4rem .6rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}
.page-table { margin-top: .6rem; }
.page-table .page-path { font-weight: 600; text-decoration: none; }
.page-table a.page-path:hover { text-decoration: underline; }
.page-title { color: var(--muted); font-size: .82rem; margin-top: .1rem; }
.sort-head { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-head:hover, .sort-head.is-active { color: var(--accent); }
.findings-cell { white-space: nowrap; }
.findings-cell .pill { margin-left: .15rem; }
.pill-notice { background: #e6f3f3; color: var(--notice); }
.schema-tags { font-size: .75rem; }
.schema-tag {
    display: inline-block;
    margin: 0 .2rem .2rem 0;
    padding: 0 .4rem;
    border-radius: 4px;
    background: color-mix(in srgb, var(--accent) 9%, var(--card));
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}
.schema-tag.is-inline { background: var(--bg); color: var(--muted); }
.schema-tag:hover { outline: 1px solid var(--accent); }
.pagination { display: flex; flex-direction: column; align-items: center; gap: .45rem; margin: .9rem 0; }
.per-page { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem; margin-top: .8rem; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; margin: 0; padding: 0; list-style: none; }
.pager li { margin: 0 0 0 -1px; }
.pager a, .pager span {
    display: block;
    min-width: 2.4rem;
    padding: .45rem .8rem;
    border: 1px solid var(--line);
    background: var(--card);
    text-align: center;
    text-decoration: none;
    line-height: 1.2;
}
.pager li:first-child a, .pager li:first-child span { border-radius: 6px 0 0 6px; }
.pager li:last-child a, .pager li:last-child span { border-radius: 0 6px 6px 0; }
.pager a:hover { background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.pager .is-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; position: relative; }
.pager .is-gap { color: var(--muted); }
.video-table .hpath, .image-table .hpath { margin: .15rem 0 0; }
.nowrap { white-space: nowrap; }
.project-card-title { font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.check-badges { display: inline-flex; flex-wrap: wrap; gap: .25rem; margin-top: .15rem; cursor: help; }
.check-badge {
    display: inline-block;
    padding: .05rem .45rem;
    border-radius: 999px;
    font-size: .75rem;
    line-height: 1.5;
    white-space: nowrap;
    border: 1px solid var(--line);
    color: var(--ink);
    background: var(--card);
}
.check-badge.full { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.check-badge.part { border-style: dashed; }
td .check-badges { margin-top: 0; }
.project-card-status { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-top: .2rem; }
.project-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    margin-top: auto;
    padding-top: .6rem;
}
.project-card-actions button { padding: .4rem .8rem; font-size: .9rem; }
button:disabled { background: var(--line); color: var(--muted); cursor: default; }
.project-card-actions a { text-decoration: none; white-space: nowrap; }
.btn-secondary {
    display: inline-block;
    padding: .4rem .8rem;
    font-size: .9rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--line);
    color: var(--ink);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
/* Dieselbe Optik für Knöpfe (Formular-Submit) und Links; Vorrang vor dem globalen Primär-Knopf. */
button.btn-secondary { background: transparent; cursor: pointer; font-family: inherit; padding: .4rem .8rem; }
button.btn-secondary:hover { filter: none; }
.btn-primary {
    display: inline-block;
    padding: .4rem .8rem;
    font-size: .9rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}
.btn-primary:hover { filter: brightness(1.08); color: #fff; }
.btn-compact { padding: .25rem .6rem; font-size: .85rem; text-decoration: none; white-space: nowrap; }

.delta { font-size: .8rem; font-weight: 700; white-space: nowrap; }
.delta-down { color: var(--ok); }
.delta-up { color: var(--error); }

/* ---- Findings trend ---- */
.trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 130px;
    padding-top: .5rem;
    border-bottom: 1px solid var(--line);
}
.trend-col {
    flex: 1 1 0;
    min-width: 5px;
    max-width: 32px;
    height: 100%;
    display: flex;
    align-items: flex-end;
}
.trend-bar {
    width: 100%;
    min-height: 2px;
    display: flex;
    flex-direction: column-reverse;
    background: var(--line);
    border-radius: 2px 2px 0 0;
    overflow: hidden;
}
.trend-bar .seg { display: block; width: 100%; }
.trend-bar .seg-error { background: var(--error); }
.trend-bar .seg-warning { background: var(--warning); }
.trend-bar .seg-notice { background: var(--notice); }
.trend-col:hover .trend-bar { outline: 2px solid var(--accent); outline-offset: 1px; }

.trend-axis {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    font-size: .75rem;
    color: var(--muted);
    margin-top: .35rem;
}
.dot {
    display: inline-block;
    width: .6rem;
    height: .6rem;
    border-radius: 2px;
    vertical-align: middle;
    margin: 0 .1rem 0 .5rem;
}
.dot-error { background: var(--error); }
.dot-warning { background: var(--warning); }
.dot-notice { background: var(--notice); }

h1 { font-size: 1.4rem; margin: 0 0 .8rem; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.break { word-break: break-word; overflow-wrap: anywhere; }

/* ---- Forms ---- */
.scan-form label { display: block; margin-bottom: .8rem; font-weight: 600; }
/* hidden-Attribut gewinnt gegen display-Regeln wie die obige (sonst bleibt z. B. „Name der neuen Gruppe“ sichtbar) */
[hidden] { display: none !important; }
/* Zwei Formularfelder nebeneinander, auf schmalen Bildschirmen untereinander */
.scan-form .field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 .8rem;
    align-items: end;
}
@media (max-width: 600px) {
    .scan-form .field-row { grid-template-columns: 1fr; }
}
.scan-form input[type=text],
.scan-form input[type=number],
.scan-form textarea {
    display: block;
    width: 100%;
    margin-top: .3rem;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    font-weight: 400;
}
.scan-form select {
    display: block;
    width: 100%;
    margin-top: .3rem;
    padding: .5rem .6rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--card);
    font: inherit;
    font-weight: 400;
}
.scan-form textarea { resize: vertical; }
.scan-form textarea[name="exclude_patterns"] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; }
.scan-form label.full { margin-top: 1rem; }
.scan-comment { white-space: pre-wrap; word-break: break-word; }

table.kv { margin-top: .5rem; font-size: .82rem; }
table.kv th { text-align: left; white-space: nowrap; vertical-align: top; padding-right: 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
table.kv td { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.scan-form .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .8rem;
    margin-top: .8rem;
}
.scan-form label.checkbox { font-weight: 400; display: flex; align-items: center; gap: .4rem; }
.scan-form label.checkbox input { width: auto; margin: 0; }
.scan-form details { margin-bottom: 1rem; }
.scan-form summary { cursor: pointer; color: var(--accent); }
.scan-form fieldset.checks {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: .5rem .9rem .9rem;
    margin: 0 0 1rem;
}
.checks-profiles { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; margin: .2rem 0 .6rem; }
button.chip { font: inherit; font-size: .82rem; font-weight: 400; line-height: inherit; cursor: pointer; }
button.chip:hover { filter: none; }
.checks-toolbar { display: flex; justify-content: flex-end; align-items: baseline; gap: .8rem; margin-bottom: .5rem; }
.check-groups {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .7rem;
}
.check-group {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: .5rem .7rem .6rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.check-group.is-off { background: var(--bg); }
.check-group-head { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .1rem; }
.check-group-title { font-weight: 600; font-size: .92rem; }
.check-group-head .link-button { margin-left: auto; }
.link-button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--accent);
    font: inherit;
    font-size: .85rem;
    font-weight: 400;
    cursor: pointer;
}
.link-button:hover { text-decoration: underline; filter: none; }
.scan-form fieldset.checks legend { font-weight: 600; padding: 0 .3rem; }
.scan-form fieldset.auth { border: 1px solid var(--line); border-radius: 6px; padding: .6rem .9rem .3rem; margin: 1rem 0 0; }
.scan-form fieldset.auth legend { font-weight: 600; padding: 0 .3rem; }
.scan-form fieldset.auth .grid { margin-top: .3rem; }
.scan-form input[type=password] {
    display: block;
    width: 100%;
    margin-top: .3rem;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    font-weight: 400;
}

button {
    font: inherit;
    font-weight: 600;
    padding: .55rem 1.1rem;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}
button.danger { background: var(--error); }
button:hover { filter: brightness(1.05); }
button.btn-small { padding: .35rem .7rem; font-size: .85rem; }

/* ---- Einzeilige Formulare (Kunden, Agenturen, Benutzer) ---- */
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.inline-form input[type=text],
.inline-form input[type=email],
.inline-form input[type=password],
.inline-form select {
    flex: 1 1 14rem;
    min-width: 0;
    padding: .45rem .65rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}
.group-table td { vertical-align: middle; }
.inline-form label.checkbox { display: inline-flex; align-items: center; gap: .3rem; font-size: .9rem; }
.admin-table td { vertical-align: middle; }

/* Tabellen mit vielen Textspalten (Audit-Log, Mail-Log): feste Spaltenbreiten. Mit automatischem Layout schrumpfen
   Spalten mit `.break` (overflow-wrap: anywhere) auf Zeichenbreite und die `nowrap`-Spalten nehmen sich den Platz.
   Auf schmalen Bildschirmen scrollt die Tabelle waagerecht, statt zusammengequetscht zu werden. */
.table-scroll { overflow-x: auto; }
.fixed-table { table-layout: fixed; min-width: 56rem; }
.fixed-table td { vertical-align: top; }
.audit-table th:nth-child(1) { width: 8.75rem; }
.audit-table th:nth-child(2) { width: 11rem; }
.audit-table th:nth-child(3) { width: 9.5rem; }
.audit-table th:nth-child(4) { width: 12rem; }
.audit-detail + .audit-detail { margin-top: .15rem; }
.mail-log-table th:nth-child(1) { width: 8.75rem; }
.mail-log-table th:nth-child(2) { width: 7.5rem; }
.mail-log-table th:nth-child(3) { width: 13rem; }
.mail-log-table th:nth-child(5) { width: 8.5rem; }
.mail-log-table th:nth-child(6) { width: 10rem; }
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .3rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--accent);
    line-height: 0;
}
.icon-btn:hover { border-color: var(--accent); }
button.icon-btn { background: transparent; cursor: pointer; font: inherit; }
button.icon-btn:hover { background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.icon-btn.is-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.icon-btn.is-primary:hover { background: var(--accent); filter: brightness(1.1); }
.icon-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.icon-actions .inline-form { margin: 0; }
.btn-with-icon { display: inline-flex; align-items: center; gap: .35rem; }
.badge-icon { display: inline-flex; align-items: center; gap: .25rem; }
.admin-table .inline-form select { flex: 0 1 auto; }
.limits-form label { display: inline-flex; flex-direction: column; font-size: .78rem; color: var(--muted); }
.limits-form input[type=number] { width: 5.5rem; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .88rem; }
.stack-form { display: grid; gap: .6rem; max-width: 34rem; }
.stack-form label { display: grid; gap: .2rem; font-weight: 600; }
.stack-form label.checkbox { display: flex; align-items: center; gap: .4rem; font-weight: 400; }
.stack-form input[type=text], .stack-form input[type=email], .stack-form input[type=password], .stack-form select {
    padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-weight: 400;
}
.stack-form button { justify-self: start; }
.client-domains { margin: -.4rem 0 .8rem; }
.link-card { border-left: 4px solid var(--accent); }
.link-card .link-url { width: 100%; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.has-issues td { background: #fff9f4; }

/* ---- Badges / pills ---- */
.badge, .pill, .tag {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.5;
}
.badge-queued  { background: #eef1f5; color: var(--muted); }
.badge-running { background: #e5efff; color: var(--accent); }
.badge-done    { background: #e6f4ea; color: var(--ok); }
.badge-failed  { background: #fdecea; color: var(--error); }
.scan-progress {
    margin: .4rem 0 1rem;
    padding: .7rem .9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
}
.progress-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; margin-bottom: .45rem; }
.progress-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .45rem; }
.progress-foot form { margin: 0; }
.cancel-form { margin: 0; }
.scan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; }
.progress-bar {
    height: .6rem;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
}
.progress-bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 999px;
    transition: width .6s ease;
}
.progress-bar-small { height: .35rem; margin-top: .3rem; }
.eta { color: var(--accent); font-weight: 600; white-space: nowrap; }
.badge-cancelled { background: #fdf3e1; color: var(--warning); }

.pill-error   { background: #fdecea; color: var(--error); }
.pill-warning { background: #fdf3e2; color: var(--warning); }

.tag-error   { background: #fdecea; color: var(--error); }
.tag-warning { background: #fdf3e2; color: var(--warning); }
.tag-notice  { background: #e3f2f1; color: var(--notice); }
.tag-ok      { background: #e6f4ea; color: var(--ok); }

/* ---- Flash ---- */
.flash { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash-success { background: #e6f4ea; color: var(--ok); }
.flash-error   { background: #fdecea; color: var(--error); }
.flash-warning { background: #fff4e0; color: #8a5300; }

/* ---- Stats ---- */
.stats { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 1rem 0; }
.stats > * { display: flex; flex-direction: column; }
.stats a { text-decoration: none; color: inherit; }
.stats a:hover strong { text-decoration: underline; }
.stats strong { font-size: 1.6rem; }
.stats span { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.sev-error strong   { color: var(--error); }
.sev-warning strong { color: var(--warning); }
.sev-notice strong  { color: var(--notice); }
.sev-error { color: var(--error); }

.stats .stat-score { border-radius: 8px; padding: .3rem .8rem .4rem; margin: -.3rem .5rem -.4rem -.3rem; }
.stats .stat-score strong { font-size: 1.9rem; }
.stat-score.score-gruen { background: #e6f4ea; } .stat-score.score-gruen strong { color: var(--ok); }
.stat-score.score-gelb  { background: #fdf3e2; } .stat-score.score-gelb strong  { color: var(--warning); }
.stat-score.score-rot   { background: #fdecea; } .stat-score.score-rot strong   { color: var(--error); }

/* ---- Score-Badge ---- */
.score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2em;
    padding: .1rem .45rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}
.score-gruen { background: #e6f4ea; color: var(--ok); }
.score-gelb  { background: #fdf3e2; color: var(--warning); }
.score-rot   { background: #fdecea; color: var(--error); }
.score-none  { background: var(--line); color: var(--muted); font-weight: 400; }

/* ---- Heading tree ---- */
.heading-tree { font-size: .95rem; }
.htree-row {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    padding: .3rem 0;
    padding-left: calc(var(--lvl, 0) * 1.6rem);
    border-bottom: 1px dashed var(--line);
}
.htag {
    flex: none;
    font-size: .72rem;
    font-weight: 700;
    padding: .05rem .4rem;
    border-radius: 4px;
    background: #eef1f5;
    color: var(--muted);
}
.htag-1 { background: var(--ink); color: #fff; }
.htag-2 { background: #cfe0ff; color: #1b3a6b; }
.htag-jump { outline: 2px solid var(--error); }
.htext-empty { color: var(--error); font-style: italic; }
.hpath { color: var(--muted); font-size: .75rem; margin-left: auto; }

.htree-issue {
    padding: .3rem 0 .4rem;
    padding-left: calc(var(--lvl, 0) * 1.6rem + 1.5rem);
    font-size: .88rem;
}

/* ---- Filterbar / Chips ---- */
.filter-groups { display: flex; flex-direction: column; gap: .35rem; margin-top: .4rem; }
.filter-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; }
.chip.chip-category { font-weight: 600; }
.category-head { margin: 1.6rem 0 .6rem; font-size: 1.15rem; }
.check-head { margin: 0 0 .6rem; font-size: 1.02rem; }
table.category-breakdown { margin: .9rem 0 .4rem; max-width: 36rem; }
table.category-breakdown a { text-decoration: none; font-weight: 600; }
.filterbar { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; margin-top: .7rem; }
.filterbar-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-right: .3rem; }
.chip {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    font-size: .82rem;
    text-decoration: none;
    color: var(--ink);
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-error.on   { background: var(--error); border-color: var(--error); }
.chip-warning.on { background: var(--warning); border-color: var(--warning); }
.chip-notice.on  { background: var(--notice); border-color: var(--notice); }

/* ---- Issue list ---- */
.issue-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.issue-list:last-child { margin-bottom: 0; }
.issue { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.issue:last-child { border-bottom: 0; }
.issue-group {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin: 1rem 0 .3rem;
}
.issue-group:first-child { margin-top: 0; }
.issue-category {
    font-size: 1rem;
    margin: 1.4rem 0 0;
    padding-top: .8rem;
    border-top: 1px solid var(--line);
}
h2 + .issue-category { margin-top: .4rem; padding-top: 0; border-top: 0; }
.issue-category + .issue-group { margin-top: .5rem; }
.issue-detail {
    margin: .35rem 0 0;
    padding-left: 1.2rem;
    font-size: .82rem;
    color: var(--muted);
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Vorher/Nachher-Vergleich einer Einzelseiten-Prüfung */
.comparison { margin: 1rem 0; }
.comparison h2 { margin-bottom: .2rem; }
.comparison h3 { margin: .8rem 0 .3rem; font-size: 1rem; }
.comparison-list { margin: .2rem 0 .6rem; padding-left: 1.1rem; }
.comparison-list li { margin: .25rem 0; }
.comparison-resolved { list-style-type: "✓ "; }
.comparison-added { list-style-type: "+ "; }
.llms-txt summary, .robots-txt summary { cursor: pointer; }
.llms-txt pre, .robots-txt pre { max-height: 24rem; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--bg); padding: .6rem; border-radius: 6px; font-size: .78rem; }
