/* Admin-Bereich – creativestyle-Tokens, eigenes (custom) Layout. */
:root {
    --a-ink: var(--foreground, #1a1b1f);
    --a-bg: var(--background, #fff);
    --a-muted: var(--muted, #f3f3f3);
    --a-muted-fg: var(--muted-foreground, #6a6a6a);
    --a-red: var(--brand-red, #d81316);
    --a-hair: color-mix(in srgb, var(--foreground, #1a1b1f) 12%, transparent);
    --a-radius: 12px;
}

.a-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }
@media (max-width: 760px) { .a-shell { grid-template-columns: 1fr; } }

/* Sidebar */
.a-side { background: var(--a-ink); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100dvh; }
.a-side .a-brand { display: flex; align-items: center; gap: 8px; padding: 6px 10px 18px; }
.a-side .a-brand img { height: 22px; }
.a-side .a-brand .tag { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, #fff 60%, transparent); }
.a-nav { display: flex; flex-direction: column; gap: 2px; }
.a-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: color-mix(in srgb, #fff 82%, transparent); text-decoration: none; font-size: 14px; font-weight: 500; }
.a-nav a:hover { background: color-mix(in srgb, #fff 9%, transparent); color: #fff; }
.a-nav a.active { background: #fff; color: var(--a-ink); font-weight: 700; }
.a-nav .a-soon { padding: 10px 12px; font-size: 14px; color: color-mix(in srgb, #fff 38%, transparent); }
.a-side-foot { margin-top: auto; border-top: 1px solid color-mix(in srgb, #fff 14%, transparent); padding-top: 14px; font-size: 12.5px; color: color-mix(in srgb, #fff 60%, transparent); }
.a-side-foot a { color: #fff; }

/* Main */
.a-main { min-width: 0; }
.a-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 32px; border-bottom: 1px solid var(--a-hair); position: sticky; top: 0; background: color-mix(in srgb, var(--a-bg) 88%, transparent); backdrop-filter: blur(8px); z-index: 10; }
.a-topbar h1 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.a-topbar .a-user { font-size: 13px; color: var(--a-muted-fg); display: flex; align-items: center; gap: 14px; }
.a-content { padding: 28px 32px 64px; }
@media (max-width: 760px) { .a-topbar, .a-content { padding-left: 18px; padding-right: 18px; } }

/* Karten / Stats */
.a-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .a-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .a-cards { grid-template-columns: 1fr; } }
.a-card { background: var(--a-muted); border-radius: var(--a-radius); padding: 22px; }
.a-card .num { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.a-card .num.red { color: var(--a-red); }
.a-card .lbl { font-size: 13px; color: var(--a-muted-fg); margin-top: 8px; }

/* Buttons (DS-Primary, Slide-up) */
.a-btn { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 8px; overflow: hidden; height: 44px; padding: 0 22px; border-radius: 10px; border: 2px solid var(--a-ink); background: var(--a-ink); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; transition: color .3s; }
.a-btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--a-bg); transform: translateY(100%); transition: transform .3s ease-out; }
.a-btn:hover { color: var(--a-ink); }
.a-btn:hover::before { transform: translateY(0); }
.a-btn.ghost { background: transparent; color: var(--a-ink); border-color: var(--a-hair); }
.a-btn.ghost::before { display: none; }
.a-btn.ghost:hover { background: var(--a-muted); }

/* Login */
.a-login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--a-muted); }
.a-login-card { width: 100%; max-width: 400px; background: var(--a-bg); border-radius: 18px; padding: 34px; box-shadow: 0 30px 70px -44px rgba(10,10,10,.3); }
.a-login-card img { height: 24px; margin-bottom: 22px; }
.a-login-card h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.a-login-card p.sub { color: var(--a-muted-fg); font-size: 14px; margin: 0 0 22px; }
.a-field { display: grid; gap: 6px; margin-bottom: 16px; }
.a-field label { font-size: 13px; font-weight: 600; }
.a-field input { height: 46px; border: 1px solid var(--a-hair); border-radius: 10px; padding: 0 14px; font: inherit; font-size: 15px; outline: none; transition: border-color .15s; }
.a-field input:focus { border-color: var(--a-ink); border-width: 2px; }
.a-alert { background: color-mix(in srgb, var(--a-red) 10%, transparent); color: var(--a-red); border-radius: 10px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 16px; }

/* Allgemein */
.a-muted { color: var(--a-muted-fg); }
.a-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.a-flash { border-radius: 10px; padding: 12px 16px; font-size: 14px; margin-bottom: 16px; }
.a-flash.success { background: color-mix(in srgb, #0d8a4a 12%, transparent); color: #0a6e3a; }
.a-flash.error { background: color-mix(in srgb, var(--a-red) 12%, transparent); color: var(--a-red); }
.a-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.a-badge.her { background: var(--a-muted); color: var(--a-ink); }
.a-badge.gh { background: color-mix(in srgb, var(--a-red) 12%, transparent); color: var(--a-red); }
/* Zustands-Badges der Erkenntnis-Übersicht */
.a-zustand { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.a-badge--live { background: color-mix(in srgb, #1a7f37 15%, transparent); color: #1a7f37; }
.a-badge--draft { background: color-mix(in srgb, #b45309 16%, transparent); color: #9a5000; }
.a-badge--proposed { background: color-mix(in srgb, #0b6bcb 14%, transparent); color: #0b6bcb; }
.a-badge--rejected { background: var(--a-muted); color: var(--a-muted-fg); }
.a-badge--regen { background: color-mix(in srgb, var(--a-red) 12%, transparent); color: var(--a-red); }
.a-badge--lock { background: var(--a-muted); color: var(--a-muted-fg); }
.a-status { font-size: 12px; font-weight: 600; }
.a-status.live { color: #0a6e3a; }
.a-status.draft { color: var(--a-muted-fg); }
.a-status.arch { color: #8a6d00; }

.a-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.a-filter form { display: flex; align-items: center; }
.a-pill { border: 1px solid var(--a-hair); border-radius: 999px; padding: 7px 14px; font-size: 13px; text-decoration: none; color: var(--a-ink); }
.a-pill:hover { background: var(--a-muted); }
.a-pill.active { background: var(--a-ink); color: #fff; border-color: var(--a-ink); }
/* Select als Pill — gleiche Geometrie wie .a-pill, eigener Chevron. */
.a-pill-select { appearance: none; cursor: pointer; height: 33px; border: 1px solid var(--a-hair); border-radius: 999px; padding: 0 32px 0 14px; font: inherit; font-size: 13px; color: var(--a-ink); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%231a1b1f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 13px center / 10px; }
.a-pill-select:hover { background-color: var(--a-muted); }
.a-pill-select:focus-visible { outline: 2px solid var(--a-ink); outline-offset: 1px; }
.a-pill-select.active { background-color: var(--a-ink); color: #fff; border-color: var(--a-ink); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
/* Aufgeklapptes Menü nicht vom dunklen Aktiv-Grund erben lassen. */
.a-pill-select option { color: var(--a-ink); background-color: #fff; }

/* Tabelle */
.a-tablewrap { border: 1px solid var(--a-hair); border-radius: var(--a-radius); overflow-x: auto; }
.a-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.a-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--a-muted-fg); font-weight: 600; padding: 12px 14px; background: var(--a-muted); }
.a-table td { padding: 12px 14px; border-top: 1px solid var(--a-hair); }
.a-table td.nm { font-weight: 700; }
.a-table .num { text-align: right; }
.a-table tbody tr:hover td { background: color-mix(in srgb, var(--a-ink) 3%, transparent); }
.a-table .actions { text-align: right; white-space: nowrap; }
.a-table .actions a { color: var(--a-ink); font-weight: 600; text-decoration: none; margin-left: 14px; border-bottom: 2px solid color-mix(in srgb, var(--a-red) 35%, transparent); }
.a-table .actions a:hover { border-color: var(--a-red); }
.a-inline-form { display: inline; }
.a-link-btn { background: none; border: none; padding: 0; margin-left: 14px; font: inherit; font-weight: 600; color: var(--a-ink); cursor: pointer; border-bottom: 2px solid color-mix(in srgb, var(--a-red) 35%, transparent); }
.a-link-btn:hover { border-color: var(--a-red); }
.a-link-btn.danger { color: #b22; border-bottom-color: color-mix(in srgb, #b22 35%, transparent); }
.a-link-danger { background: none; border: 0; padding: 0; margin-left: 14px; font: inherit; font-weight: 600; color: var(--a-red); cursor: pointer; border-bottom: 2px solid color-mix(in srgb, var(--a-red) 35%, transparent); }
.a-link-danger:hover { border-color: var(--a-red); }
.a-form textarea { border: 1px solid var(--a-hair); border-radius: 10px; padding: 12px 14px; font: inherit; font-size: 15px; outline: none; min-height: 120px; resize: vertical; }
.a-form textarea:focus { border-color: var(--a-ink); }

/* Formular */
.a-form { max-width: 760px; }
/* Breite Variante: Formulare mit tabellenartigen Editoren (Kennzahl-Balken,
   belegte Fälle) brauchen mehr als 760px, sonst überlappen die Spalten. */
.a-form--wide { max-width: 980px; }
.a-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .a-form-grid { grid-template-columns: 1fr; } }
.a-form .a-field { display: grid; gap: 6px; margin: 0; }
.a-form .a-field label { font-size: 13px; font-weight: 600; }
/* `min-width: 0`: ein Input im Grid schrumpft sonst nie unter seine
   Standard-Zeichenbreite (~240px) und sprengt auf schmalen Breiten das
   `max-width` seines Feldes. */
.a-form .a-field input, .a-form .a-field select { min-width: 0; height: 44px; border: 1px solid var(--a-hair); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 15px; background: var(--a-bg); outline: none; transition: border-color .15s; }
.a-form .a-field input:focus, .a-form .a-field select:focus { border-color: var(--a-ink); border-width: 2px; }
.a-form .a-field.has-err input, .a-form .a-field.has-err select { border-color: var(--a-red); }
.a-err { color: var(--a-red); font-size: 12.5px; }
.a-sep { border: 0; border-top: 1px solid var(--a-hair); margin: 28px 0 20px; }
.a-subhead { font-size: 15px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 14px; }
.a-form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 28px; }

/* Kernaussagen im Profilkopf: Art + Satz in einer Zeile, damit die drei
   Aussagen als Block lesbar bleiben (Reihenfolge = Reihenfolge im Profil). */
.a-kernaussagen { display: grid; gap: 10px; max-width: 860px; }
.a-kernaussage { grid-template-columns: 190px minmax(0, 1fr); gap: 10px; align-items: center; }
@media (max-width: 620px) { .a-kernaussage { grid-template-columns: 1fr; } }
.a-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Inline-Checkbox (Label + Box in einer Zeile) — nicht in .a-field packen,
   sonst greift die input-Box-Formatierung oben. */
.a-check { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 500; color: var(--a-ink); cursor: pointer; margin-top: 8px; }
.a-check input[type="checkbox"] { width: auto; height: auto; margin: 0; flex: 0 0 auto; }
/* Feld-Hinweis + Hilfeblock */
/* Pflichtfeld-Sternchen am Label. */
.a-req { color: var(--a-red); font-weight: 700; }
.a-fieldhint { font-size: 12.5px; color: var(--a-muted-fg); margin: 6px 0 0; max-width: 70ch; }
.a-fieldhint code { font-size: 12px; }
.a-help { background: var(--a-muted); border-radius: 10px; padding: 14px 16px; margin-bottom: 26px; font-size: 13px; max-width: 760px; }
.a-help > summary { cursor: pointer; font-weight: 700; list-style-position: inside; }
.a-help[open] > summary { margin-bottom: 10px; }
.a-help p { margin: 0 0 8px; color: var(--a-muted-fg); max-width: 74ch; }
.a-help p:last-child { margin-bottom: 0; }
.a-help b { color: var(--a-ink); }
/* Frontend-Vorschau (rendert echte r-*-Markup im Admin) */
.a-preview { border: 1px solid var(--a-hair); border-radius: 12px; padding: 4px 22px 20px; background: var(--a-bg); max-width: 760px; }
.a-preview-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--a-muted-fg); font-weight: 700; padding: 14px 0 2px; }
.a-preview .r-wrap { padding: 0; max-width: none; }
.a-preview .r-dd:first-of-type { border-top: 0; padding-top: 6px; }
/* Zahlen-Platzhalter-Picker */
.a-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; background: var(--a-muted); border-radius: 10px; font-size: 13px; max-width: 760px; }
.a-picker-lbl { font-weight: 600; }
.a-picker select { height: 34px; border: 1px solid var(--a-hair); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; background: var(--a-bg); max-width: 230px; }
.a-picker-val { color: var(--a-muted-fg); }
.a-picker-val strong { color: var(--a-ink); }
.a-picker .a-btn { height: 34px; padding: 0 16px; }
.a-picker-help { margin-top: 6px; }
.a-picker-help > summary { cursor: pointer; font-size: 12.5px; }
/* Frontend-Vorschau der Erkenntnis: das Panel hängt öffentlich an `:target`,
   in der Vorschau ist es immer offen. Die Kachel steht in Kachelbreite daneben,
   damit die Redaktion beide Zustände sieht. */
.a-vorschau-offen .r-panel { display: block; border: 1px solid var(--a-hair); border-radius: 12px; padding: 24px 22px 26px; }
.a-vorschau-kachel { max-width: 340px; margin-bottom: 20px; }
.a-vorschau-offen .r-panel-nav { display: none; }

/* Formular-Abschnitte (Erkenntnis-Formular, #160): ein langes Formular in
   Blöcke, die der Reihenfolge der öffentlichen Darstellung folgen. */
.a-sect { border: 1px solid var(--a-hair); border-radius: 12px; padding: 20px 22px; margin-bottom: 20px; }
.a-sect-h { font-size: 15px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; margin: 0; }
.a-sect-sub { font-size: 12.5px; line-height: 1.5; color: var(--a-muted-fg); margin: 5px 0 18px; max-width: 70ch; }
.a-sub { border-top: 1px solid var(--a-hair); padding-top: 18px; }
.a-row { display: flex; gap: 16px; flex-wrap: wrap; }
.a-warn { font-size: 12.5px; line-height: 1.5; color: var(--a-ink); background: color-mix(in srgb, var(--a-red) 8%, transparent); border-radius: 8px; padding: 8px 11px; margin: 10px 0 0; max-width: 70ch; }

/* Kachelbild: Vorschau links, Upload rechts. */
.a-bild { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: start; }
.a-bild-vorschau { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; border: 1px solid var(--a-hair); border-radius: 10px; background: var(--a-muted); overflow: hidden; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--a-muted-fg); }
.a-bild-vorschau img { width: 100%; height: 100%; object-fit: contain; display: block; }
.a-bild.has-err .a-bild-vorschau { border-color: var(--a-red); }
@media (max-width: 980px) { .a-bild { grid-template-columns: minmax(0, 1fr); } }

/* Kennzahl-Editor: Zeilen aus Selects, mit Werkzeugspalte rechts. */
.a-kz { border-top: 1px solid var(--a-hair); padding-top: 18px; }
.a-kz-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.a-kz-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr) 104px minmax(0, 1.3fr) max-content; gap: 10px; align-items: end; margin-bottom: 10px; }
.a-kz-row .a-field select, .a-kz-row .a-field input { height: 38px; font-size: 13.5px; }
.a-kz-tools { display: flex; align-items: center; gap: 6px; height: 38px; white-space: nowrap; }
.a-kz-tools .a-check { white-space: nowrap; }
.a-kz-add { height: 36px; padding: 0 16px; margin-top: 4px; }
/* Breakpoint großzügig: der Inhaltsbereich ist um die 248px-Seitenleiste
   schmaler als das Fenster. Fünf Spalten brauchen ~900px Inhalt, also erst ab
   ~1150px Fensterbreite — darunter bricht die Zeile um, statt die Selects auf
   unlesbare 50px zu quetschen. */
@media (max-width: 1150px) {
    .a-kz-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .a-kz-row .a-kz-label { grid-column: 1 / -1; }
    .a-kz-tools { grid-column: 1 / -1; height: auto; }
}
.a-icon-btn { flex: 0 0 auto; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--a-hair); border-radius: 8px; background: var(--a-bg); color: var(--a-muted-fg); font: inherit; font-size: 13px; cursor: pointer; transition: border-color .15s, color .15s; }
.a-icon-btn:hover { border-color: var(--a-ink); color: var(--a-ink); }
.a-icon-btn[disabled] { opacity: .35; cursor: default; }
.a-icon-btn[disabled]:hover { border-color: var(--a-hair); color: var(--a-muted-fg); }
.a-icon-btn--del:hover { border-color: var(--a-red); color: var(--a-red); }

/* Belegter Fall: Rolle links farbig markiert (Ampel/Innovation, nie Marken-Rot). */
.a-beleg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 16px; padding: 14px 0 14px 14px; border-left: 3px solid var(--a-hair); margin-bottom: 6px; }
.a-beleg--negativ { border-left-color: var(--score-0, #cf5b54); }
.a-beleg--positiv { border-left-color: var(--score-2, #0d8a4a); }
.a-beleg--innovativ { border-left-color: var(--r-innovation, #4f46e5); }
.a-beleg-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; align-items: end; }
.a-beleg-thumb { width: 132px; height: 74px; object-fit: cover; object-position: top; border: 1px solid var(--a-hair); border-radius: 8px; align-self: end; }
.a-beleg-hint { grid-column: 1 / -1; margin: 0; }
/* Ebenfalls um die Seitenleiste großzügiger als die Fensterbreite suggeriert. */
@media (max-width: 980px) {
    .a-beleg { grid-template-columns: minmax(0, 1fr); }
    .a-beleg-main { grid-template-columns: minmax(0, 1fr); }
}

/* KI-Neugenerierung anfordern */
.a-regen { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; padding: 12px 14px; border: 1px dashed var(--a-hair); border-radius: 10px; font-size: 13px; max-width: 760px; }
.a-regen-status { font-weight: 600; }

/* Test-Editor */
.a-editor { padding-bottom: 84px; }
.a-edit-group { margin-bottom: 30px; }
.a-edit-rows { border: 1px solid var(--a-hair); border-radius: var(--a-radius); overflow: hidden; }
.a-edit-row { padding: 12px 16px; border-top: 1px solid var(--a-hair); }
.a-edit-row:first-child { border-top: 0; }
.a-edit-main { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(180px, 280px) auto; gap: 16px; align-items: center; }
@media (max-width: 860px) { .a-edit-main { grid-template-columns: 1fr; gap: 10px; } }
.a-edit-hl { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--a-hair); }
.a-edit-hl label { font-size: 12px; color: var(--a-muted-fg); font-weight: 600; white-space: nowrap; }
.a-edit-hl select { height: 34px; border: 1px solid var(--a-hair); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 13px; background: #fff; }
.a-edit-hl input { flex: 1; min-width: 120px; height: 34px; border: 1px solid var(--a-hair); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 13px; }
.a-edit-hl input:focus, .a-edit-hl select:focus { border-color: var(--a-ink); outline: none; }
.a-edit-crit .code { font-size: 12px; color: var(--a-muted-fg); font-weight: 600; }
.a-edit-crit .lbl { font-size: 14px; font-weight: 600; }
.a-edit-crit .ts { font-size: 11px; margin-top: 2px; }

.a-score { display: inline-flex; gap: 4px; }
.a-score-opt { position: relative; cursor: pointer; }
.a-score-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.a-score-opt span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--a-hair); font-weight: 700; font-size: 14px; color: var(--a-ink); transition: all .12s; }
.a-score-opt input:checked + span { border-color: transparent; }
.a-score-opt.s2 input:checked + span { background: var(--a-ink); color: #fff; }
.a-score-opt.s1 input:checked + span { background: color-mix(in srgb, var(--a-ink) 42%, transparent); color: #fff; }
.a-score-opt.s0 input:checked + span { background: color-mix(in srgb, var(--a-ink) 14%, transparent); }
.a-score-opt.none input:checked + span { background: transparent; border-style: dashed; color: var(--a-muted-fg); }
.a-score-opt input:focus-visible + span { outline: 2px solid var(--a-red); outline-offset: 2px; }

.a-edit-note input { width: 100%; height: 38px; border: 1px solid var(--a-hair); border-radius: 9px; padding: 0 12px; font: inherit; font-size: 14px; outline: none; }
.a-edit-note input:focus { border-color: var(--a-ink); }
.a-edit-shot { display: flex; align-items: center; gap: 10px; }
.a-thumb { display: block; width: 44px; height: 34px; border-radius: 7px; overflow: hidden; border: 1px solid var(--a-hair); flex-shrink: 0; }
.a-thumb img { width: 100%; height: 100%; object-fit: cover; }
.a-edit-shot input[type=file] { font-size: 12px; max-width: 190px; }
.a-shot-link { font-size: 12.5px; white-space: nowrap; }
.a-shot-hint { font-size: 12px; }

.a-editor-bar, .a-savebar { position: fixed; bottom: 0; left: 248px; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 32px; background: color-mix(in srgb, var(--a-bg) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--a-hair); z-index: 20; }
@media (max-width: 760px) { .a-editor-bar, .a-savebar { left: 0; } }
.ss-count { margin: 4px 2px 0; }
/* Platz, damit die fixierte Speicher-Leiste den letzten Abschnitt nicht verdeckt. */
.a-savebar-spacer { height: 72px; }

/* Screenshot-Crop-Modal (Cropper.js, ADR 0006) */
.crop-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15,15,18,.62); }
.crop-box { background: #fff; border-radius: 14px; width: 1100px; max-width: 96vw; max-height: 94vh; display: flex; flex-direction: column; padding: 18px; box-shadow: 0 40px 90px -30px rgba(0,0,0,.6); }
.crop-head { font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.crop-stage { background: #f3f3f3; border-radius: 8px; overflow: hidden; }
.crop-stage img { display: block; max-width: 100%; max-height: 66vh; }
.crop-meta { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.crop-dim { font-size: 13px; font-weight: 600; color: #444; }
.crop-dim.warn { color: #cf5b54; }
.crop-warn { font-size: 13px; color: #cf5b54; }
.a-btn.sm { height: auto; padding: 7px 13px; font-size: 13px; }
.crop-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.crop-done { margin-top: 6px; font-size: 12.5px; color: #0d8a4a; font-weight: 600; }
.crop-done .crop-small { color: #cf5b54; }

/* Markieren-Editor (ADR 0019) — Rahmen, Sprechblasen, Sticker */
.mk-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15,15,18,.62); }
.mk-box { background: #fff; border-radius: 14px; width: 1180px; max-width: 96vw; max-height: 94vh; display: flex; flex-direction: column; padding: 18px; box-shadow: 0 40px 90px -30px rgba(0,0,0,.6); }
.mk-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.mk-head strong { font-size: 15px; }
.mk-hint { font-size: 13px; color: #6a6a6a; }
.mk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 0 12px; border-bottom: 1px solid #ececec; margin-bottom: 12px; }
.mk-grp { display: flex; align-items: center; gap: 6px; }
.mk-lbl { font-size: 12px; font-weight: 600; color: #6a6a6a; margin-right: 2px; }
.mk-acts { margin-left: auto; gap: 8px; }
.mk-tool { width: 34px; height: 34px; border-radius: 8px; border: 1px solid #e2e2e2; background: #fff; cursor: pointer; padding: 3px; line-height: 0; }
.mk-tool canvas { width: 100%; height: 100%; }
.mk-tool:hover { border-color: #bdbdbd; }
.mk-tool.is-on { border-color: #1a1b1f; box-shadow: inset 0 0 0 1px #1a1b1f; }
.mk-tool:focus-visible { outline: 2px solid #1a1b1f; outline-offset: 2px; }
.mk-stage { background: #f3f3f3; border-radius: 8px; overflow: auto; display: flex; justify-content: center; }
.mk-stage canvas { display: block; touch-action: none; cursor: crosshair; }
.mk-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* Markierungs-Zeile im Listeneintrag */
.ss-mark { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.ss-mark-vis { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #444; }
.ss-mark-off { font-size: 12.5px; color: #e2a32c; font-weight: 600; }
.ss-mark-dirty { font-size: 12.5px; color: #0d8a4a; font-weight: 600; }

/* Screenshot-Manager (ADR 0008) */
.ss-form { margin-top: 8px; }
.ss-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.ss-item {
    position: relative;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e3e3e6;
    border-radius: 10px;
}
.ss-row {
    display: grid;
    grid-template-columns: auto 160px 1fr auto;
    align-items: center;
    gap: 14px;
}
.ss-item.is-dragging { opacity: .5; }
.ss-item.is-lead { border-color: #c8102e; box-shadow: 0 0 0 1px #c8102e inset; }
.ss-handle { cursor: grab; color: #b6b6bb; font-size: 20px; line-height: 1; user-select: none; }
.ss-handle:active { cursor: grabbing; }
.ss-lead-badge {
    display: none;
    position: absolute;
    margin: -28px 0 0 30px;
    background: #c8102e; color: #fff;
    font-size: 11px; font-weight: 700; letter-spacing: .02em;
    padding: 2px 8px; border-radius: 999px;
}
.ss-item.is-lead .ss-lead-badge { display: inline-block; }
.ss-thumb { display: block; border-radius: 6px; overflow: hidden; line-height: 0; }
.ss-thumb img { width: 160px; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.ss-fields { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ss-fields input { width: 100%; }
.ss-dim { font-size: 12px; }
.ss-landing { display: inline-flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 13px; cursor: pointer; }
.ss-landing input[type="checkbox"] { width: auto; margin: 0; flex: 0 0 auto; }
.ss-landing .ss-landing-pos { width: 56px; }
.ss-remove { white-space: nowrap; }
.ss-empty { padding: 18px; text-align: center; }
.ss-add { margin: 16px 0; padding: 16px; border: 1px dashed #cdcdd2; border-radius: 10px; background: #fafafb; }
.ss-add-lbl { display: block; font-weight: 600; margin-bottom: 8px; }

/* Bestätigungs-Modal (Archivieren, ADR 0009) */
.a-modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(10,10,12,.5); }
.a-modal-box { background: #fff; border-radius: 14px; padding: 24px 26px; max-width: 460px; width: 100%; box-shadow: 0 30px 80px -24px rgba(0,0,0,.45); }
.a-modal-box h3 { margin: 0 0 10px; font-size: 19px; }
.a-modal-box p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.55; color: var(--a-ink); }
.a-modal-warn { background: color-mix(in srgb, #b22 8%, transparent); border-left: 3px solid #b22; padding: 10px 12px; border-radius: 6px; }
.a-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.a-btn.danger { background: #b22; border-color: #b22; }
.a-btn.danger::before { display: none; }
.a-btn.danger:hover { background: #9a1d1d; }

/* Interne Kommentare & Öffentlich/Intern-Kennzeichnung (ADR 0010) */
.c-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.c-badge.sm { font-size: 10px; padding: 1px 6px; }
.c-badge.public { background: color-mix(in srgb, #0d8a4a 14%, transparent); color: #0a6e3a; }
.c-badge.intern { background: #ededf0; color: #5a5a64; }

.c-block { border-radius: 12px; padding: 18px 20px; margin: 18px 0; border: 1px solid var(--a-hair); }
.c-block.intern { background: #f7f7f9; }
.c-block.public { background: color-mix(in srgb, #0d8a4a 4%, transparent); }
.c-block-head { display: flex; align-items: center; gap: 10px; }
.c-block-head h3 { margin: 0; font-size: 16px; }
.c-hint { margin: 6px 0 14px; font-size: 13px; }

.c-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.c-item { background: #fff; border: 1px solid var(--a-hair); border-radius: 8px; padding: 10px 12px; }
.c-meta { font-size: 12.5px; margin-bottom: 4px; }
.c-body { font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.c-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.c-edit { display: inline; }
.c-edit > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--a-ink); }
.c-editform { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.c-empty { font-size: 13px; font-style: italic; margin: 0 0 12px; }

.c-add { display: flex; gap: 10px; align-items: flex-start; }
.c-add textarea { flex: 1; min-height: 40px; resize: vertical; border: 1px solid var(--a-hair); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; }
.c-editform textarea { border: 1px solid var(--a-hair); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; }

.c-fieldlbl { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--a-muted-fg); }

/* Screenshot-Item: interner Kommentar-Sub-Block */
.ss-comments { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #f7f7f9; border: 1px dashed #d8d8de; }
.c-sub-head { font-size: 12.5px; font-weight: 600; color: #5a5a64; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }

/* ===== Test-Worklist (ADR 0011) ===== */
.wl-progress { display: flex; align-items: center; gap: 14px; margin: 4px 0 22px; }
.wl-progress-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--a-muted); overflow: hidden; }
.wl-progress-bar span { display: block; height: 100%; background: var(--a-ink); border-radius: 999px; }
.wl-progress-lbl { font-size: 13px; white-space: nowrap; color: var(--a-muted-fg); }
.wl-progress-lbl strong { color: var(--a-ink); }

.wl-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.wl-search { height: 38px; min-width: 220px; flex: 1; border: 1px solid var(--a-hair); border-radius: 9px; padding: 0 12px; font: inherit; font-size: 14px; }
.wl-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.wl-chips .a-pill { cursor: pointer; background: #fff; }
.wl-chips .a-pill.active { background: var(--a-ink); color: #fff; border-color: var(--a-ink); }
.wl-statusfilter { height: 38px; border: 1px solid var(--a-hair); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 13px; background: #fff; }

.wl-grid, .wl-head, .wl-row { display: grid; grid-template-columns: minmax(240px, 1fr) 160px 140px 128px 40px; align-items: center; gap: 14px; }
.wl-head { padding: 0 14px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--a-muted-fg); font-weight: 600; }
.wl-head .ctr, .wl-row .ctr { justify-self: center; }

.wl-row { padding: 10px 14px; border-top: 1px solid var(--a-hair); }
.wl-row:hover { background: color-mix(in srgb, var(--a-ink) 3%, transparent); }
.wl-row.is-clickable { cursor: pointer; }
.wl-code { font-size: 11px; color: var(--a-muted-fg); font-weight: 700; }
.wl-lbl { font-weight: 600; font-size: 14px; line-height: 1.3; }
.wl-act { font-size: 11.5px; margin-top: 2px; }

.wl-status select { width: 100%; height: 34px; border: 1px solid var(--a-hair); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; background: #fff; }

.wl-signals { display: flex; align-items: center; gap: 8px; }
.wl-ind { font-size: 12.5px; white-space: nowrap; }
.wl-ind.zero { color: color-mix(in srgb, var(--a-muted-fg) 60%, transparent); }
.wl-ind.has { font-weight: 700; }
.wl-hl { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.wl-hl-positiv { background: color-mix(in srgb, #0d8a4a 16%, transparent); color: #0a6e3a; }
.wl-hl-negativ { background: color-mix(in srgb, var(--a-red) 14%, transparent); color: var(--a-red); }
.wl-hl-innovativ { background: color-mix(in srgb, #8a6d00 18%, transparent); color: #8a6d00; }

.wl-detail-link { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; text-decoration: none; font-size: 18px; color: var(--a-ink); border: 1px solid var(--a-hair); }
.wl-detail-link:hover { background: var(--a-ink); color: #fff; border-color: var(--a-ink); }

.wl-grpcount { font-size: 12px; font-weight: 600; color: var(--a-muted-fg); margin-left: 8px; }
.wl-empty { padding: 30px; text-align: center; color: var(--a-muted-fg); }

@media (max-width: 1024px) {
    .wl-head { display: none; }
    .wl-row { grid-template-columns: 1fr 160px; grid-auto-flow: row; row-gap: 8px; }
    .wl-row .wl-status, .wl-row .wl-signals, .wl-row .wl-detail { grid-column: span 1; }
}

/* Detail: Bewertung & Texte (ADR 0011) */
.fld-meta { display: flex; flex-wrap: wrap; gap: 22px; margin-bottom: 16px; }
.fld-row { display: flex; flex-direction: column; gap: 6px; }
.fld-row > label { font-size: 12px; font-weight: 700; color: var(--a-muted-fg); }
.fld-row select { height: 38px; border: 1px solid var(--a-hair); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 14px; background: #fff; min-width: 160px; }
.fld-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fld-field > label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.fld-field textarea { border: 1px solid var(--a-hair); border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 14px; resize: vertical; }
.fld-field select { height: 38px; border: 1px solid var(--a-hair); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 14px; background: #fff; max-width: 260px; }
.fld-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 8px; }

/* Zuständigkeit (ADR 0012) */
.a-filter-sep { width: 1px; align-self: stretch; background: var(--a-hair); margin: 0 4px; }
.a-assign select { height: 32px; max-width: 140px; border: 1px solid var(--a-hair); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; background: #fff; }
.a-table .actions { width: 1%; }
.wl-head-right { display: flex; align-items: center; gap: 14px; }
.wl-assign-head { display: flex; align-items: center; gap: 8px; }
.wl-assign-head label { font-size: 13px; font-weight: 600; color: var(--a-muted-fg); }
.wl-assign-head select { height: 38px; border: 1px solid var(--a-hair); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 14px; background: #fff; }

/* Test-Video (ADR 0013) */
.vid-player { max-width: 560px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; margin-bottom: 12px; }
.vid-player iframe { width: 100%; height: 100%; border: 0; display: block; }
.vid-processing { font-size: 14px; color: #8a6d00; margin: 0 0 12px; }
.vid-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.vid-replace { cursor: pointer; }
.vid-bar { width: 220px; height: 10px; }
.vid-status { font-size: 13px; }

/* --- Automatische Test-Vorschläge (ADR 0018) ------------------------------ */
/* Abgesetzter Streifen unter dem Kriterium: als Angebot erkennbar, aber dem
   erfassten Wert klar untergeordnet — der Live-Score bleibt die Hauptaussage. */
.wl-vorschlag { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding: 7px 10px; border: 1px dashed var(--a-hair); border-radius: 10px; background: color-mix(in srgb, var(--a-ink) 3%, transparent); }
.wl-vs-score { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 8px; font-weight: 700; font-size: 13px; }
.wl-vs-score.s2 { background: var(--a-ink); color: #fff; }
.wl-vs-score.s1 { background: color-mix(in srgb, var(--a-ink) 42%, transparent); color: #fff; }
.wl-vs-score.s0 { background: color-mix(in srgb, var(--a-ink) 14%, transparent); color: var(--a-ink); }
.wl-vs-meta { flex: 1 1 auto; min-width: 140px; font-size: 12.5px; color: var(--a-muted-fg); }
.wl-vs-btn { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--a-ink); background: var(--a-ink); color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; line-height: 1; cursor: pointer; transition: background .15s, color .15s; }
.wl-vs-btn:hover { background: transparent; color: var(--a-ink); }
.wl-vs-btn.drop { border-color: var(--a-hair); background: transparent; color: var(--a-muted-fg); font-weight: 600; }
.wl-vs-btn.drop:hover { border-color: var(--a-ink); color: var(--a-ink); }
.wl-vs-note { margin-top: 5px; font-size: 12.5px; line-height: 1.45; }

/* Formulare, die nur als POST-Ziel für die Buttons oben dienen. */
.a-hidden-form { display: none; }

/* Sprungziel nach einer Vorschlags-Entscheidung: Abstand, damit die Zeile nicht
   unter der klebenden Kopfleiste landet. */
.wl-row[id] { scroll-margin-top: 96px; }

/* --- Audit-Zugang (ADR 0018) --------------------------------------------- */
.az-neu { margin: 18px 32px; padding: 16px 18px; border: 2px solid var(--a-ink); border-radius: 12px; }
.az-neu p { margin: 0 0 10px; font-size: 14px; }
.az-token { display: block; padding: 12px 14px; border-radius: 9px; background: color-mix(in srgb, var(--a-ink) 6%, transparent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; user-select: all; }
.az-form { display: flex; align-items: flex-end; gap: 14px; margin: 18px 32px; }
.az-table { margin: 0 32px 32px; }
.az-widerrufen { opacity: .55; }
.az-neu .az-copy { margin-top: 12px; height: 38px; padding: 0 16px; font-size: 14px; }
