:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --text: #1d232b;
    --muted: #68717d;
    --border: #dfe2e6;
    --primary: #2f5d8a;
    --primary-hover: #244a6f;
    --danger-bg: #fdecec;
    --danger-text: #9b2323;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .04);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #14181d;
        --surface: #1c2229;
        --text: #e6e9ed;
        --muted: #8d96a1;
        --border: #2c343d;
        --primary: #5b8fc4;
        --primary-hover: #74a3d3;
        --danger-bg: #3a1f22;
        --danger-text: #f2a3a3;
        --shadow: none;
    }
}
:root[data-theme="dark"] {
        --bg: #14181d;
        --surface: #1c2229;
        --text: #e6e9ed;
        --muted: #8d96a1;
        --border: #2c343d;
        --primary: #5b8fc4;
        --primary-hover: #74a3d3;
        --danger-bg: #3a1f22;
        --danger-text: #f2a3a3;
        --shadow: none;
    }

*, *::before, *::after { box-sizing: border-box; }

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

h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
.muted { color: var(--muted); margin-top: 0; }

/* Grundgerüst: Seitenleiste + Inhalt */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px; flex-shrink: 0;
    display: flex; flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1rem .75rem;
    position: sticky; top: 0; height: 100vh;
}
.brand { font-weight: 600; color: var(--text); text-decoration: none; padding: .25rem .5rem 1rem; display: block; line-height: 1.3; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 1rem .5rem .35rem; }
.nav-link {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .6rem; border-radius: 8px;
    color: var(--text); text-decoration: none;
}
.nav-link:hover { background: var(--bg); }
.nav-link.active { background: var(--bg); color: var(--primary); font-weight: 600; }
.nav-sub { padding: .35rem .6rem .35rem 2.4rem; font-size: .9rem; color: var(--muted); }
.nav-sub.active { background: transparent; }
.sidebar-footer { border-top: 1px solid var(--border); padding-top: .75rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sidebar-footer form { margin: 0; }
.user { color: var(--muted); text-decoration: none; padding: .3rem .5rem; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { flex: 1; min-width: 0; }
.mobilebar { display: none; }

.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 26px; height: 26px; color: var(--primary); }

@media (max-width: 800px) {
    .sidebar { position: fixed; z-index: 10; left: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
    .sidebar.open { transform: none; }
    .mobilebar { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); }
    .mobilebar .brand { padding: 0; }
}

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; }

/* Karten */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}
.tile { color: var(--text); text-decoration: none; transition: border-color .15s; }
.tile:hover { border-color: var(--primary); }
.tile-head { display: flex; align-items: center; gap: .6rem; }
.tile h2 { font-size: 1.1rem; margin: 0; }
.tile p { margin: .6rem 0 0; }

.placeholder {
    min-height: 140px;
    display: grid; place-items: center;
    color: var(--muted);
    border-style: dashed;
}

/* Login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 380px; padding: 2rem; }
.auth-card form { display: flex; flex-direction: column; }

label { font-weight: 500; margin: .75rem 0 .3rem; }
input[type=text], input[type=email], input[type=password], select {
    font: inherit;
    padding: .6rem .7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
}
input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; margin: 1rem 0; }

.alert {
    background: var(--danger-bg);
    color: var(--danger-text);
    padding: .6rem .8rem;
    border-radius: 8px;
    margin: .75rem 0 .25rem;
}

/* Buttons */
.btn {
    font: inherit; cursor: pointer;
    border-radius: 8px;
    padding: .55rem 1rem;
    border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg); }
.btn-block { width: 100%; }
.btn-sm { padding: .3rem .6rem; font-size: .875rem; }

/* Seitenkopf, Tabellen, Formulare */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head .btn { text-decoration: none; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: .4rem; justify-content: flex-end; }
.table .actions form { margin: 0; }
.badge { display: inline-block; margin-left: .4rem; padding: .05rem .5rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); font-size: .75rem; color: var(--muted); }
.btn-danger { color: var(--danger-text); }
.notice { background: var(--bg); border: 1px solid var(--border); padding: .6rem .8rem; border-radius: 8px; margin-bottom: 1rem; }
.form-card { max-width: 520px; margin-top: 1rem; }
.stack { display: flex; flex-direction: column; }
.form-actions { display: flex; gap: .5rem; margin-top: 1.25rem; }
.link-back { color: var(--muted); text-decoration: none; }
.link-back:hover { color: var(--text); }
@media (max-width: 600px) { .hide-sm { display: none; } }

/* WEG Mitterweg (Modul Immobilien) */
/* Seitenkopf, Tabs */
.weg .page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.weg .crumb { color: var(--muted); text-decoration: none; font-size: .875rem; }
.weg .crumb:hover { color: var(--primary); }
.weg .tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 1rem 0 1.25rem; }
.weg .tab { padding: .5rem .85rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.weg .tab:hover { color: var(--text); }
.weg .tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.weg h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.weg h2 .muted { font-weight: 400; font-size: .95rem; }
.weg .card + .card, .weg .stats + .card, .weg .card + .stats { margin-top: 1rem; }
.weg .stats .card + .card, .weg .grid .card + .card { margin-top: 0; }

/* Kennzahlen */
.weg .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.weg .stat-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.weg .stat-value { font-size: 1.4rem; font-weight: 600; margin: .2rem 0; font-variant-numeric: tabular-nums; }
.weg .stat-value small { font-size: .8rem; color: var(--muted); font-weight: 400; }
.weg .ok { color: #1e7b45; }
.weg .bad { color: #b42318; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .weg .ok { color: #6fd39a; }
    :root:not([data-theme="light"]) .weg .bad { color: #f29b93; }
}
:root[data-theme="dark"] .weg .ok { color: #6fd39a; }
:root[data-theme="dark"] .weg .bad { color: #f29b93; }

/* Tabellen */
.weg .table-card { padding: 1.25rem 1.25rem .75rem; overflow: visible; }
.weg .table-wrap { overflow-x: auto; }
.weg .table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.weg .table th, .weg .table td { padding: .45rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.weg .table th { font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; text-transform: none; letter-spacing: 0; }
.weg .table tfoot td { font-weight: 600; border-top: 2px solid var(--border); border-bottom: 0; }
.weg .table .num { text-align: right; white-space: nowrap; }
.weg .table .nowrap { white-space: nowrap; }
.weg .table tr.hl td { background: rgba(47, 93, 138, .07); }
.weg .table tr.group td { font-weight: 600; background: var(--bg); }
.weg .table tr.out td { opacity: .4; }
.weg .table-sm th, .weg .table-sm td { padding: .3rem .45rem; font-size: .85rem; }
.weg .table .sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.weg .table th.rot { vertical-align: bottom; height: 9rem; }
.weg .table th.rot span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.weg .estimate { color: #b4580f; font-style: italic; }
.weg .grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; margin-top: 1rem; }
.weg .grid-2 .card + .card { margin-top: 0; }
.weg .notes ul { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.weg .notes li + li { margin-top: .35rem; }

/* Formularelemente, Abstimmung */
.weg .select, .weg .input {
    font: inherit; padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg); color: var(--text);
}
.weg .select-lg { font-size: 1.05rem; font-weight: 600; padding: .55rem .7rem; width: 100%; }
.weg .input { width: 100%; }
.weg .select:disabled { opacity: .5; }
.weg .select.changed { border-color: #d97706; background: #fdf0dc; color: #1d232b; }
.weg .select.missing { border-color: #b42318; background: #fdecec; color: #1d232b; }
.weg .vote-top { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.weg .vote-top .card + .card { margin-top: 0; }
.weg .vote-top label { display: block; }
@media (max-width: 700px) { .weg .vote-top { grid-template-columns: 1fr; } }
.weg .result { display: flex; flex-direction: column; justify-content: center; text-align: center; }
.weg .result-value { font-size: 1.8rem; font-weight: 700; margin: .25rem 0; }
.weg .result.is-ok { background: #e3f4ea; border-color: #9fd7b5; color: #14532d; }
.weg .result.is-bad { background: #fdecec; border-color: #f1b4b4; color: #7f1d1d; }
.weg .result.is-ok .muted, .weg .result.is-bad .muted, .weg .result.is-ok .stat-label, .weg .result.is-bad .stat-label { color: inherit; opacity: .8; }
.weg .badge { margin-left: 0; display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; background: var(--bg); border: 1px solid var(--border); white-space: nowrap; }
.weg .vote-Ja { background: #e3f4ea; color: #14532d; border-color: #9fd7b5; }
.weg .vote-Nein { background: #fdecec; color: #7f1d1d; border-color: #f1b4b4; }
.weg .vote-Enthaltung { background: #fff6d6; color: #713f12; border-color: #ecd68a; }
.weg .vote-Vollmacht { background: #e4eefa; color: #1e3a5f; border-color: #a9c4e6; }
.weg .btn-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

.user:hover, .user.active { color: var(--text); background: var(--bg); }
.notice a { color: var(--primary); }

/* Mein Konto */
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-top: 1rem; }
.account-grid h2 { font-size: 1.1rem; margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.account-grid .badge { margin-left: 0; }
.span-2 { grid-column: 1 / -1; }
.badge-on { background: #e5f4ea; border-color: #b9dfc6; color: #1f6b3a; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .badge-on { background: #1d3426; border-color: #2e5a3d; color: #9fd8b1; }
}
:root[data-theme="dark"] .badge-on { background: #1d3426; border-color: #2e5a3d; color: #9fd8b1; }
.steps { padding-left: 1.25rem; margin: .5rem 0; }
.qr-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; margin: .5rem 0 1rem; }
.qr { background: #fff; padding: 10px; border-radius: 10px; line-height: 0; border: 1px solid var(--border); }
.qr svg { width: 200px; height: 200px; }
.secret { display: inline-block; font-size: 1rem; letter-spacing: .05em; background: var(--bg); padding: .4rem .6rem; border-radius: 6px; word-break: break-all; user-select: all; }
.code-form input { max-width: 200px; font-size: 1.4rem; letter-spacing: .15em; text-align: center; }
.recovery { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; }
.recovery p { margin: 0 0 .5rem; }
.codes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .4rem; }
.codes code { font-size: 1rem; user-select: all; }
.row-actions { display: flex; gap: .5rem; margin: .5rem 0; }
.row-actions form { margin: 0; }
.disable-2fa { max-width: 360px; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Modul-Einstellungen (z. B. Tesla) */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--primary); text-decoration: none; word-break: break-all; }
.inline-form { display: flex; gap: .5rem; }
.inline-form input { flex: 1; min-width: 0; }
.table-title { padding: 1rem 1rem 0; }
.launcher-table td { padding: .55rem 1rem; }
.cell-icon { width: 52px; }
.cell-icon img, .mini-letter { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; display: block; }
.mini-letter { display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 700; }
.mini-letter[hidden] { display: none; }
.folder-row { background: var(--bg); }
.nested .cell-icon { padding-left: 2.25rem; width: 86px; }
.url-cell { font-size: .85rem; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.launcher-table .actions { flex-wrap: wrap; }

/* ETW-Seiten (Modul Immobilien) */
.etw .etw-tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 1rem 0 1.25rem; }
.etw .etw-tabs a { padding: .45rem .8rem; color: var(--muted); text-decoration: none; }
.etw .etw-tabs a:hover { color: var(--primary); }
.etw .facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; }
.etw .fact { padding: .9rem 1rem; }
.etw .fact-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.etw .fact-value { font-size: 1.05rem; font-weight: 600; margin-top: .2rem; }
.etw .fact-hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.etw .section-title { font-size: 1.15rem; margin: 2rem 0 .75rem; scroll-margin-top: 1rem; }
.etw .section-title .muted { font-weight: 400; font-size: .9rem; }
.etw .two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.etw h3 { font-size: 1.05rem; margin: 0 0 .75rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.etw h3 .badge { margin-left: 0; }
.etw h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1rem 0 .4rem; }
.etw .kv { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .35rem 1.25rem; margin: 0; }
.etw .kv dt { color: var(--muted); overflow-wrap: anywhere; hyphens: auto; }
.etw .kv dd { margin: 0; overflow-wrap: anywhere; }
.etw .notes { margin: .75rem 0 0; padding-left: 1.1rem; }
.etw .notes li { margin: .25rem 0; }
.etw .small { font-size: .85rem; }
.etw .loan { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: start; }
.etw .loan-amount { font-size: 1.5rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
@media (max-width: 600px) { .etw .loan { grid-template-columns: 1fr; } .etw .kv { grid-template-columns: 1fr; } .etw .kv dt { margin-top: .4rem; } }

/* Versionen & Changelog */
.app-version { display: block; font-size: .75rem; color: var(--muted); text-decoration: none; padding: .4rem .5rem; }
.app-version:hover { color: var(--primary); }
.module-version { float: right; font-size: .75rem; color: var(--muted); text-decoration: none; border: 1px solid var(--border); border-radius: 999px; padding: .1rem .6rem; margin-left: 1rem; }
.module-version:hover { color: var(--primary); border-color: var(--primary); }
.tile-version { margin-left: auto; }
.chip-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 1.25rem; }
.chip-link { padding: .35rem .8rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text); text-decoration: none; background: var(--surface); }
.chip-link:hover { border-color: var(--primary); }
.chip-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-link.active .muted { color: rgba(255,255,255,.8); }
.release { margin-bottom: .75rem; }
.release-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.release-head .badge { margin-left: 0; }
.release-list { margin: .6rem 0 0; padding-left: 1.1rem; }
.release-list li { margin: .3rem 0; }
.tag { display: inline-block; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: .05rem .45rem; border-radius: 4px; margin-right: .35rem; background: var(--bg); border: 1px solid var(--border); color: var(--muted); }
.tag-tesla { color: #c0392b; border-color: #e8b4ae; }
.tag-immobilien { color: #1f6b3a; border-color: #b9dfc6; }
.tag-dashboard { color: var(--primary); }
.etw .doc-link { margin-left: auto; font-size: .8rem; font-weight: 500; color: var(--primary); text-decoration: none; }
.etw .doc-link:hover { text-decoration: underline; }

/* Dokumente (Modul Immobilien) */
.docs .upload { margin: 1rem 0; }
.docs .dropzone { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1.5rem 1rem; border: 2px dashed var(--border); border-radius: var(--radius); cursor: pointer; text-align: center; margin: 0; font-weight: 400; }
.docs .dropzone:hover, .docs .dropzone.drag { border-color: var(--primary); background: var(--bg); }
.docs .dropzone.has-files { border-style: solid; border-color: var(--primary); }
.docs .dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.docs .upload-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.docs .upload-fields > div { display: flex; flex-direction: column; }
.docs .span-all { grid-column: 1 / -1; }
.docs .doc { margin-bottom: .75rem; }
.docs .doc-head { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; align-items: flex-start; }
.docs .doc-title { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.docs .doc-title .badge { margin-left: 0; }
.docs .doc-actions { display: flex; gap: .4rem; }
.docs .small { font-size: .85rem; margin-top: .25rem; }
.docs .doc-note { margin: .5rem 0 0; font-style: italic; }
.docs .status-neu { background: #fff4d6; border-color: #f0d68a; color: #7a5a00; }
.docs .status-vorgeschlagen { background: #e3ecfb; border-color: #b5c9ee; color: #244a8f; }
.docs .status-verarbeitet { background: #e5f4ea; border-color: #b9dfc6; color: #1f6b3a; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .docs .status-neu { background: #3a3218; border-color: #6b5a24; color: #f0d68a; }
    :root:not([data-theme="light"]) .docs .status-vorgeschlagen { background: #1d2a40; border-color: #33507f; color: #a9c2ee; }
    :root:not([data-theme="light"]) .docs .status-verarbeitet { background: #1d3426; border-color: #2e5a3d; color: #9fd8b1; }
}
:root[data-theme="dark"] .docs .status-neu { background: #3a3218; border-color: #6b5a24; color: #f0d68a; }
:root[data-theme="dark"] .docs .status-vorgeschlagen { background: #1d2a40; border-color: #33507f; color: #a9c2ee; }
:root[data-theme="dark"] .docs .status-verarbeitet { background: #1d3426; border-color: #2e5a3d; color: #9fd8b1; }
.docs .proposal { margin-top: .75rem; padding: .75rem 1rem; border-left: 3px solid var(--primary); background: var(--bg); border-radius: 6px; }
.docs .proposal-head { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); font-weight: 600; margin-bottom: .25rem; }
.docs .proposal p { margin: .4rem 0; }
.docs .proposal ul { margin: .4rem 0; padding-left: 1.2rem; }
.docs .doc-edit { margin-top: .75rem; }
.docs .doc-edit summary { cursor: pointer; color: var(--muted); }
.docs .doc-edit form { margin-top: .5rem; }

/* API-Schlüssel */
.key-new { margin: 1rem 0; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; border-color: var(--primary); }
.key-value { font-size: 1rem; background: var(--bg); padding: .35rem .6rem; border-radius: 6px; user-select: all; word-break: break-all; }
.kv-simple { display: grid; grid-template-columns: minmax(7rem, max-content) 1fr; gap: .4rem .75rem; margin: 0; }
.kv-simple dt { color: var(--muted); }
.kv-simple dd { margin: 0; word-break: break-all; }
.docs .proposal.done { border-left-color: #1f8a4c; }
.docs .proposal.done .proposal-head { color: #1f8a4c; }
/* Tesla: Erweiterungen, Kontexte, Notizen */
.small-hint { font-size: .85rem; margin: .3rem 0 0; }
.context-set { border: 1px solid var(--border); border-radius: 8px; padding: .25rem .9rem .75rem; margin: 1rem 0 0; }
.context-set legend { font-weight: 500; padding: 0 .3rem; }
.context-set .check { margin: .5rem 0; }
.launcher-table .badge { margin: .15rem .25rem 0 0; }
.notes-table td { vertical-align: top; }
.note-date { white-space: nowrap; width: 1%; font-size: .85rem; }
.note-cell { white-space: pre-wrap; word-break: break-word; }

.etw .table.compact th, .etw .table.compact td { padding: .45rem .75rem; }
.etw .table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.etw .table tr.sum td { font-weight: 600; border-top: 2px solid var(--border); }
.etw .table-wrap { overflow-x: auto; }
.etw .open-list li::marker { content: "☐ "; }
.weg .grid.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; margin: 1rem 0; }
.weg .grid.two .card + .card { margin-top: 0; }
.weg .card ul { margin: 0; padding-left: 1.1rem; }
.weg .card li { margin: .3rem 0; }
.weg .todo li::marker { content: "☐ "; }
.weg .rules { display: grid; grid-template-columns: 220px 1fr; gap: .5rem 1rem; margin: 0; }
.weg .rules dt { font-weight: 600; }
.weg .rules dd { margin: 0; }
@media (max-width: 700px) { .weg .rules { grid-template-columns: 1fr; } .weg .rules dd { margin-bottom: .5rem; } }

/* Foto-Galerie (Immobilien) */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.gallery figure { margin: 0; }
.gallery-item { display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; background: var(--surface); aspect-ratio: 4 / 3; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.gallery-item:hover img { transform: scale(1.03); }
.gallery figcaption { font-size: .85rem; color: var(--muted); margin-top: .3rem; text-align: center; }
.foto-dialog { max-width: 95vw; max-height: 95vh; padding: .5rem; border: 0; border-radius: 12px; background: var(--surface); color: var(--text); }
.foto-dialog::backdrop { background: rgba(0,0,0,.8); }
.foto-dialog img { display: block; max-width: calc(95vw - 1rem); max-height: calc(95vh - 5rem); margin: 0 auto; border-radius: 8px; }
.foto-close { position: absolute; top: .75rem; right: .75rem; background: var(--surface); }
.foto-bar { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: .5rem 0 0; flex-wrap: wrap; }

/* Dokumente: Ordnerstruktur */
.docs-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.25rem; align-items: start; margin-top: 1rem; }
.docs .folder-tree { position: sticky; top: 1rem; padding: .6rem; display: flex; flex-direction: column; gap: .15rem; max-height: calc(100vh - 2rem); overflow: auto; }
.docs .folder-tree .folder summary { list-style: none; cursor: pointer; }
.docs .folder-tree .folder summary::-webkit-details-marker { display: none; }
.docs .folder-link { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem .55rem; border-radius: 6px; color: var(--text); text-decoration: none; font-size: .9rem; line-height: 1.3; }
.docs .folder-link:hover { background: var(--bg); }
.docs .folder-link.active { background: var(--primary); color: #fff; }
.docs .folder-link.active .count, .docs .folder-link.active .muted { color: #fff; opacity: .85; }
.docs .folder-link.top { font-weight: 600; }
.docs .folder-link.sub { padding-left: 1.7rem; }
.docs .folder-link.special { font-weight: 500; }
.docs .folder-link .count { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .8rem; }
.docs .folder-tree .folder { margin: .2rem 0; }
.docs .folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.docs .folder-card h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.docs .folder-card h2 a { color: inherit; text-decoration: none; }
.docs .folder-card ul { margin: 0; padding-left: 1.1rem; }
.docs .folder-card li { margin: .2rem 0; }
.docs .folder-title { font-size: 1.15rem; margin: 0 0 .75rem; }
.docs .status-loeschbar { background: #f6e3e3; border-color: #e3b5b5; color: #8f2424; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .docs .status-loeschbar { background: #3a1d1d; border-color: #6b2e2e; color: #eea9a9; }
}
:root[data-theme="dark"] .docs .status-loeschbar { background: #3a1d1d; border-color: #6b2e2e; color: #eea9a9; }
@media (max-width: 800px) { .docs-layout { grid-template-columns: 1fr; } .docs .folder-tree { position: static; max-height: none; } }

/* Datengetriebene Abschnitte (ETW) */
.etw .stack-cards { display: flex; flex-direction: column; gap: 1rem; }
.etw .table-card-title { margin: 0; padding: .9rem 1rem .25rem; font-size: 1rem; }
.etw .table-card-note { margin: 0; padding: .5rem 1rem .9rem; }

/* Navigation: dritte Ebene (z. B. ETW → Auffälligkeiten) */
.nav-sub2 { padding-left: 3.2rem; font-size: .85rem; }

/* Auffälligkeiten */
.findings .filter { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 1rem; }
.findings .group-title { margin: 1.5rem 0 .6rem; font-size: 1.05rem; }
.findings .finding { display: grid; grid-template-columns: auto 1fr; gap: .25rem .9rem; margin-bottom: .6rem; padding: .85rem 1rem; }
.findings .prio { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .2rem .5rem; border-radius: 999px; align-self: start; white-space: nowrap; }
.findings .prio-hoch { background: #fde2e1; color: #8f2424; }
.findings .prio-mittel { background: #fff1d1; color: #7a5a00; }
.findings .prio-niedrig { background: #e3ecfb; color: #244a8f; }
.findings .prio-info { background: var(--bg); color: var(--muted); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .findings .prio-hoch { background: #3a1d1d; color: #f2a9a9; }
    :root:not([data-theme="light"]) .findings .prio-mittel { background: #3a3218; color: #f0d68a; }
    :root:not([data-theme="light"]) .findings .prio-niedrig { background: #1d2a40; color: #a9c2ee; }
}
:root[data-theme="dark"] .findings .prio-hoch { background: #3a1d1d; color: #f2a9a9; }
:root[data-theme="dark"] .findings .prio-mittel { background: #3a3218; color: #f0d68a; }
:root[data-theme="dark"] .findings .prio-niedrig { background: #1d2a40; color: #a9c2ee; }
.findings .finding h3 { margin: 0; font-size: .98rem; }
.findings .finding p { margin: .2rem 0 0; }
.findings .finding .meta { grid-column: 2; font-size: .8rem; color: var(--muted); }
.findings .finding.done { opacity: .6; }
.findings .finding.done h3 { text-decoration: line-through; }

/* Tesla-Einstellungen: Erweiterungen testen */
.ext-test { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.ext-test h3 { margin: 0 0 .25rem; font-size: 1rem; }
.ext-test-buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.ext-test-result { display: flex; flex-direction: column; gap: .5rem; }
.ext-test-row { padding: .6rem .8rem; border-radius: 8px; border-left: 3px solid var(--border); background: var(--bg); font-size: .9rem; }
.ext-test-row.ok { border-left-color: #2e9e5b; }
.ext-test-row.fail { border-left-color: #d64545; }
textarea { font: inherit; }
.etw .etw-tabs a.tab-findings { margin-left: auto; color: var(--primary); font-weight: 600; }


/* Darstellung umschalten (Auto / Hell / Dunkel) */
.theme-switch { display: flex; gap: .25rem; margin: .5rem .6rem; padding: .2rem; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); }
.theme-switch button { flex: 1; padding: .3rem .4rem; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer; }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
