/* Hausverwaltung (needs shell.css first) – one calm, modern design for every page (light + dark). No external fonts or resources.
   Layout: sidebar on wide screens, tab bar at the bottom on phones. Icons: local Lucide sprite (icons.svg). */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15.5px/1.55 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; margin: 0; }
h2 { font-size: 1.08rem; margin: 0; }
h2 a { color: inherit; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* ---------- Layout ---------- */
main { max-width: 1160px; margin: 0 auto; padding: 28px 28px 48px; }
body.app main { margin-left: calc(var(--sidebar) + max(0px, (100vw - var(--sidebar) - 1160px) / 2)); }
/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 0 0 18px; }
.card.flush { padding: 6px 0; }
.card.flush table th:first-child, .card.flush table td:first-child { padding-left: 20px; }
.card.flush table th:last-child, .card.flush table td:last-child { padding-right: 20px; }
.card-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.card-head p { margin: 2px 0 0; font-size: .88rem; }
.chip-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent); }
.accent-card { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.grid > .card { margin: 0; }
.grid + .card, .card + .grid, .grid + .grid { margin-top: 18px; }
.callout { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.callout > .icon { width: 26px; height: 26px; color: var(--accent); }
.callout > div { flex: 1 1 240px; display: flex; flex-direction: column; }
.empty-state { text-align: center; padding: 28px 16px; }
.empty-state p { color: var(--muted); max-width: 52ch; margin: 8px auto 16px; }
.big-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.big-icon .icon { width: 26px; height: 26px; }

/* ---------- Stats, progress, steps ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { display: flex; gap: 14px; align-items: center; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); }
a.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat > .icon { width: 38px; height: 38px; padding: 9px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.stat b { display: block; font-size: 1.45rem; line-height: 1.1; }
.stat span { font-size: .84rem; color: var(--muted); }
.stat.attention > .icon { background: var(--warn-soft); color: var(--warn); }
.period-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 14px 16px; margin: 0 0 18px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.card .period-bar { margin: 0 0 6px; }
.period-bar > .icon { width: 24px; height: 24px; color: var(--accent); }
.period-bar > div { flex: 1 1 260px; display: flex; flex-direction: column; font-size: .92rem; }
.period-bar span { color: var(--muted); }
.period-bar.soon { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.period-bar.soon > .icon { color: var(--warn); }
.period-bar.late { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.period-bar.late > .icon { color: var(--bad); }
progress { appearance: none; width: 140px; height: 8px; border: 0; border-radius: 99px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; }
progress::-webkit-progress-bar { background: color-mix(in srgb, var(--ink) 10%, transparent); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.progress-label { color: var(--muted); font-weight: 600; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.steps li { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.step-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.step-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.step-body span { font-size: .88rem; color: var(--muted); }
.steps li.done { background: var(--surface-2); }
.steps li.done .step-icon { background: var(--good-soft); color: var(--good); border-color: transparent; }
.steps li.done b { color: var(--muted); font-weight: 600; }
.steps li.current { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.steps li.current .step-icon { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.stepper { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; counter-reset: step; }
.stepper li { flex: 1; display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .88rem; }
.stepper li.done { color: var(--good); background: var(--good-soft); border-color: transparent; }
.stepper li.current { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Lists ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows li > a, .rows li:not(:has(a)) { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 10px 2px; color: var(--ink); }
.rows li > a:hover { text-decoration: none; color: var(--accent); }
.rows small { display: block; color: var(--muted); font-size: .8rem; }
.rows .icon { color: var(--muted); }
.howto { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.howto li { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; }
.howto .icon { margin-top: 2px; color: var(--accent); }
.tag { display: inline-block; padding: 2px 9px; margin: 1px 4px 1px 0; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: .8rem; color: var(--ink); white-space: nowrap; }
.tag.let { background: color-mix(in srgb, var(--let) 14%, transparent); border-color: transparent; }
.tag.vacant { color: var(--muted); }
.tag.ok { background: var(--good-soft); color: var(--good); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* ---------- Forms & buttons ---------- */
label { display: block; margin: 0 0 12px; font-weight: 600; font-size: .88rem; }
label > .icon { color: var(--muted); margin-right: 4px; }
input, select, textarea { display: block; width: 100%; min-height: 44px; margin-top: 5px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=checkbox] { display: inline-block; width: 20px; min-height: 20px; height: 20px; margin: 0 6px 0 0; accent-color: var(--accent); vertical-align: middle; }
input[type=file] { padding: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 18px; }
.form-grid > div:has(textarea) { grid-column: 1 / -1; }
.helptext { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.errorlist { color: var(--bad); margin: 4px 0; padding-left: 1em; font-size: .86rem; }
.filters, .assign, .delivery { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters label, .delivery label { margin: 0; }
.filters input, .filters select, .assign select, .assign input { width: auto; margin-top: 5px; }
.assign select, .assign input { margin-top: 0; }
button, .button { display: inline-flex; gap: 7px; align-items: center; justify-content: center; min-height: 42px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: .92rem;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
button:hover, .button:hover { border-color: var(--accent); text-decoration: none; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover, .button.primary:hover { background: var(--accent-strong); }
button.ghost, .button.ghost { background: transparent; }
button.sm, .button.sm { min-height: 36px; padding: 6px 12px; font-size: .86rem; }
button.wide { width: 100%; }
button:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 0; }
.actions input { width: auto; flex: 1 1 220px; margin: 0; }
.sticky-actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.hint { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: .88rem; margin: 12px 0 0; }
.hint .icon { margin-top: 3px; }
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 16px; }
.tips p { display: flex; gap: 10px; margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: .86rem; color: var(--muted); }
.tips .icon { margin-top: 2px; color: var(--accent); }
.tips b { color: var(--ink); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
tr.muted td { color: var(--muted); }
.small-table { font-size: .84rem; }
.small, .small-table th { font-size: .8rem; }
.muted { color: var(--muted); }
.lines td { vertical-align: top; }
.lines input, .lines select { min-width: 110px; margin: 0; }

/* ---------- Statement parties ---------- */
.parties { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.party { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface); }
.party header { display: flex; flex-direction: column; margin-bottom: 10px; }
.party header small { color: var(--muted); }
.party dl { margin: 0 0 10px; }
.party dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.party dt { color: var(--muted); }
.party dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.party dd small { display: block; font-weight: 400; color: var(--muted); font-size: .76rem; }
.party .credit dd { color: var(--good); font-size: 1.15rem; }
.party .due dd { color: var(--bad); font-size: 1.15rem; }
.party details { margin-top: 6px; }
.party:has(details[open]) { grid-column: 1 / -1; }
.delivery { margin-top: 12px; }
.delivery label { flex: 1 1 140px; font-size: .8rem; }

/* ---------- Messages & checks ---------- */
.msg { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; background: var(--good-soft); color: var(--good); font-weight: 600; }
.msg .icon { margin-top: 2px; }
.msg.error { background: var(--bad-soft); color: var(--bad); }
.msg.warning { background: var(--warn-soft); color: var(--warn); }
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: .92rem; }
.checks li .icon { margin-top: 2px; }
.checks li.error { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.checks li.warning { background: var(--warn-soft); color: var(--warn); }
.checks li.info { background: var(--surface-2); color: var(--muted); }
.ok-line { display: flex; gap: 8px; align-items: center; color: var(--good); font-weight: 600; margin: 0; }
details { margin: 8px 0; }
summary { cursor: pointer; font-weight: 600; color: var(--accent); font-size: .9rem; }

/* ---------- Login / 2FA ---------- */
.auth { max-width: 420px; margin: 9vh auto; padding: 32px 28px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.auth h1 { margin-bottom: 6px; }
.auth > p { font-size: .92rem; margin: 0 0 20px; }
.auth form { text-align: left; margin-top: 8px; }
.qr { display: block; width: 220px; height: 220px; margin: 12px auto; background: #fff; border-radius: 12px; padding: 8px; }
.secret { word-break: break-all; }

/* ---------- 3D ---------- */
.house3d { width: 100%; height: min(60vh, 540px); border-radius: 12px; position: relative; touch-action: none; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--let) 18%, var(--surface)), var(--surface-2)); }
.house3d .tip { position: absolute; pointer-events: none; background: rgba(23, 33, 43, .94); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: .84rem; white-space: nowrap; transform: translate(-50%, -125%); }
.house3d .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 24px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; font-size: .85rem; color: var(--muted); }
.sw { display: inline-block; width: .85em; height: .85em; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw.let { background: var(--let); } .sw.own { background: var(--own); } .sw.vacant { background: var(--vacant); }

/* ---------- Phones & tablets ---------- */
@media (max-width: 960px) {
  body.app main { margin: 0 auto; padding: 18px 16px calc(88px + env(safe-area-inset-bottom)); }
  .sticky-actions { bottom: calc(68px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 1.35rem; }
  .page-head { gap: 12px; margin-bottom: 16px; }
  .page-icon { width: 40px; height: 40px; border-radius: 12px; }
  .lead { font-size: .9rem; }
  .card { padding: 16px; border-radius: 12px; }
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px; gap: 10px; }
  .stat > .icon { width: 32px; height: 32px; padding: 7px; }
  .stat b { font-size: 1.2rem; }
  .steps li { flex-wrap: wrap; }
  .step-body { flex: 1 1 calc(100% - 50px); }
  .steps li .button { margin-left: 48px; }
  .stepper li span { display: none; }
  .stepper li { justify-content: center; }
  .card-head .push { margin-left: 0; }
  .card-head { flex-wrap: wrap; }
  .card-head > div { flex: 1 1 200px; }
  .toolbar .push { margin-left: 0; }
  /* tables marked .stack and the receipt lines become one block per row */
  table.stack, table.stack tbody, table.stack tr, table.stack td,
  table.lines, table.lines tbody, table.lines tr, table.lines td { display: block; width: 100%; }
  table.stack tr:first-child, table.lines tr:first-child { display: none; }
  table.stack tr, table.lines tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .card.flush table.stack tr { padding: 10px 16px; }
  table.stack td, table.lines td { border: 0; padding: 3px 0 !important; text-align: left; }
  table.stack td[data-l]::before, table.lines td[data-l]::before { content: attr(data-l); display: block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  table.stack td.n { text-align: left; }
}

/* ---------- Master data overview ---------- */
.md-section { margin-bottom: 26px; }
.md-section > p { margin: 2px 0 12px; font-size: .9rem; }
.md-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.md-card { display: flex; flex-direction: column; margin: 0; padding: 16px; }
.md-main { display: flex; gap: 12px; align-items: flex-start; color: var(--ink); flex: 1; }
.md-main:hover { text-decoration: none; }
.md-main:hover b { color: var(--accent); }
.md-text { flex: 1; display: flex; flex-direction: column; }
.md-text span { font-size: .86rem; color: var(--muted); }
.md-count { min-width: 32px; padding: 2px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; text-align: center; }
.md-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- Scan, documents ---------- */
.scan-layout { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.6fr); gap: 18px; align-items: start; }
.scan-layout > .card { margin: 0; }
.ocr { max-height: 340px; overflow: auto; white-space: pre-wrap; font-size: .78rem; background: var(--surface-2); padding: 12px; border-radius: 10px; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0 0 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; }
.segmented a { flex: 1; text-align: center; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .88rem; }
.segmented a:hover { text-decoration: none; color: var(--ink); }
.segmented a[aria-current] { background: var(--surface); color: var(--accent-strong); box-shadow: var(--shadow); }
.spin .icon { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin .icon { animation: none; } }
.big-icon.bad { background: var(--bad-soft); color: var(--bad); }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
button.danger:hover { border-color: var(--bad); color: var(--bad); }
td.bad { color: var(--bad); font-weight: 600; } td.good { color: var(--good); }
@media (max-width: 800px) { .scan-layout { grid-template-columns: 1fr; } }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 0 0 18px; }
.quick a { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.quick a:not(:first-child) { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.quick a:hover { text-decoration: none; filter: brightness(1.05); }
.quick a .icon { width: 26px; height: 26px; }
.quick a:not(:first-child) .icon { color: var(--accent); }
.quick small { display: block; font-size: .8rem; opacity: .8; }
@media (max-width: 640px) { .quick { grid-template-columns: 1fr 1fr; } .quick small { display: none; } .quick a { padding: 12px; } }
.sw.arrears { background: transparent; border: 2px solid #d62828; }

/* ---------- Finances ---------- */
:root { --series-in: #2a78d6; --series-out: #eb6834; }
@media (prefers-color-scheme: dark) { :root { --series-in: #3987e5; --series-out: #d95926; } }
.section-title { display: flex; gap: 8px; align-items: center; margin: 6px 0 14px; font-size: 1.15rem; }
.section-title .icon { color: var(--accent); }
.chart-wrap { overflow-x: auto; }
.chart { width: 100%; min-width: 560px; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--muted); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar.s-in { fill: var(--series-in); }
.chart .bar.s-out { fill: var(--series-out); }
.chart .hit { fill: transparent; }
.chart .month:hover .hit { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.sw.s-in { background: var(--series-in); } .sw.s-out { background: var(--series-out); }
.kv { margin: 0 0 8px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv .sum dt { color: var(--ink); font-weight: 700; }
.kv .sum { border-bottom: 2px solid var(--line); }
dd.bad { color: var(--bad); } dd.good { color: var(--good); }
.cost-bars { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cost-line { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.cost-line b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-bars progress { width: 100%; height: 6px; margin: 4px 0 2px; }
.cost-bars progress::-webkit-progress-value { background: var(--series-out); }
.cost-bars progress::-moz-progress-bar { background: var(--series-out); }
.cost-bars small { font-size: .76rem; }

/* ---------- In-app editing ---------- */
.fs { display: flex; flex-direction: column; gap: 10px; }
.fs-row { position: relative; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.fs-row .form-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.fs-row label { margin-bottom: 4px; }
.fs-new { border-style: dashed; background: transparent; }
.fs-badge { display: inline-flex; gap: 4px; align-items: center; margin-bottom: 8px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.fs-delete { display: inline-flex; gap: 6px; align-items: center; margin: 6px 0 0; color: var(--bad); font-weight: 600; font-size: .85rem; cursor: pointer; }
.danger-zone { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.cost-types > div, .form-grid div[id$="tenants"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 14px; margin-top: 8px; }
.cost-types label, .form-grid div[id$="tenants"] label { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 2px 0; }
.loan { padding: 4px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.loan:last-child { border-bottom: 0; }
.warn-hint { color: var(--warn); }
tr.current-row td { background: var(--accent-soft); }
.view-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.view-switch button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.attribution { margin-left: auto; font-size: .78rem; }
.osm-box { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: .9rem; }
.osm-box > p { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px; }
.osm-box > p .icon { margin-top: 3px; color: var(--accent); }
.candidates { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.candidates label { font-weight: 400; margin: 0; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.warn-card { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.warn-card .chip-icon { color: var(--warn); }
.contracts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.contract { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.contract.inactive { opacity: .6; }
.contract header { display: flex; flex-direction: column; margin-bottom: 8px; }
.contract header small { color: var(--muted); }
.contract .tags { margin: 6px 0; }
.contract .actions { margin-top: 8px; }
.search-box { display: flex; gap: 10px; align-items: center; }
.search-box input { margin: 0; }
.sidebar-search { display: flex; margin: 0 4px 6px; }
.sidebar-search input { margin: 0; min-height: 38px; font-size: .9rem; }
.deadlines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.deadlines li a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink); }
.deadlines li a:hover { text-decoration: none; border-color: var(--accent); }
.deadlines .when { min-width: 78px; text-align: center; font-weight: 700; font-size: .85rem; padding: 4px 6px; border-radius: 8px; background: var(--surface-2); }
.deadlines .urgent .when { background: var(--bad-soft); color: var(--bad); }
.deadlines .soon .when { background: var(--warn-soft); color: var(--warn); }
.deadlines .info .when { background: var(--accent-soft); color: var(--accent-strong); }
.deadlines .what { flex: 1; display: flex; flex-direction: column; }
.deadlines .what small { color: var(--muted); }
.advance { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .9rem; }
.advance > span { flex: 1 1 220px; display: flex; flex-direction: column; }
.advance small { color: var(--muted); }
.advance.up { background: var(--warn-soft); } .advance.down { background: var(--good-soft); }
.contract .tag { white-space: normal; }

/* ---------- Assistant ---------- */
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.preset { justify-content: flex-start; gap: 10px; min-height: 56px; text-align: left; }
.preset .icon { color: var(--accent); width: 22px; height: 22px; }
.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 860px; padding: 12px 16px; border-radius: 14px; line-height: 1.55; }
.bubble.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.bubble.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.bot p { margin: 0 0 8px; } .bubble.bot ul { margin: 0 0 8px; padding-left: 1.2em; } .bubble.bot h4 { margin: 10px 0 6px; font-size: .95rem; }
.step-line { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .82rem; }
.step-line .icon { color: var(--good); }
.step-line.note .icon { color: var(--warn); }
.proposals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.proposals li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.proposals li.pending { border-color: var(--accent); }
.proposals .what { flex: 1 1 300px; display: flex; flex-direction: column; }
.proposals small { color: var(--muted); }
.letter { white-space: pre-wrap; font-family: inherit; background: var(--surface-2); padding: 10px; border-radius: 8px; font-size: .88rem; }
textarea { min-height: 70px; }

/* ---------- Filing system ---------- */
.dropzone { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; border: 2px dashed color-mix(in srgb, var(--accent) 40%, var(--line)); }
.dropzone > div { flex: 1 1 280px; }
.dropzone input[type=file] { margin-top: 8px; }
.files-layout { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 18px; align-items: start; }
.files-layout > .card { margin: 0; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 14px; padding-left: 8px; border-left: 2px solid var(--line); }
.tree a { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; color: var(--ink); font-size: .9rem; }
.tree a:hover { background: var(--surface-2); text-decoration: none; }
.tree a[aria-current] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.tree a .icon { color: var(--accent); }
.tree a span { flex: 1; }
.tree small { color: var(--muted); font-size: .76rem; }
.new-folder { display: flex; gap: 6px; margin-top: 12px; }
.new-folder input { margin: 0; min-height: 36px; font-size: .88rem; }
.subfolders { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { border-bottom: 1px solid var(--line); }
.doc-list li:last-child { border-bottom: 0; }
.doc-list a { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; color: var(--ink); }
.doc-list a:hover { text-decoration: none; background: var(--surface-2); }
.doc-kind { color: var(--accent); margin-top: 2px; }
.doc-main { flex: 1; display: flex; flex-direction: column; }
.doc-main small { color: var(--muted); }
.doc-summary { font-size: .84rem; color: var(--muted); margin-top: 4px; }
.doc-preview { width: 100%; max-height: 520px; object-fit: contain; border-radius: 10px; background: var(--surface-2); }
.tag.spin .icon { width: .9em; height: .9em; }
@media (max-width: 800px) { .files-layout { grid-template-columns: 1fr; } }
.ask-card textarea { font-size: 1rem; }
.ask-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.file-pick { display: inline-flex; gap: 8px; align-items: center; margin: 0; padding: 8px 14px; border: 1px dashed var(--accent); border-radius: var(--radius-sm); color: var(--accent-strong); cursor: pointer; font-weight: 600; }
.file-pick input[type=file] { width: auto; min-height: 0; margin: 0; padding: 0; border: 0; font-size: .82rem; max-width: 220px; }
.house-pick { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.house-pick select { width: auto; margin: 0; }
.bubble .files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bubble .files span { display: inline-flex; gap: 4px; align-items: center; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.18); font-size: .8rem; }
small.bad { color: var(--bad); }

/* --- Ausbildungshilfe ------------------------------------------------------------------------------ */
.passage { margin: 0 0 12px; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 6px; }
.passage p { margin: 4px 0 0; line-height: 1.5; }
a.cite { display: inline-block; margin: 0 2px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 600; text-decoration: none; vertical-align: 1px; }
.bubble .sources { margin-top: 8px; font-size: .85rem; }
.bubble .sources ul { margin: 4px 0 0; padding-left: 1.2em; }
.bubble .warn { display: flex; gap: 6px; align-items: center; color: var(--warn); font-size: .85rem; }
.examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.week-title { margin: 0; font-size: 1rem; flex: 1; text-align: center; }
ul.days { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.days .day-link { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
ul.days li.open .day-link { border-style: dashed; }
ul.days .day-name { display: flex; flex-direction: column; } ul.days .day-name small { color: var(--muted); }
ul.days .day-body { display: flex; flex-direction: column; gap: 4px; } ul.days .day-text { font-size: .9rem; line-height: 1.45; }
ul.week-dots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
ul.week-dots a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); text-decoration: none; }
ul.week-dots a span { display: flex; flex-direction: column; align-items: center; font-weight: 600; color: var(--ink); } ul.week-dots small { font-weight: 400; color: var(--muted); }
ul.week-dots a.done { color: var(--good); } ul.week-dots a.due { color: var(--warn); }
.danger-zone { display: flex; gap: 8px; flex-wrap: wrap; }
ul.days .day-body .tag { align-self: flex-start; }
@media (max-width: 700px) { .toolbar .week-title { flex-basis: 100%; order: -1; text-align: left; } }
.num-input { width: 7em; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.calc-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
.calc-tile:hover { border-color: var(--accent); } .calc-tile small { color: var(--muted); }
ol.steps { margin: 0 0 10px; padding-left: 1.4em; line-height: 1.7; font-variant-numeric: tabular-nums; }
.result .answer { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); }
ol.steps li { display: flex; flex-direction: column; gap: 4px; }
ol.steps .why { display: flex; gap: 6px; align-items: flex-start; color: var(--muted); font-size: .88rem; line-height: 1.45; }
ol.steps .why .icon { flex: none; margin-top: 2px; }
ol.steps .calc-line { font-weight: 600; }
.remember { margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 6px; }
.remember ul { margin: 4px 0 0; padding-left: 1.2em; }
details.exercise { margin-top: 10px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 8px; }
details.exercise summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.bubble.bot ol { margin: 0 0 8px; padding-left: 1.4em; }
.bubble.bot hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.bubble.bot .hint-box { padding: 8px 12px; border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 6px; }
.created { border-color: var(--accent); }
.created code { font-size: 1.05rem; padding: 2px 6px; background: var(--surface-2); border-radius: 4px; user-select: all; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.danger-text { color: var(--bad); cursor: pointer; font-size: .85rem; }
.prose h2 { font-size: 1.05rem; margin: 16px 0 6px; } .prose h2:first-child { margin-top: 0; }
.prose p, .prose li { line-height: 1.55; }
