/* Blitzblank: mobile first, ohne Framework */
:root {
    --bg: #f5f7f6;
    --surface: #ffffff;
    --surface-2: #eef2f0;
    --text: #172220;
    --muted: #64716d;
    --border: #dde4e1;
    --primary: #0f766e;
    --primary-contrast: #ffffff;
    --primary-soft: #d9f0ec;
    --danger: #b91c1c;
    --danger-soft: #fde8e8;
    --warn: #b45309;
    --warn-soft: #fdf1dc;
    --ok: #15803d;
    --ok-soft: #dcf5e4;
    --info-soft: #e3effb;
    --purple: #6d28d9;
    --purple-soft: #ece5fb;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(20, 40, 36, .06), 0 6px 20px -12px rgba(20, 40, 36, .25);
    --nav-h: 64px;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1514;
        --surface: #142220;
        --surface-2: #1c2d2a;
        --text: #e8efed;
        --muted: #93a39f;
        --border: #243733;
        --primary: #2dd4bf;
        --primary-contrast: #06201c;
        --primary-soft: #143f3a;
        --danger: #f87171;
        --danger-soft: #3a1717;
        --warn: #fbbf24;
        --warn-soft: #3b2a0d;
        --ok: #4ade80;
        --ok-soft: #123222;
        --info-soft: #14283a;
        --purple: #c4b5fd;
        --purple-soft: #2a1f4a;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4);
        color-scheme: dark;
    }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
body.body--plain { padding-bottom: 0; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0 0 6px; line-height: 1.2; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 10px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.code { display: block; background: var(--surface-2); padding: 10px 12px; border-radius: 10px; word-break: break-all; white-space: pre-wrap; margin: 8px 0; }
.center { text-align: center; }
.meta { color: var(--muted); font-size: .88rem; }
.neg { color: var(--danger); font-weight: 600; }
.pos { color: var(--ok); font-weight: 600; }
.is-muted { opacity: .6; }

/* Kopfzeile */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; }
.brand__spark { color: var(--primary); font-size: 1.2em; }
.brand__spark--big { font-size: 2.6rem; display: block; }
.topbar__right { display: flex; align-items: center; gap: 12px; }
.bell { position: relative; display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-2); color: var(--text); }
.bell svg { width: 20px; height: 20px; fill: currentColor; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.pill { font-size: .75rem; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); font-weight: 600; }
.pill--warn { background: var(--warn-soft); color: var(--warn); }

/* Seite */
.page { max-width: 720px; margin: 0 auto; padding: 16px 16px 24px; }
.page--center { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.page-head { margin-bottom: 14px; }
.back { display: inline-block; margin-bottom: 6px; font-size: .9rem; }
.section { margin-bottom: 22px; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 10px; }
.stack > .card { margin-bottom: 0; }
.card--link { display: block; color: inherit; }
.card--link:active { transform: scale(.995); }
.card--accent { border-color: var(--primary); background: linear-gradient(180deg, var(--primary-soft), var(--surface) 70%); }
.card--danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); background: color-mix(in srgb, var(--danger-soft) 60%, var(--surface)); }
.card--ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); background: color-mix(in srgb, var(--ok-soft) 60%, var(--surface)); }
.card.is-unread { border-left: 4px solid var(--primary); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.empty { text-align: center; padding: 22px 16px; }
.empty__icon { font-size: 2rem; margin-bottom: 4px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); font-size: .93rem; }
.kv > span:first-child { color: var(--muted); flex-shrink: 0; }
.kv > span:last-child, .kv > strong { text-align: right; }
.kv--big { font-size: 1.2rem; border: 0; }
.kv--big strong { font-size: 1.6rem; color: var(--primary); }
.row-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: .9rem; }

/* Aufgabenliste */
.task { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: inherit; box-shadow: var(--shadow); }
.task--warn { border-left: 4px solid var(--warn); }
.task--danger { border-left: 4px solid var(--danger); background: color-mix(in srgb, var(--danger-soft) 45%, var(--surface)); }
.task__icon { font-size: 1.4rem; width: 32px; text-align: center; flex-shrink: 0; }
.task__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.task__body strong { font-size: .97rem; }
.task__arrow { color: var(--muted); font-size: 1.4rem; }

/* Bereichskarte */
.area-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.area-card__title { font-weight: 700; font-size: 1.1rem; color: var(--text); display: flex; align-items: center; gap: 8px; }
.area-card__icon { font-size: 1.4rem; }
.area-card__holder { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.area-card__line { margin-bottom: 4px; }
.area-card__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.user-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.avatar { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: var(--c, var(--primary)); color: #fff; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; flex-shrink: 0; text-shadow: 0 1px 1px rgba(0,0,0,.2); }
.avatar--sm { width: 22px; height: 22px; font-size: .7rem; }

/* Chips */
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.chip--locked { background: var(--surface-2); color: var(--muted); }
.chip--open { background: var(--ok-soft); color: var(--ok); }
.chip--last { background: var(--warn-soft); color: var(--warn); }
.chip--overdue { background: var(--danger-soft); color: var(--danger); }
.chip--review { background: var(--info-soft); color: #1d4ed8; }
@media (prefers-color-scheme: dark) { .chip--review { color: #93c5fd; } }
.chip--paused { background: var(--purple-soft); color: var(--purple); }
.chip--done { background: var(--ok-soft); color: var(--ok); }
.chip--muted { background: var(--surface-2); color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 16px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none; min-height: 44px; transition: transform .05s ease, filter .15s ease; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--primary); color: var(--primary-contrast); }
.btn--secondary { background: var(--primary-soft); color: var(--primary); }
@media (prefers-color-scheme: dark) { .btn--secondary { color: #a7f3ea; } }
.btn--danger { background: var(--danger); color: #fff; }
.btn--ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn--disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; font-weight: 600; font-size: .85rem; }
.btn--block { display: flex; width: 100%; }
.btn--sm { padding: 7px 12px; min-height: 36px; font-size: .85rem; }
.btn--xs { padding: 2px 8px; min-height: 26px; font-size: .75rem; border-radius: 8px; }
.btn[disabled] { opacity: .6; cursor: wait; }
.inline-form { display: inline; }
.btn.is-confirming { background: var(--danger); color: #fff; border-color: transparent; }

/* Formulare */
.form-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-field > span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.form-field--row { flex-direction: row; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding: 8px 0; margin: 0; }
.form-field--row > span { color: var(--text); font-weight: 500; font-size: .92rem; }
.input, .textarea, .select { width: 100%; font: inherit; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); min-height: 44px; }
.input:focus, .textarea:focus, .select:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.input--color { padding: 4px; height: 44px; width: 80px; }
.input--num { width: 90px; text-align: right; flex-shrink: 0; }
.textarea { resize: vertical; }
.check, .radio { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.check input, .radio input { width: 20px; height: 20px; accent-color: var(--primary); flex-shrink: 0; margin: 0; }
.check--big { padding: 12px 0; font-size: 1.02rem; }
.check--big input { width: 26px; height: 26px; }
.check--sm { padding: 0; font-size: .8rem; gap: 4px; white-space: nowrap; }
.radio-list { display: flex; flex-direction: column; }
.radio span { display: flex; flex-direction: column; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.seg__item { flex: 1; text-align: center; }
.seg__item input { position: absolute; opacity: 0; pointer-events: none; }
.seg__item span { display: block; padding: 10px 6px; font-weight: 600; font-size: .9rem; background: var(--surface); }
.seg__item input:checked + span { background: var(--primary); color: var(--primary-contrast); }
.details { margin-top: 10px; }
.details summary { cursor: pointer; font-weight: 600; color: var(--primary); padding: 6px 0; }

/* Checkliste im Putzformular */
.checklist__item { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); }
.checklist__item:first-child { border-top: 0; }
.checklist__item .check { flex: 1; }
.item-photo { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.item-photo__btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--surface-2); }
.item-photo__preview img { width: 36px; height: 36px; object-fit: cover; border-radius: 8px; display: block; }
.item-photo.has-file .item-photo__btn { background: var(--primary-soft); }

/* Uploads */
.upload-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.upload-btn { flex: 1; min-width: 140px; display: flex; align-items: center; justify-content: center; padding: 14px 10px; border: 2px dashed var(--border); border-radius: 12px; cursor: pointer; font-weight: 600; background: var(--surface-2); }
.upload-btn.has-file { border-style: solid; border-color: var(--primary); background: var(--primary-soft); }
.upload-list { display: flex; flex-wrap: wrap; gap: 8px; }
.upload-list .up { position: relative; width: 84px; }
.upload-list .up img, .upload-list .up video { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; display: block; background: #000; }
.upload-list .up .up__label { font-size: .7rem; color: var(--muted); display: block; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-list .up .up__remove { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: .8rem; cursor: pointer; }
.progress { position: relative; height: 34px; border-radius: 10px; background: var(--surface-2); overflow: hidden; margin-bottom: 8px; }
.progress__bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--primary); transition: width .2s ease; }
.progress__label { position: relative; display: flex; align-items: center; justify-content: center; height: 100%; font-size: .85rem; font-weight: 600; }
.sticky-actions { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); background: var(--bg); padding: 8px 0 4px; z-index: 5; }

/* Medien */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 8px; }
.media-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.media-item--video { grid-column: 1 / -1; }
.media-item--video video { width: 100%; max-height: 360px; border-radius: 12px; background: #000; display: block; }
.thumb-row { display: flex; gap: 6px; margin-top: 8px; }
.thumb { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; }
.thumb--video { background: #111; color: #fff; font-size: 1.1rem; }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: .93rem; }
.list li:first-child { border-top: 0; }
.list li > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.list--plain li { display: block; }
.list li.is-unchecked { color: var(--danger); }

/* Punkte */
.score { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.score__row { display: flex; align-items: center; gap: 10px; }
.score__name { flex: 1; display: flex; flex-direction: column; font-weight: 600; }
.score__points { font-size: 1.4rem; font-weight: 800; color: var(--primary); display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.stat { text-align: center; background: var(--surface-2); border-radius: 10px; padding: 8px 4px; }
.stat strong { display: block; font-size: 1.1rem; }
.stat span { font-size: .7rem; color: var(--muted); }

/* Tabellen */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; border-top: 0; }
.item-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.item-row .input { flex: 1; min-width: 0; }

/* Hinweise */
.alert { padding: 11px 14px; border-radius: 12px; margin-bottom: 10px; font-size: .93rem; border: 1px solid transparent; }
.alert--error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert--success { background: var(--ok-soft); color: var(--ok); }
.alert--info { background: var(--info-soft); color: var(--text); }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: 92vw; box-shadow: var(--shadow); animation: toast-in .25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Navigation unten */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border); }
.bottom-nav__item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .7rem; font-weight: 600; }
.bottom-nav__item svg { width: 24px; height: 24px; fill: currentColor; }
.bottom-nav__item.is-active { color: var(--primary); }

/* Login */
.login-card { width: 100%; max-width: 380px; margin: 16px; }
.login-brand { text-align: center; margin-bottom: 16px; }
.login-brand h1 { font-size: 1.8rem; }

@media (min-width: 720px) {
    .page { padding-top: 24px; }
    .topbar { padding-left: 24px; padding-right: 24px; }
}
