/* Corporate Design Watchdog – Oberfläche. Bewusst neutral (Schwarz, Grau, eine Akzentfarbe):
   die Marke erscheint nur im Inhalt (Muster Stage). Haarlinien, Radius 0, keine Schatten. */
:root {
  --ui-bg: #f3f3f3;
  --ui-panel: #ffffff;
  --ui-text: #111111;
  --ui-muted: #6b6b6b;
  --ui-line: #d9d9d9;
  --ui-accent: #4b35d6;
  --ui-accent-text: #ffffff;
  --ui-ok: #2e7d32;
  --ui-warn: #b26a00;
  --ui-error: #b3261e;
  --ui-font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ui-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sidebar: 240px;
}
@media (prefers-color-scheme: dark) {
  :root { --ui-bg: #161616; --ui-panel: #1f1f1f; --ui-text: #f0f0f0; --ui-muted: #9a9a9a; --ui-line: #3a3a3a; --ui-accent: #9d8cff; --ui-accent-text: #111; }
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--ui-font); color: var(--ui-text); background: var(--ui-bg); line-height: 1.5; }
a { color: inherit; }
code { font-family: var(--ui-mono); font-size: .9em; }
h1 { font-size: 2rem; margin: 0 0 .25rem; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; font-weight: 600; }
h3 { font-size: 1rem; margin: 0 0 .5rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--ui-panel); padding: .5rem; z-index: 10; }
.muted { color: var(--ui-muted); }
.small { font-size: .85rem; }
.lead { font-size: 1.1rem; max-width: 60ch; }
.inline { display: inline; }
.link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.tag { display: inline-block; font-size: .75rem; padding: .1rem .4rem; border: 1px solid var(--ui-line); color: var(--ui-muted); vertical-align: middle; }
.tag--warn { border-color: var(--ui-warn); color: var(--ui-warn); }
.hp { position: absolute; left: -9999px; }

.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--ui-panel); border-right: 1px solid var(--ui-line); padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 0; height: 100vh; overflow: auto; }
.wordmark { font-weight: 700; font-size: 1.1rem; text-decoration: none; display: block; }
.nav { display: flex; flex-direction: column; }
.nav a { padding: .35rem .5rem; text-decoration: none; border-left: 2px solid transparent; }
.nav a:hover { background: var(--ui-bg); }
.nav a.is-active { border-left-color: var(--ui-accent); font-weight: 600; }
.sidebar__themes { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: .25rem; }
.stage { padding: 2rem 2.5rem 4rem; max-width: 1200px; width: 100%; }
.page-head { margin-bottom: 1.5rem; }
.panel { background: var(--ui-panel); border: 1px solid var(--ui-line); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.narrow { max-width: 480px; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.card, .cards a { display: flex; flex-direction: column; gap: .2rem; background: var(--ui-panel); border: 1px solid var(--ui-line); padding: 1rem 1.25rem; text-decoration: none; }
.card:hover, .cards a:hover { border-color: var(--ui-accent); }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.list { list-style: none; padding: 0; margin: 0; } .list li { padding: .3rem 0; border-bottom: 1px solid var(--ui-line); } .list li:last-child { border-bottom: 0; }
.pills { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.pill { font-size: .85rem; padding: .2rem .6rem; border: 1px solid var(--ui-line); text-decoration: none; }
.pill.is-active { background: var(--ui-text); color: var(--ui-panel); border-color: var(--ui-text); }

.button { display: inline-block; background: var(--ui-accent); color: var(--ui-accent-text); border: 1px solid var(--ui-accent); padding: .55rem 1.1rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.button:hover { filter: brightness(.92); }
.button--wide { width: 100%; text-align: center; }
.button--small { padding: .3rem .7rem; font-size: .85rem; }
.button--ghost { background: transparent; color: var(--ui-text); border-color: var(--ui-line); }
.form label { display: block; font-size: .85rem; color: var(--ui-muted); margin: .5rem 0 .2rem; }
.form input { width: 100%; padding: .55rem .7rem; border: 1px solid var(--ui-line); background: var(--ui-panel); color: inherit; font: inherit; margin-bottom: .75rem; }
.form select { padding: .5rem .6rem; border: 1px solid var(--ui-line); background: var(--ui-panel); color: inherit; font: inherit; margin-bottom: .75rem; }
.form--inline { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; } .form--inline label { margin: 0; } .form--inline select, .form--inline input { margin-bottom: 0; width: auto; }
.form input:focus { outline: 2px solid var(--ui-accent); outline-offset: 1px; }
.error { color: var(--ui-error); font-size: .85rem; margin: -.5rem 0 .75rem; }
.notice { border: 1px solid var(--ui-ok); padding: .75rem 1rem; margin-bottom: 1.25rem; background: var(--ui-panel); }
.notice--error { border-color: var(--ui-error); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--ui-line); vertical-align: top; }
.table th { font-weight: 600; font-size: .8rem; color: var(--ui-muted); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
.dl dt { color: var(--ui-muted); font-size: .85rem; } .dl dd { margin: 0; } .dl ul { margin: 0; padding-left: 1.1rem; }
.pre { white-space: pre-wrap; font-family: var(--ui-mono); font-size: .85rem; background: var(--ui-bg); padding: 1rem; border: 1px solid var(--ui-line); max-height: 70vh; overflow: auto; }
.prose { max-width: 70ch; } .prose h1, .prose h2, .prose h3 { margin-top: 1rem; } .prose table { border-collapse: collapse; } .prose td, .prose th { border: 1px solid var(--ui-line); padding: .3rem .5rem; }

.copy { cursor: copy; position: relative; }
.copy.is-copied::after { content: "kopiert"; position: absolute; left: 100%; top: 0; margin-left: .5rem; font-size: .75rem; color: var(--ui-ok); white-space: nowrap; }
.swatch { display: inline-block; width: 1em; height: 1em; border: 1px solid rgba(0,0,0,.15); vertical-align: -2px; margin-right: .35rem; }
.token-value { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; }

.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.palette__chip { display: flex; flex-direction: column; justify-content: flex-end; min-height: 90px; padding: .6rem; text-decoration: none; font-size: .8rem; border: 1px solid rgba(0,0,0,.08); }
.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.color { display: flex; gap: .75rem; }
.color__chip { width: 64px; height: 64px; flex: none; border: 1px solid var(--ui-line); }
.color__meta { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.matrix-wrap { overflow: auto; }
.matrix { border-collapse: collapse; font-size: .8rem; }
.matrix th, .matrix td { border: 1px solid var(--ui-line); padding: .35rem .5rem; text-align: center; min-width: 64px; }
.matrix th { font-weight: 400; text-align: left; }
.matrix td.grade-fail { text-decoration: line-through; opacity: .55; }
.matrix td.grade-aa-large { font-style: italic; }
.matrix td.grade-aa, .matrix td.grade-aaa { font-weight: 700; }

.type-sample { font-size: 1.6rem; line-height: 1.25; margin: .25rem 0 1rem; }
.bar { display: inline-block; height: 10px; background: var(--ui-accent); vertical-align: middle; }
.radius-demo { display: inline-block; width: 40px; height: 40px; border: 2px solid var(--ui-text); vertical-align: middle; }
.shadow-demo { display: inline-block; width: 40px; height: 40px; background: var(--ui-panel); vertical-align: middle; }
.logo-variant { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.logo-variant__stage { display: flex; align-items: center; justify-content: center; min-height: 200px; padding: 2rem; border: 1px solid var(--ui-line); background: #fff; color: #000; }
.logo-variant__svg svg { max-width: 100%; height: auto; max-height: 120px; }
.logo-variant__stage img { max-width: 100%; max-height: 160px; }
.guideline .dodont { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.guideline .do h3 { color: var(--ui-ok); } .guideline .dont h3 { color: var(--ui-error); }
.guideline ul { margin: 0; padding-left: 1.1rem; }
.release { padding: .75rem 0; border-bottom: 1px solid var(--ui-line); } .release:last-child { border-bottom: 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--ui-line); }
  .stage { padding: 1.25rem 1rem 3rem; }
  .logo-variant, .guideline .dodont { grid-template-columns: 1fr; }
}

/* Stufe 3: Vorschau-Frames, Prüfbericht, Status */
.frame-tools { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.frame-tools .pill { background: var(--ui-panel); color: var(--ui-text); cursor: pointer; font: inherit; font-size: .85rem; }
.frame-tools .pill.is-active { background: var(--ui-text); color: var(--ui-panel); }
.frame-wrap { overflow: auto; background: #e9e9e9; border: 1px solid var(--ui-line); padding: 1rem; }
.frame { display: block; max-width: 100%; height: 720px; border: 0; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.1); transform-origin: top left; }
.findings { list-style: none; padding: 0; margin: 0; }
.finding { padding: .5rem 0; border-bottom: 1px solid var(--ui-line); }
.finding--block .tag { border-color: var(--ui-error); color: var(--ui-error); }
.finding--warn .tag { border-color: var(--ui-warn); color: var(--ui-warn); }
.tag--success { border-color: var(--ui-ok); color: var(--ui-ok); }
.tag--danger { border-color: var(--ui-error); color: var(--ui-error); }
.tag--warning { border-color: var(--ui-warn); color: var(--ui-warn); }
.tag--info { border-color: var(--ui-accent); color: var(--ui-accent); }
.form textarea { width: 100%; padding: .55rem .7rem; border: 1px solid var(--ui-line); background: var(--ui-panel); color: inherit; font: inherit; margin-bottom: .75rem; }
.form textarea.mono { font-family: var(--ui-mono); font-size: .85rem; }
.form--inline label { display: flex; flex-direction: column; }

/* Stufe 4: Mediathek */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.media-grid--small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.media-card { display: flex; flex-direction: column; background: var(--ui-panel); border: 1px solid var(--ui-line); text-decoration: none; }
.media-card:hover { border-color: var(--ui-accent); }
.media-card__img { aspect-ratio: 4/3; background: repeating-conic-gradient(#e8e8e8 0 25%, #f6f6f6 0 50%) 0 0/16px 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-card__img img { width: 100%; height: 100%; object-fit: cover; }
.media-card__kind { font-family: var(--ui-mono); color: var(--ui-muted); }
.media-card__meta { padding: .6rem .75rem; display: flex; flex-direction: column; gap: .2rem; }
.media-card__colors { display: flex; gap: 2px; } .media-card__colors i { display: block; width: 14px; height: 14px; border: 1px solid rgba(0,0,0,.1); }
.asset-preview { max-width: 100%; height: auto; display: block; background: repeating-conic-gradient(#e8e8e8 0 25%, #f6f6f6 0 50%) 0 0/16px 16px; }

/* Stufe 5: Assistent */
.assistant { position: fixed; right: 1.25rem; bottom: 0; width: min(520px, calc(100vw - 2.5rem)); z-index: 20; }
.assistant__toggle { width: 100%; background: var(--ui-text); color: var(--ui-panel); border: 0; padding: .6rem 1rem; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.assistant__panel { background: var(--ui-panel); border: 1px solid var(--ui-line); border-bottom: 0; padding: 1rem; max-height: 70vh; display: flex; flex-direction: column; gap: .75rem; }
.assistant__log { overflow: auto; display: flex; flex-direction: column; gap: .5rem; font-size: .9rem; min-height: 80px; max-height: 45vh; }
.assistant__msg { padding: .5rem .75rem; border: 1px solid var(--ui-line); white-space: pre-wrap; }
.assistant__msg--user { background: var(--ui-bg); align-self: flex-end; max-width: 85%; }
.assistant__msg--assistant { align-self: flex-start; max-width: 95%; }
.assistant__msg--changed { border-color: var(--ui-ok); color: var(--ui-ok); font-size: .8rem; }
.assistant__form { display: flex; gap: .5rem; align-items: flex-end; }
.assistant__form textarea { flex: 1; padding: .5rem; border: 1px solid var(--ui-line); font: inherit; background: var(--ui-panel); color: inherit; }

/* Stufe 6: Verbindungen */
.connection { padding: 1rem 0; border-top: 1px solid var(--ui-line); }
.connection:first-of-type { border-top: 0; }
.connection h3 { margin: 0 0 .25rem; font-size: 1rem; }
.error { color: var(--ui-danger, #b00020); }

/* Stufe 7: Sprache */
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; font-size: .9rem; }
.kv dt { color: var(--ui-muted); } .kv dd { margin: 0; }
.example { margin: .75rem 0; padding: .75rem 1rem; border-left: 3px solid var(--ui-ok); background: var(--ui-bg); }
.example--bad { border-left-color: var(--ui-danger, #b00020); }
.example p { margin: .25rem 0; }
.findings li { margin-bottom: .5rem; }
.badge { display: inline-block; padding: 0 .4rem; border: 1px solid var(--ui-line); font-size: .75rem; text-transform: uppercase; }
.badge--block { border-color: var(--ui-danger, #b00020); color: var(--ui-danger, #b00020); }
.badge--warn { border-color: #b8860b; color: #b8860b; }
.badge--info { color: var(--ui-muted); }

/* Anmeldeverfahren */
.qr { max-width: 220px; margin: .5rem 0; } .qr svg { width: 100%; height: auto; display: block; }
.codes { columns: 2; list-style: none; padding: 0; margin: 0 0 1rem; } .codes li { padding: .2rem 0; } .codes code { font-size: 1rem; }
details summary { cursor: pointer; font-weight: 600; }
