/* Futterwaechter - mobil zuerst, ruhig, warme Farben. Hell und dunkel automatisch nach Systemeinstellung. */
:root {
    --bg: #FBF6EE;
    --card: #FFFFFF;
    --text: #3A2E26;
    --muted: #7D6B5D;
    --line: #EADFD0;
    --soft: #F3EADC;
    --brand: #B9682F;
    --brand-text: #FFFFFF;
    --hero-a: #FBE3BE;
    --hero-b: #F3C58F;
    --hero-text: #4A3424;
    --green: #2F8F57;
    --green-bg: #E1F3E7;
    --yellow: #B7791F;
    --yellow-bg: #FCEFCB;
    --red: #C4452F;
    --red-bg: #FBE2DC;
    --blue: #2F6FA8;
    --blue-bg: #E2EEF9;
    --gray: #9A8E84;
    --radius: 18px;
    --tab-h: 68px;
    --shadow: 0 2px 10px rgba(92, 62, 30, .08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1C1714;
        --card: #28211C;
        --text: #F3E9DD;
        --muted: #B5A595;
        --line: #3A3029;
        --soft: #332A23;
        --brand: #E39A5C;
        --brand-text: #23170E;
        --hero-a: #4A3526;
        --hero-b: #33241A;
        --hero-text: #FBEBD6;
        --green: #63CF8F;
        --green-bg: #1D3A29;
        --yellow: #F0C05A;
        --yellow-bg: #3F3317;
        --red: #FF9282;
        --red-bg: #48231D;
        --blue: #8FC1F2;
        --blue-bg: #1D3147;
        --gray: #8E8278;
        --shadow: 0 2px 10px rgba(0, 0, 0, .35);
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--brand); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: .3rem 0 .9rem; }
h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
h3 { font-size: 1rem; margin: 1.1rem 0 .3rem; }
p { margin: 0 0 .8rem; }
code { background: var(--soft); padding: .1rem .4rem; border-radius: 8px; font-size: .9em; word-break: break-all; }

.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }

/* ---------- Kopfbereich mit Illustration ---------- */
.hero {
    background: linear-gradient(150deg, var(--hero-a), var(--hero-b));
    background-size: cover; background-position: center;
    padding: calc(env(safe-area-inset-top) + .7rem) 1rem .7rem;
    border-radius: 0 0 26px 26px;
}
.hero-photo { position: relative; padding-top: calc(env(safe-area-inset-top) + 3.4rem); }
.hero-photo::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 25%, rgba(30, 18, 8, .62)); }
.hero-compact { padding: calc(env(safe-area-inset-top) + .35rem) 1rem .35rem; border-radius: 0 0 18px 18px; }
.hero-compact .hero-art { width: 40px; height: 40px; }
.hero-compact .hero-title { font-size: 1.2rem; }
.hero-compact .hero-note { display: none; }
.hero-inner { position: relative; display: flex; align-items: center; gap: .8rem; max-width: 760px; margin: 0 auto; color: var(--hero-text); text-decoration: none; }
.hero-photo .hero-inner { color: #fff; }
.hero-art { width: 68px; height: 68px; flex: 0 0 auto; }
.hero-text { display: flex; flex-direction: column; min-width: 0; }
.hero-title { font-size: 1.65rem; font-weight: 800; letter-spacing: .01em; line-height: 1.15; }
.hero-note { font-size: .9rem; font-weight: 600; margin-top: .15rem; }

.content {
    max-width: 760px; margin: 0 auto;
    padding: 1rem 1rem calc(var(--tab-h) + env(safe-area-inset-bottom) + 1.4rem);
}

/* ---------- Leiste unten: Tiere, Verlauf, Zuordnen, Mehr ---------- */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    display: flex; justify-content: space-around;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--card); border-top: 1px solid var(--line);
}
.tabbar a {
    position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--muted); text-decoration: none; font-size: .68rem; font-weight: 600; letter-spacing: -.01em;
}
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--brand); }
.tabbar a.active::before { content: ""; position: absolute; top: 0; width: 42px; height: 4px; border-radius: 0 0 4px 4px; background: var(--brand); }
.badge {
    position: absolute; top: 6px; left: calc(50% + 6px);
    background: var(--red); color: #fff; border-radius: 11px; padding: 0 6px;
    font-size: .7rem; font-weight: 700; line-height: 1.6; white-space: nowrap;
}

.badge-quiet { background: var(--gray); }

/* ---------- Live ---------- */
.live-grid { display: grid; grid-template-columns: 1fr; gap: .8rem; }
@media (orientation: landscape), (min-width: 760px) {
    .live-grid.live-count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .live-grid.live-count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.live-cam { display: block; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.live-video { position: relative; aspect-ratio: 16 / 9; background: #1b1512; display: flex; align-items: center; justify-content: center; }
.live-video fw-live-video, .live-video video { display: block; width: 100%; height: 100%; object-fit: contain; }
.live-label, .live-bar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem .8rem; }
.live-name { font-weight: 800; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-chip { flex: 0 0 auto; padding: .1rem .7rem; border-radius: 999px; font-size: .88rem; font-weight: 700; background: var(--soft); color: var(--muted); }
.live-chip.live-live { background: var(--green-bg); color: var(--green); }
.live-chip.live-offline { background: var(--red-bg); color: var(--red); }
.live-single { position: fixed; inset: 0; z-index: 40; background: #14100d; color: #fff; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.live-single[hidden] { display: none; }
.live-single .live-bar { color: #fff; }
.live-single .live-name { flex: 1; }
.live-video-big { flex: 1; aspect-ratio: auto; min-height: 0; }
.live-nav { display: flex; justify-content: space-between; gap: .6rem; padding: .6rem .8rem; }
.live-nav .btn { flex: 1; }
.live-single .btn { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #fff; }
.live-back { flex: 0 0 auto; }
body.live-open { overflow: hidden; }

.quick { display: flex; align-items: center; justify-content: space-between; gap: .8rem; min-height: 56px; padding: .6rem 1rem; margin: 0 0 1rem;
    border-radius: var(--radius); background: var(--blue-bg); color: var(--text); text-decoration: none; }
.quick-go { flex: 0 0 auto; font-weight: 800; color: var(--brand); }

/* ---------- Ueberwachung ---------- */
.alarm { border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; border: 2px solid var(--red); background: var(--red-bg); }
.alarm-acked { border-color: var(--line); background: var(--card); }
.alarm-text { font-weight: 800; font-size: 1.15rem; line-height: 1.35; margin-bottom: .3rem; }
.alarm .actions { flex-direction: column; }
.alarm .btn-wide { margin-top: 0; }
.device { border-top: 1px solid var(--line); padding: .8rem 0; }
.device-head { display: flex; gap: .8rem; }
.device-head .light { margin-top: .3rem; border: 0; }
.device-here { display: none; font-size: .8rem; font-weight: 700; color: var(--brand); margin-left: .3rem; }
.device.this-device .device-here { display: inline; }
.device-off { color: var(--red); font-weight: 700; }
#push-device:empty { display: none; }
.push-box { border-radius: 14px; padding: .9rem; margin-bottom: .9rem; background: var(--soft); }
.push-box.on { background: var(--green-bg); }
.push-box.off { background: var(--red-bg); }
.push-box b { display: block; margin-bottom: .3rem; font-size: 1.05rem; }
.push-box .input { margin: .5rem 0; }
.guide { border-top: 1px solid var(--line); padding: .3rem 0; }
.guide summary, .window summary { min-height: 48px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { display: flex; align-items: center; gap: .8rem; padding: .5rem 0; counter-increment: step; }
.steps li span::before { content: counter(step) ". "; font-weight: 800; }
.guide-art { width: 76px; height: 76px; flex: 0 0 auto; }
.g-phone { fill: var(--card); stroke: var(--muted); stroke-width: 2.5; }
.g-screen { fill: var(--soft); }
.g-app { fill: var(--line); }
.g-accent { fill: var(--brand); }
.g-dot { fill: var(--muted); }
.g-line { fill: none; stroke: var(--text); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.g-line-thin { fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.g-white { stroke: #fff; }
.g-strike { stroke: var(--red); stroke-width: 3; stroke-linecap: round; }
.window { border-top: 1px solid var(--line); padding: .9rem 0; }
.window:first-of-type { border-top: 0; }
.unit { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 0; }
.unit .input { min-width: 0; }
.override { display: flex; align-items: center; gap: .5rem; margin: .4rem 0; }
.override > span { flex: 1 1 30%; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.override .unit { flex: 0 0 30%; }
.history { border-top: 1px solid var(--line); padding: .7rem 0; }
.history:first-of-type { border-top: 0; }
.history-time { font-weight: 700; }
.last-shot { display: block; margin: 0 0 1rem; border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--muted); }
.last-shot img { display: block; width: 100%; max-height: 46vh; object-fit: cover; }
.last-shot span { display: block; padding: .5rem .8rem; font-size: .92rem; }

/* ---------- Bausteine ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; box-shadow: var(--shadow); }
.card-gap { margin-top: 1.2rem; }

.note { border-radius: 14px; padding: .75rem 1rem; margin: 0 0 1rem; }
.note-red { background: var(--red-bg); color: var(--red); }
.note-yellow { background: var(--yellow-bg); color: var(--text); }
.note-blue { background: var(--blue-bg); color: var(--text); }
.note-green { background: var(--green-bg); color: var(--green); font-weight: 600; }

.tag { display: inline-block; padding: .15rem .7rem; border-radius: 999px; background: var(--soft); color: var(--text); font-size: .92rem; font-weight: 600; max-width: 100%; }
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-yellow { background: var(--yellow-bg); color: var(--yellow); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-blue { background: var(--blue-bg); color: var(--blue); }
.tag-gray { background: var(--soft); color: var(--muted); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    min-height: 48px; padding: .55rem 1.1rem;
    border: 1.5px solid var(--line); border-radius: 14px;
    background: var(--card); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-text); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-quiet { background: transparent; color: var(--muted); }
.btn-big { min-height: 56px; font-size: 1.1rem; width: 100%; }
.btn-wide { width: 100%; margin-top: .7rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }

.input, .select, .search, .login-form input {
    width: 100%; min-height: 50px; padding: .6rem .9rem;
    border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); font: inherit;
}
.search { margin-bottom: 1rem; }
.select { margin-bottom: .7rem; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .8rem; flex: 1; min-width: 0; }
.field > span { font-weight: 600; font-size: .95rem; }
.two { display: flex; gap: .7rem; }
.check { display: flex; align-items: center; gap: .7rem; min-height: 48px; font-weight: 600; }
.check input { width: 26px; height: 26px; accent-color: var(--brand); flex: 0 0 auto; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.inline-form .input { flex: 1 1 180px; }

.back { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 600; }
.list-title { margin-top: 1.2rem; }
.plain { margin: .2rem 0 .6rem; padding-left: 1.1rem; }

.line { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.line:first-of-type { border-top: 0; }
.line-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: flex; flex-direction: column; }

/* ---------- Ampel ---------- */
.light { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: var(--gray); border: 3px solid var(--card); flex: 0 0 auto; }
.light-green { background: var(--green); }
.light-yellow { background: #E5A823; }
.light-red { background: var(--red); }
.light-gray { background: var(--gray); }

/* ---------- Tiere (Startseite) ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1rem; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.tile {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--card); color: var(--text); text-decoration: none;
    border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.tile-green { border-color: var(--green); }
.tile-yellow { border-color: #E5A823; }
.tile-red { border-color: var(--red); }
.tile-photo { position: relative; aspect-ratio: 1 / 1; background: var(--soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tile-photo img { width: 100%; height: 100%; object-fit: cover; }
.tile-art { width: 72%; height: 72%; }
.tile-photo .light { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; }
.tile-body { padding: .6rem .75rem .8rem; }
.tile-name { font-weight: 800; font-size: 1.2rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-label { font-size: .88rem; color: var(--muted); }
.tile-ago { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.tile-time { font-size: .92rem; color: var(--muted); }
.tile-green .tile-ago { color: var(--green); }
.tile-yellow .tile-ago { color: var(--yellow); }
.tile-red .tile-ago { color: var(--red); }

/* ---------- Verlauf ---------- */
.day { margin: 1.1rem 0 .5rem; color: var(--muted); font-size: 1rem; }
.visit { display: flex; gap: .85rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; margin-bottom: .7rem; box-shadow: var(--shadow); }
.visit-open { border-color: var(--green); }
.visit-thumb { flex: 0 0 104px; height: 104px; border-radius: 14px; overflow: hidden; background: var(--soft); display: flex; align-items: center; justify-content: center; }
.visit-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-art { width: 78%; height: 78%; }
.visit-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .25rem; align-items: flex-start; }
.visit-title { font-weight: 800; font-size: 1.15rem; line-height: 1.25; }
.visit-title a { color: var(--text); text-decoration: none; }
.visit-meta { color: var(--muted); font-size: .92rem; display: flex; flex-wrap: wrap; column-gap: .35rem; }
.visit-meta span + span::before { content: "· "; }
.visit .btn { min-height: 48px; padding: .4rem .9rem; margin-top: .15rem; }
.correct { display: flex; flex-wrap: wrap; gap: .4rem; }

.animal-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.animal-photo { width: 104px; height: 104px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; background: var(--soft); display: flex; align-items: center; justify-content: center; }
.animal-photo img { width: 100%; height: 100%; object-fit: cover; }
.animal-head h1 { margin: 0 0 .2rem; }
.animal-last { color: var(--muted); }

.seg { display: flex; background: var(--soft); border-radius: 14px; padding: 4px; margin-bottom: 1rem; }
.seg button { flex: 1; min-height: 48px; border: 0; border-radius: 11px; background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.seg button.active { background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, .16); color: var(--brand); }
.field .seg { margin-bottom: 0; }

.chart { width: 100%; height: auto; display: block; }
.chart-bar { fill: var(--brand); }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-label { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.chart-value { fill: var(--text); font-size: 11px; font-weight: 700; text-anchor: middle; }

/* ---------- Zuordnen ---------- */
.assign { display: flex; flex-direction: column; gap: .55rem; }
.assign-with-behavior .assign-image { height: min(23vh, 340px); }
.assign-info { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: 1.25rem; }
.assign-info .muted { font-size: .95rem; font-weight: 600; }
.assign-image { position: relative; background: #1b1512; border-radius: var(--radius); overflow: hidden; height: min(32vh, 400px); display: flex; align-items: center; justify-content: center; }
.assign-image img { width: 100%; height: 100%; object-fit: contain; }
.assign-pill { position: absolute; top: 10px; right: 10px; }
.behavior { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.behavior-btn {
    min-height: 50px; border: 2px solid var(--line); border-radius: 14px;
    background: var(--card); color: var(--text); font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer;
}
.behavior-btn.suggested { border-style: dashed; border-color: var(--gray); }
.behavior-btn.on { background: var(--green); border-color: var(--green); color: #fff; }
.assign-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
@media (min-width: 640px) { .assign-buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.assign-btn {
    display: flex; align-items: center; gap: .6rem; min-height: 58px; padding: .25rem .6rem;
    border: 2px solid var(--brand); border-radius: var(--radius);
    background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.assign-btn:active { background: var(--soft); transform: scale(.98); }
.assign-btn.suggested { background: var(--green-bg); }
.assign-photo { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; background: var(--soft); display: flex; align-items: center; justify-content: center; }
.assign-photo img { width: 100%; height: 100%; object-fit: cover; }
.assign-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.assign-name { font-weight: 800; font-size: 1.1rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-count { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.assign-btn.enough .assign-count { color: var(--green); font-weight: 700; }
.assign-other { display: flex; gap: .5rem; }
.assign-other .btn { flex: 1; padding: .5rem .4rem; }
.preload { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.empty { text-align: center; padding: 1rem 0; }
.empty-art { width: 150px; height: 150px; }

/* ---------- Mehr ---------- */
.menu { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1rem; }
.menu-item {
    display: flex; flex-direction: column; justify-content: center; min-height: 72px; padding: .7rem 2.6rem .7rem 1rem; position: relative;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    color: var(--text); text-decoration: none;
}
.menu-item::after { content: "›"; position: absolute; right: 1rem; top: 50%; transform: translateY(-55%); font-size: 1.8rem; color: var(--muted); }
.menu-title { font-weight: 800; font-size: 1.15rem; }
.menu-text { color: var(--muted); font-size: .95rem; }

.animal-edit-top { display: flex; align-items: center; gap: .9rem; }
.animal-edit-photo { width: 84px; height: 84px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; background: var(--soft); display: flex; align-items: center; justify-content: center; }
.animal-edit-photo img { width: 100%; height: 100%; object-fit: cover; }
.animal-edit-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.filebtn { position: relative; overflow: hidden; }
.filebtn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.filebtn.disabled input { cursor: default; }
.uploads:empty { display: none; }
.upload { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: .6rem; }
.upload-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-bar { height: 10px; border-radius: 5px; background: var(--soft); overflow: hidden; margin: .4rem 0; }
.upload-bar span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.upload-state { font-size: .92rem; color: var(--muted); }
.upload.error .upload-state { color: var(--red); }
.upload.error .upload-bar span { background: var(--red); }

/* ---------- Status / Training ---------- */
.row { display: flex; gap: .8rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.row .light { margin-top: .3rem; border: 0; }
.row-title { font-weight: 800; }
.token { display: block; margin-top: .5rem; padding: .6rem; font-size: .95rem; user-select: all; }

.progress-row { display: flex; align-items: center; gap: .7rem; margin: .45rem 0; }
.progress-name { flex: 0 0 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.progress { flex: 1; display: block; height: 14px; border-radius: 7px; background: var(--soft); overflow: hidden; }
.progress-fill { display: block; height: 100%; background: #E5A823; border-radius: 7px; }
.progress-fill.done { background: var(--green); }
.progress-fill.bad { background: var(--red); }
.progress-num { flex: 0 0 auto; font-variant-numeric: tabular-nums; color: var(--muted); }

.stats { display: flex; gap: .6rem; margin: .7rem 0; }
.stat { flex: 1; background: var(--soft); border-radius: 14px; padding: .7rem .4rem; text-align: center; }
.stat b { display: block; font-size: 1.45rem; }
.stat span { font-size: .85rem; color: var(--muted); }

/* ---------- Login ---------- */
.login { max-width: 400px; margin: 0 auto; padding: 8vh 1.3rem 2rem; text-align: center; }
.login-art { width: 140px; height: 140px; }
.login h1 { font-size: 1.9rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; text-align: left; margin-top: 1rem; }
.login-form label { font-weight: 600; display: flex; flex-direction: column; gap: .3rem; }

/* ---------- Verbindung ---------- */
#blazor-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 50; padding: .8rem 1rem; background: var(--red-bg); color: var(--red); }
#fw-offline { position: fixed; left: 0; right: 0; top: 0; z-index: 60; padding: calc(env(safe-area-inset-top) + .5rem) 1rem .5rem; background: var(--yellow-bg); color: var(--text); text-align: center; }
#components-reconnect-modal { display: none !important; }

/* ---------------------------------------------------------------- Personen und Wege (Ueberwachung) */
.person { border-top: 2px solid var(--line); padding: .9rem 0 .4rem; }
.person h3 { margin: 0 0 .2rem; font-size: 1.2rem; }
.way { padding: .2rem 0 .6rem; }
.way + .way { border-top: 1px dashed var(--line); }
.way-status { font-weight: 600; }
.way .device { border-top: 0; padding: .5rem 0 .3rem 0; }
.qr { background: #fff; border-radius: 14px; padding: 10px; width: min(260px, 80vw); margin: .6rem auto; }
.qr svg { display: block; width: 100%; height: auto; }
.copyline { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .2rem 0; }
.copyline code { flex: 1 1 12rem; overflow-wrap: anywhere; font-size: .95rem; background: var(--line); border-radius: 8px; padding: .5rem .6rem; }
