/* Ozzynizer Cockpit – schlicht, ruhig, mobil zuerst */
:root {
    --bg: #f4f2ee;
    --surface: #ffffff;
    --text: #1d2327;
    --muted: #68717a;
    --line: #e2ddd5;
    --accent: #1f3a4d;
    --accent-2: #c98a14;
    --link: #1d5d86;
    --ok: #2f7d4f;
    --warn: #a86a00;
    --error: #b3261e;
    --error-bg: #fbeae8;
    --warn-bg: #fdf3e0;
    --info-bg: #e7f0f6;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .05);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14181b;
        --surface: #1c2226;
        --text: #e6e8ea;
        --muted: #98a2ab;
        --line: #2d353b;
        --accent: #9cc3dd;
        --accent-2: #f2b84b;
        --link: #8cc4ea;
        --ok: #6fc794;
        --warn: #f2b84b;
        --error: #ff8a80;
        --error-bg: #3a1f1d;
        --warn-bg: #3a2f17;
        --info-bg: #1c2f3c;
        --shadow: none;
    }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: .25rem 0 1rem; line-height: 1.25; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1rem 0 .4rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--bg); padding: .05em .3em; border-radius: 4px; }
.muted { color: var(--muted); font-weight: normal; font-size: .9em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Kopf + Navigation */
.topbar { display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .topbar { background: #0f1a22; } }
.brand { color: inherit; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand__mark { color: var(--accent-2); }
.brand__sub { font-weight: 400; opacity: .75; }
.topbar__search { flex: 1; max-width: 26rem; margin-left: auto; }
.topbar__search input { width: 100%; padding: .4rem .7rem; border-radius: 6px; border: 0; background: rgba(255, 255, 255, .15); color: #fff; }
.topbar__search input::placeholder { color: rgba(255, 255, 255, .7); }
.topbar__logout { color: rgba(255, 255, 255, .8); font-size: .9rem; }
.nav { display: flex; gap: .25rem; padding: .4rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.nav a { padding: .35rem .7rem; border-radius: 6px; color: var(--text); white-space: nowrap; }
.nav a[aria-current="page"] { background: var(--bg); font-weight: 600; }
.nav a:hover { text-decoration: none; background: var(--bg); }
.count { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 1em; background: var(--accent-2); color: #1d2327; font-size: .75rem; text-align: center; font-weight: 700; }
.nav__issues--error .count { background: var(--error); color: #fff; }

.main { max-width: 1120px; margin: 0 auto; padding: 1rem; }

/* Karten + Raster */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.grid > .card { margin-bottom: 0; }
@media (min-width: 800px) {
    .grid { grid-template-columns: 1fr 1fr; }
    .card--wide { grid-column: 1 / -1; }
}

/* Listen */
.list, .rows, .steps, .hits, .codes { list-style: none; margin: 0; padding: 0; }
.list li { padding: .25rem 0; }
.row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row__main, .row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.steps .step { display: grid; grid-template-columns: 1.4rem 1fr auto; gap: 0 .5rem; padding: .4rem 0; border-top: 1px solid var(--line); align-items: baseline; }
.steps .step:first-child { border-top: 0; }
.step__box { color: var(--muted); }
.step__note { grid-column: 2 / -1; font-size: .85rem; color: var(--muted); }
.step--done .step__text { text-decoration: line-through; color: var(--muted); }
.hits li { padding: .6rem 0; border-top: 1px solid var(--line); }
.hits p { margin: .2rem 0 0; }
.empty { color: var(--muted); font-style: italic; margin: 0; }
.hint { margin: .75rem 0 0; font-size: .9rem; color: var(--warn); }

/* Kennzeichen */
.badge, .tag { display: inline-block; font-size: .72rem; padding: .05rem .45rem; border-radius: 1em; border: 1px solid var(--line); color: var(--muted); font-weight: 600; vertical-align: middle; }
.badge--active { color: var(--ok); border-color: currentColor; }
.badge--waiting, .badge--paused, .badge--warning { color: var(--warn); border-color: currentColor; }
.badge--done, .badge--archived, .badge--dropped { color: var(--muted); }
.badge--prio { background: var(--accent-2); border-color: var(--accent-2); color: #1d2327; }
.badge--error { color: var(--error); border-color: currentColor; }
.tag { font-weight: 500; }
.due { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.due--today { color: var(--warn); font-weight: 700; }
.due--overdue { color: var(--error); font-weight: 700; }

/* Hinweise */
.banner { padding: .7rem .9rem; border-radius: var(--radius); margin: 0 0 1rem; background: var(--info-bg); }
.banner ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.banner--error { background: var(--error-bg); color: var(--error); }
.banner--warning { background: var(--warn-bg); color: var(--warn); }
.banner--success { background: var(--info-bg); }
.main > .banner--error:first-child, body > .banner { margin: 1rem; }

/* Formulare */
input[type=text], input[type=password], input[type=search], input[type=url], textarea {
    width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text);
}
textarea { resize: vertical; }
input:focus, textarea:focus, .button:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.button { display: inline-block; font: inherit; font-weight: 600; padding: .55rem 1.1rem; border: 0; border-radius: 8px; background: var(--accent); color: var(--bg); cursor: pointer; text-align: center; }
.button:hover { text-decoration: none; filter: brightness(1.1); }
.form { display: flex; flex-direction: column; gap: .8rem; }
.form label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; font-size: .9rem; }
.form label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
.quick__form { display: grid; gap: .5rem; grid-template-columns: 1fr; }
@media (min-width: 800px) { .quick__form { grid-template-columns: 1fr 16rem auto; align-items: start; } }
.searchform { display: flex; gap: .5rem; margin-bottom: 1rem; }
.filter { display: flex; flex-wrap: wrap; gap: .3rem; margin: -.25rem 0 1rem; }
.filter a { font-size: .85rem; padding: .15rem .6rem; border: 1px solid var(--line); border-radius: 1em; color: var(--muted); }
.filter a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* Anmeldung */
.auth .main { min-height: 100vh; display: grid; place-items: center; }
.auth__box { width: 100%; max-width: 22rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.brand--large { font-size: 1.25rem; margin-bottom: 1.25rem; color: var(--accent); }
.qr { align-self: center; background: #fff; border-radius: 8px; max-width: 100%; height: auto; }
.secret { display: block; margin-top: .4rem; word-break: break-all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; }

/* Notiz */
.crumbs { margin: 0; color: var(--muted); font-size: .9rem; }
.note__layout { display: grid; gap: 1rem; }
@media (min-width: 900px) { .note__layout { grid-template-columns: minmax(0, 1fr) 18rem; } }
.note__body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; min-width: 0; }
.note__side { font-size: .92rem; }
.note__side h3:first-of-type { margin-top: 1.25rem; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: .3rem .75rem; margin: 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.raw { white-space: pre-wrap; }

/* Markdown */
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; padding-bottom: .2rem; border-bottom: 1px solid var(--line); }
.prose h3 { text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li:has(> input[type=checkbox]) { list-style: none; margin-left: -1.3rem; }
.prose input[type=checkbox] { margin-right: .4rem; }
.prose table, .table { border-collapse: collapse; width: 100%; font-size: .92rem; display: block; overflow-x: auto; }
.prose th, .prose td, .table th, .table td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose blockquote { margin: 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--muted); }
.prose pre { overflow-x: auto; background: var(--bg); padding: .75rem; border-radius: 8px; }
.wikilink { border-bottom: 1px dotted currentColor; }
.wikilink:hover { text-decoration: none; }
.wikilink--broken { color: var(--error); }
