:root{font-family:Inter,Segoe UI,Arial,sans-serif;color:#1d2633;background:#f4f6f8}*{box-sizing:border-box}body{margin:0}
header{min-height:66px;background:#fff;border-bottom:1px solid #dde3e8;display:flex;align-items:center;padding:0 max(24px,calc((100% - 1700px)/2));gap:12px;flex-wrap:wrap}
.brand{font-weight:800;font-size:20px;color:#1d2633;text-decoration:none}.version{color:#738091;font-size:13px}nav{margin-left:auto;display:flex;gap:18px}nav a{color:#526579;text-decoration:none;font-weight:600;font-size:14px}
main{max-width:1700px;margin:30px auto;padding:0 18px 60px}h1{margin:8px 0 4px;font-size:30px}h2{font-size:19px;margin:0 0 8px}h3{margin-top:22px;font-size:15px}p{line-height:1.5}
.pagehead,.sectionhead{display:flex;justify-content:space-between;gap:20px;align-items:flex-end;margin-bottom:24px}.pagehead p{margin:0;color:#6b7785}.sectionhead{margin-bottom:12px}
.btn{display:inline-block;border:1px solid #ccd5dd;background:#fff;padding:9px 13px;border-radius:8px;color:#263341;text-decoration:none;cursor:pointer;font-weight:600}.btn.primary{background:#263f55;color:#fff;border-color:#263f55}
.card{background:#fff;border:1px solid #dde3e8;border-radius:12px;padding:22px;box-shadow:0 1px 2px #00000008}.grid2,.tabs{display:grid;grid-template-columns:1fr 1fr;gap:18px}.wide{grid-column:1/-1}
.stats{display:flex;gap:12px;margin:0 0 18px}.stat{background:#fff;border:1px solid #dde3e8;padding:12px 16px;border-radius:10px;text-decoration:none;color:#263341;display:flex;gap:10px;align-items:center}.stat b{font-size:22px}.stat span{color:#75808d;font-size:13px}
.listline,.contactrow,.party,.manage-row{display:flex;align-items:center;gap:8px;border-bottom:1px solid #edf0f2}.listrow{display:flex;flex:1;flex-direction:column;padding:14px 0;text-decoration:none;color:#1d2633;gap:4px}.listrow span,.muted,small{color:#75808d}.grow{flex:1;display:flex;flex-direction:column;gap:3px}
.form{max-width:980px}.form label,.stack label{display:flex;flex-direction:column;gap:7px;font-weight:600;margin-bottom:14px}.cols{display:grid;grid-template-columns:1fr 1fr;gap:16px}input,textarea,select{width:100%;border:1px solid #cfd7df;border-radius:8px;padding:10px 11px;background:#fff;font:inherit}textarea{min-height:88px}.inline{flex-direction:row!important;align-items:center!important}.inline input{width:auto}.checks{display:flex;flex-direction:column;gap:9px;margin:12px 0}.checks.horizontal{flex-direction:row;gap:24px}
.back{color:#526579;text-decoration:none;font-size:14px}.badge{background:#eef2f5;padding:3px 8px;border-radius:20px;font-size:13px}.flash{background:#e8f3ea;border:1px solid #bed9c3;padding:12px 14px;border-radius:8px;margin-bottom:18px}.hint{max-width:980px;background:#fff7dc;border:1px solid #ead797;border-radius:9px;padding:13px 15px;margin:14px 0}
dl{display:grid;grid-template-columns:130px 1fr;gap:9px;margin:0}dt{color:#6d7885}dd{margin:0}.sub{color:#7b8792;font-size:13px;margin:0 0 12px}
.manage-row{padding:8px 0}.manage-row.dragging{opacity:.35}.drag{cursor:grab;color:#94a0ac;padding:6px}.iconbtn,.link{border:0;background:none;text-decoration:none;color:#526579;cursor:pointer;padding:6px 7px;border-radius:5px}.iconbtn:hover{background:#eef2f5}.danger{color:#a13b3b}.done{opacity:.5;text-decoration:line-through}.check{width:30px;height:30px;border-radius:7px;border:1px solid #cad3dc;background:#fff;cursor:pointer}
.inlineform{display:flex;gap:8px;margin-top:14px}.inlineform input[type=number]{max-width:90px}.stack{display:grid;gap:8px;margin-top:14px}.group-heading{font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:#6d7885;background:#f5f7f8;padding:7px 9px;margin-top:10px;border-radius:6px}.addbox{margin-top:16px;border-top:1px solid #e8ecef;padding-top:12px}.addbox summary{cursor:pointer;font-weight:700;color:#526579}
.assignment{border-top:1px solid #edf0f2;padding:12px 0;display:grid;grid-template-columns:130px 1fr;gap:8px;align-items:center}.assignment-form{grid-column:1/-1;display:flex;gap:8px}.assignment-form select{flex:1}.jump{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px}.jump a{font-size:13px;text-decoration:none;color:#526579;background:#fff;border:1px solid #dde3e8;padding:6px 9px;border-radius:20px}
.contactrow,.party{padding:12px 0}.type,.status{font-size:12px;padding:4px 8px;border-radius:20px;background:#eef2f5;white-space:nowrap}.status.active{background:#e3f3e7}.status.planned{background:#fff2ce}.status.ended{background:#eceff2}.tenancyrow{display:grid;grid-template-columns:90px 1.05fr 1.1fr 70px 70px .9fr 1.5fr;gap:12px;align-items:center;border-bottom:1px solid #edf0f2;padding:13px 0;text-decoration:none;color:#263341}.topgap{margin-top:18px}
@media(max-width:760px){nav{width:100%;overflow:auto;padding-bottom:10px}.grid2,.tabs,.cols{grid-template-columns:1fr}.wide{grid-column:auto}.pagehead{align-items:flex-start;flex-direction:column}.tenancyrow{grid-template-columns:1fr}.assignment{grid-template-columns:1fr}.drag{display:none}.stats{flex-direction:column}}

.compact-assignment{grid-template-columns:150px 1fr auto}.assignment-name{font-size:15px}.row-actions{display:flex;align-items:center;gap:2px}.row-actions form{margin:0}.assignment-editor{display:none;grid-column:1/-1;margin-top:3px}.assignment-editor.open{display:block}.assignment-editor .assignment-form{display:flex;gap:8px}.dangerbtn{color:#a13b3b;border-color:#d9bcbc}.actionbar{display:flex;gap:9px;flex-wrap:wrap;margin:18px 0}.actionbar form{margin:0}.locked{background:#e8f3ea;border:1px solid #bed9c3;padding:12px 14px;border-radius:9px;margin:18px 0}.summarygrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.summaryline{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:9px 0;border-bottom:1px solid #edf0f2}.summaryline>span:first-child{display:flex;flex-direction:column}.chiplist{display:flex;gap:7px;flex-wrap:wrap}.chiplist span{background:#f1f4f6;border:1px solid #e1e6ea;padding:6px 9px;border-radius:18px}.okline{font-weight:700;margin-bottom:12px;color:#386b45}.status.large{font-size:14px;padding:7px 12px}.status.draft{background:#fff2ce}.status.prepared{background:#e4edf8}.status.in_progress{background:#e6e3f6}.status.completed{background:#e3f3e7}.handover-list-row{display:grid;grid-template-columns:110px 170px 1fr 120px;gap:14px;align-items:center;border-bottom:1px solid #edf0f2;padding:13px 0;text-decoration:none;color:#263341}.readonlybox{display:flex;flex-direction:column;gap:4px;background:#f6f8f9;border:1px solid #e0e5e9;border-radius:8px;padding:12px;margin-bottom:16px}.optionbox{background:#f7f9fa;border:1px solid #e1e6ea;border-radius:9px;padding:14px;margin:8px 0 16px}.optionbox>label:last-child{margin-bottom:0}
@media(max-width:760px){.summarygrid{grid-template-columns:1fr}.handover-list-row{grid-template-columns:1fr}.compact-assignment{grid-template-columns:1fr auto}.assignment-name{grid-column:1/2}.row-actions{grid-column:2/3;grid-row:1/3}.assignment-editor{grid-column:1/-1}}


.actionbar>.btn,.actionbar>form>.btn{height:44px;display:inline-flex;align-items:center;justify-content:center;line-height:1.2}
.info{background:#e9f0f8;border:1px solid #c7d5e7;padding:12px 14px;border-radius:9px;margin:18px 0}
.status.review{background:#e9edf1}.workcols{display:grid;grid-template-columns:1fr 1fr;gap:24px}.personline{display:flex;align-items:center;gap:5px;padding:5px 0}.inline-delete{display:inline}.compact-list{margin:8px 0 0;padding-left:20px}.roomcards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.workcard{border:1px solid #dfe5ea;border-radius:10px;padding:14px;background:#fff}.workcard.dragging,.meterwork.dragging{opacity:.4}.workcard-head{display:flex;align-items:center;gap:8px}.workcard-head h3{margin:0;flex:1;font-size:17px}.workmeta{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:10px 0}.condition{font-size:12px;border-radius:18px;padding:5px 8px;background:#eef2f5}.condition.ok{background:#e3f3e7}.condition.defect{background:#fde8e5}.condition.open{background:#fff2ce}.photogrid{display:flex;gap:7px;flex-wrap:wrap;margin:8px 0}.photo{width:88px;height:70px;position:relative;border:1px solid #dde3e8;border-radius:7px;overflow:hidden;background:#f4f6f8}.photo img{width:100%;height:100%;object-fit:cover}.photo form{position:absolute;right:2px;top:2px}.photo-delete{border:0;border-radius:50%;width:23px;height:23px;background:#fff;color:#a13b3b;cursor:pointer;box-shadow:0 1px 3px #0003}.photo-upload{display:flex;gap:8px;align-items:center;margin-top:8px}.photo-upload input[type=file]{padding:7px}.meterwork{display:grid;grid-template-columns:auto minmax(260px,1fr) auto auto;gap:8px;align-items:center;padding:11px 0;border-bottom:1px solid #edf0f2}.meter-reading{display:flex;gap:24px;margin-top:5px}.meterphotos{grid-column:2/5}.meterupload{grid-column:2/5}.keywork{padding:10px 0}.warningbox{background:#fff7dc;border:1px solid #ead797;border-radius:9px;padding:12px 15px}.warningbox ul{margin-bottom:0}.handover-sortable .group-heading{pointer-events:none}
@media(max-width:900px){.workcols,.roomcards{grid-template-columns:1fr}.meterwork{grid-template-columns:auto 1fr auto}.meterphotos,.meterupload{grid-column:2/4}}

.compact-add{margin:0;min-width:360px}.compact-add select{min-width:260px}

/* v0.6 – schneller Übergabe-Workflow */
.handover-list-head,.handover-list-row{display:grid;grid-template-columns:190px 190px minmax(330px,1fr) 150px 190px;gap:16px;align-items:center}
.handover-list-head{padding:0 0 9px;border-bottom:2px solid #e5eaee;color:#6d7885;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.handover-list-row{padding:14px 0}.handover-list-row .status{justify-self:start;max-width:180px;overflow:hidden;text-overflow:ellipsis}.handover-list-row small{display:block;margin-bottom:2px}.handover-table{overflow-x:auto}
.room-quick{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:11px 0}.quick-ok,.quick-defect{padding:7px 10px}.room-remark{font-size:13px;margin:4px 0 8px;color:#526579}
.quick-reading-form{display:flex;align-items:end;gap:8px;margin-top:9px;max-width:520px}.quick-reading-form label{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:700;flex:1}.quick-reading-form input{padding:8px 10px}.quick-reading-form .btn{height:38px}.save-state{font-size:12px;color:#386b45;min-width:72px;padding-bottom:9px}
.filepick{display:inline-flex!important;width:auto!important;align-items:center;justify-content:center;border:1px solid #ccd5dd;background:#fff;padding:8px 11px!important;border-radius:8px;color:#263341;cursor:pointer;font-weight:600;margin:0!important}.filepick input{position:absolute;left:-9999px;width:1px;height:1px}.file-selection{font-size:12px;color:#75808d}.photo-caption{font-size:12px;color:#647180;margin-top:8px}.photo-origin{position:absolute;left:3px;bottom:3px;background:#263f55;color:#fff;font-size:9px;padding:2px 4px;border-radius:4px}.copied-photo{outline:2px solid #dbe5ee}
.warningline{background:#fff7dc;border:1px solid #ead797;border-radius:8px;padding:10px 12px}.minor-action{margin-top:14px}
@media(max-width:900px){.handover-list-head{display:none}.handover-list-row{grid-template-columns:1fr}.quick-reading-form{align-items:stretch;flex-direction:column}.save-state{padding:0}.file-selection{width:100%}}
/* v0.7 Win-CASA-Synchronisation */
.sync-upload{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin-top:14px}.sync-upload label{display:flex;flex-direction:column;gap:6px;font-weight:700;flex:1;min-width:260px}.sync-last{display:grid;gap:3px;margin-top:18px;padding-top:14px;border-top:1px solid #edf0f2}.sync-last span{color:#667584;font-size:13px}.sync-house{border-top:1px solid #e7ebee;padding:15px 0}.sync-house:first-of-type{border-top:0}.sync-house-head{display:grid;grid-template-columns:minmax(220px,1fr) 1.4fr auto;gap:14px;align-items:center}.sync-house-head label{margin:0!important}.source-state{font-size:11px;padding:4px 8px;border-radius:20px;background:#e3f3e7;white-space:nowrap}.source-state.missing{background:#fff2ce}.sync-unit-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0 0 30px}.sync-unit{display:flex;gap:9px;align-items:flex-start;border:1px solid #e3e8ec;border-radius:8px;padding:9px 10px;cursor:pointer}.sync-unit input{width:auto;margin-top:3px}.sync-unit span{display:flex;flex-direction:column;gap:2px}.sync-unit small{font-size:11px}.sync-unit.source-missing{background:#fff8e6}.sync-issue{display:flex;gap:16px;align-items:center;border-top:1px solid #edf0f2;padding:12px 0}.sync-issue:first-of-type{border-top:0}.sync-issue .row-actions form{margin:0}.sync-run-list{display:grid;gap:9px;margin-top:14px}.sync-run-list>div{display:grid;grid-template-columns:150px 1fr 2fr;gap:12px;font-size:13px;border-top:1px solid #edf0f2;padding-top:9px}.sync-run-list span{color:#647180}
@media(max-width:1000px){.sync-unit-grid{grid-template-columns:1fr 1fr}.sync-house-head{grid-template-columns:1fr}.sync-issue{align-items:flex-start;flex-direction:column}}@media(max-width:650px){.sync-unit-grid{grid-template-columns:1fr;margin-left:0}.sync-run-list>div{grid-template-columns:1fr}}

.handover-line{display:flex;align-items:center;gap:8px;border-bottom:1px solid #edf0f2}.handover-line .handover-list-row{border-bottom:0}.form-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:8px}.listline>form,.handover-line>form,.row-actions>form{margin:0}

/* v0.9 – Verwaltungsstruktur, Filter, Rollen und manuelle Reihenfolgen */
.house-manage .listrow{padding:14px 0}.filterbar{display:flex;gap:12px;align-items:end;flex-wrap:wrap;padding:14px 16px}.filterbar label{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:800;min-width:160px}.filterbar label:has(input[name=q]){flex:1;min-width:220px}.filterbar select,.filterbar input{padding:8px 10px}.filterbar .btn{height:38px}
.rolechecks{display:grid;grid-template-columns:1fr 1fr;gap:8px 20px}.rolebadges{display:flex;gap:5px;flex-wrap:wrap}.rolebadges span{font-size:10px;background:#eef2f5;border-radius:14px;padding:3px 7px;color:#526579}.drag{cursor:grab;user-select:none;font-weight:800;color:#7a8794}.manage-row.dragging{opacity:.45}
.source-note{background:#f6f8fa;border:1px solid #e0e6ea;border-radius:8px;padding:9px 11px}
@media(max-width:760px){.filterbar{align-items:stretch}.filterbar>*{width:100%}.rolechecks{grid-template-columns:1fr}.house-manage .iconbtn{padding:6px}}

.sync-filterbar{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin:8px 0 16px;padding:10px 12px;background:#f6f8fa;border:1px solid #e3e8ec;border-radius:9px}.sync-filterbar label{font-weight:800;display:flex;gap:8px;align-items:center}.sync-filterbar select{padding:7px 9px}

/* v0.9.3 – klare Einheitenübersicht und abhängige Mietvertragsauswahl */
.unit-list-head{display:grid;grid-template-columns:28px minmax(250px,1.35fr) 80px 80px minmax(220px,1fr) 190px;gap:10px;padding:4px 8px 8px;color:#718096;font-size:11px;text-transform:uppercase;letter-spacing:.03em;border-bottom:1px solid #e9edf0}
.unit-overview-row{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:10px}
.unit-overview-link{display:grid;grid-template-columns:minmax(250px,1.35fr) 80px 80px minmax(220px,1fr);gap:18px;align-items:center;text-decoration:none;color:inherit;padding:14px 0;min-width:0}
.unit-overview-link:hover b{color:#2d5f89}.unit-col,.tenant-col{display:flex;flex-direction:column;gap:3px;min-width:0}.unit-metric{font-weight:700;white-space:nowrap}.unit-col small,.tenant-col small{color:#738095}.tenant-col b{white-space:normal}.unit-actions{display:flex;align-items:center;gap:3px}
.source-info{opacity:.88}.source-lock{font-size:11px;font-weight:800;color:#647789;background:#eef2f5;border-radius:14px;padding:5px 8px;white-space:nowrap}.hint.compact{margin:8px 0}
@media(max-width:900px){.unit-list-head{display:none}.unit-overview-row{grid-template-columns:24px minmax(0,1fr) auto}.unit-overview-link{grid-template-columns:1fr 1fr;gap:7px}.unit-col,.tenant-col{grid-column:1/-1}.unit-metric{font-size:12px}.tenant-col{padding-top:5px;border-top:1px dashed #e0e5e9}.unit-actions{flex-wrap:wrap;justify-content:flex-end}}

/* v0.9.4 */
.tenancy-list-head{display:grid;grid-template-columns:90px 1.05fr 1.1fr 70px 70px .9fr 1.5fr 84px;gap:12px;padding:0 0 8px;border-bottom:2px solid #e6ebef;color:#6d7885;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.tenancy-address{color:#526579}.mass-edit-actions{justify-content:flex-start}.mass-edit-actions button:disabled{opacity:.42;cursor:not-allowed}.compact-head{margin-bottom:8px}.compact-head p{font-size:13px}.contextbox{margin:0}.readonly-inline{background:#f6f8f9;border:1px solid #e0e5e9;border-radius:8px;padding:11px 12px;margin:8px 0}.handover-form{max-width:1100px}
@media(max-width:1000px){.tenancy-list-head{display:none}.tenancyrow{grid-template-columns:1fr}.form{max-width:100%}}

.tenancy-metric{font-weight:700;white-space:nowrap}

/* v0.9.7 – dauerhaftes Win-CASA-Änderungsjournal */
.sync-changed{background:#fff8dc!important;border-radius:9px}.sync-change-badge{display:inline-block;background:#f2c94c;color:#594600;border-radius:14px;padding:3px 8px;font-size:10px;font-weight:800;text-decoration:none;vertical-align:middle}.sync-stat-open{background:#fff5cc!important;border-color:#ead27a!important}.warningbadge{background:#f2c94c;color:#594600}.sync-change-list{display:flex;flex-direction:column}.sync-change-row{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:12px;align-items:center;padding:14px 4px;border-top:1px solid #e8ecef}.sync-change-row:first-child{border-top:0}.sync-change-row.open{background:#fffaf0}.sync-change-row.reviewed{opacity:.68}.sync-change-row.warning{border-left:4px solid #d89b2b;padding-left:10px}.sync-change-state{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;background:#f2c94c;color:#594600;font-weight:900}.sync-change-row.reviewed .sync-change-state{background:#dfe9df;color:#35613c}.sync-change-title{display:flex;gap:12px;align-items:baseline;flex-wrap:wrap}.sync-change-title span{font-size:11px;color:#778492}.sync-change-location{display:inline-block;margin-top:4px;font-weight:700}.sync-change-description{margin-top:5px;color:#4e5c69}.journal-run-filter,.journal-pages{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:10px 12px;background:#f5f7f8;border-radius:8px;margin:8px 0}.journal-pages{justify-content:flex-end}
@media(max-width:800px){.sync-change-row{grid-template-columns:30px 1fr}.sync-change-row>.row-actions{grid-column:2}.sync-change-title{display:block}.sync-changed{margin-left:-4px;margin-right:-4px}}

/* v0.9.8 – lokale Win-CASA Bridge */
.bridge-panel{margin:16px 0;padding:16px;border:1px solid #dce3e8;border-radius:10px;background:#f7f9fa}.bridge-status{display:flex;align-items:center;gap:9px;margin-bottom:14px;font-weight:700}.bridge-dot{width:11px;height:11px;border-radius:50%;display:inline-block;flex:0 0 11px}.bridge-dot.checking{background:#b8c1c9}.bridge-dot.ok{background:#38a169;box-shadow:0 0 0 4px #e1f3e7}.bridge-dot.error{background:#c94b4b;box-shadow:0 0 0 4px #f7e1e1}.bridge-main-button{min-height:48px;font-size:16px}.bridge-progress{min-height:24px;margin-top:12px;color:#647382}.bridge-progress.active{font-weight:700;color:#36536b}.bridge-progress.success{font-weight:700;color:#2f6b3c}.bridge-progress.error{font-weight:700;color:#a23333}.manual-sync-fallback{margin-top:14px;border-top:1px solid #e2e7eb;padding-top:12px}.manual-sync-fallback summary{cursor:pointer}.bridge-install-note{margin-top:12px}


/* ================================================================
   v0.9.9 – Smartphone / Touch Portrait UI
   Activates through JS class .mobile-ui, so it also works when an
   Android browser reports a desktop-like viewport.
   ================================================================ */

html.mobile-ui{font-size:16px;-webkit-text-size-adjust:100%;text-size-adjust:100%}
html.mobile-ui body{background:#f2f4f6;overflow-x:hidden}
html.mobile-ui header{
  position:sticky;top:0;z-index:100;
  min-height:0;padding:9px 10px 0;
  display:grid;grid-template-columns:minmax(0,1fr) auto;
  gap:3px 8px;align-items:center;
  background:#fff;box-shadow:0 2px 8px #0000000c
}
html.mobile-ui .brand{font-size:18px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.mobile-ui .version{font-size:11px;justify-self:end}
html.mobile-ui header nav{
  grid-column:1/-1;width:calc(100% + 20px);margin:5px -10px 0;
  display:flex;gap:5px;overflow-x:auto;overscroll-behavior-x:contain;
  padding:7px 9px 9px;border-top:1px solid #eef1f3;
  scrollbar-width:none
}
html.mobile-ui header nav::-webkit-scrollbar{display:none}
html.mobile-ui header nav a{
  flex:0 0 auto;min-height:40px;display:flex;align-items:center;
  padding:8px 11px;border-radius:9px;background:#f5f7f8;
  font-size:13px;font-weight:700;white-space:nowrap
}
html.mobile-ui header nav a.active{background:#263f55;color:#fff}

html.mobile-ui main{max-width:none;margin:14px auto;padding:0 10px 34px}
html.mobile-ui h1{font-size:26px;line-height:1.12;margin:8px 0 5px}
html.mobile-ui h2{font-size:20px;line-height:1.2}
html.mobile-ui h3{font-size:17px}
html.mobile-ui p{line-height:1.42}
html.mobile-ui .back{display:inline-flex;align-items:center;min-height:38px;font-size:14px}
html.mobile-ui .card{padding:14px;border-radius:11px}
html.mobile-ui .topgap{margin-top:12px}
html.mobile-ui .pagehead,html.mobile-ui .sectionhead{
  flex-direction:column;align-items:stretch;gap:10px;margin-bottom:15px
}
html.mobile-ui .pagehead>.btn,html.mobile-ui .sectionhead>.btn{align-self:stretch}
html.mobile-ui .sub{font-size:13px}
html.mobile-ui .grid2,html.mobile-ui .tabs,html.mobile-ui .cols,
html.mobile-ui .summarygrid,html.mobile-ui .workcols{grid-template-columns:1fr}
html.mobile-ui .wide{grid-column:auto}

/* Controls: thumb-friendly and prevent tiny form text */
html.mobile-ui input,html.mobile-ui select,html.mobile-ui textarea{
  min-height:46px;padding:11px 12px;border-radius:9px;font-size:16px
}
html.mobile-ui textarea{min-height:110px}
html.mobile-ui .btn{
  min-height:44px;padding:10px 13px;border-radius:9px;
  display:inline-flex;align-items:center;justify-content:center;font-size:15px
}
html.mobile-ui .iconbtn{
  min-width:44px;min-height:44px;padding:8px;
  display:inline-flex;align-items:center;justify-content:center;font-size:18px
}
html.mobile-ui .check{min-width:44px;min-height:44px}
html.mobile-ui .drag{display:none!important}
html.mobile-ui .row-actions{gap:5px;flex-wrap:wrap}
html.mobile-ui .form,html.mobile-ui .hint,html.mobile-ui .handover-form{max-width:none;width:100%}
html.mobile-ui .form-actions,html.mobile-ui .actionbar{
  display:grid;grid-template-columns:1fr;gap:8px
}
html.mobile-ui .form-actions>.btn,html.mobile-ui .form-actions>form,
html.mobile-ui .form-actions>form>.btn,html.mobile-ui .actionbar>.btn,
html.mobile-ui .actionbar>form,html.mobile-ui .actionbar>form>.btn{width:100%}
html.mobile-ui .inlineform{width:100%;display:flex;align-items:stretch;gap:7px}
html.mobile-ui .inlineform input{min-width:0;flex:1}
html.mobile-ui .assignment-form{flex-direction:column}
html.mobile-ui .assignment-form .btn{width:100%}
html.mobile-ui dl{grid-template-columns:1fr;gap:3px}
html.mobile-ui dd{margin-bottom:9px}
html.mobile-ui dt{font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.03em}

/* Dashboard: compact 2 x 2 status cards, content in one column */
html.mobile-ui .stats{
  display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px
}
html.mobile-ui .stat{
  min-width:0;min-height:88px;padding:11px;
  flex-direction:column;align-items:flex-start;justify-content:center;gap:3px
}
html.mobile-ui .stat b{font-size:27px;line-height:1}
html.mobile-ui .stat span{font-size:12px;line-height:1.2}
html.mobile-ui .grid2{display:grid;gap:12px}
html.mobile-ui .house-manage{
  flex-wrap:wrap;gap:3px;padding:8px 0
}
html.mobile-ui .house-manage .listrow{
  flex:1 0 100%;padding:8px 0 3px
}
html.mobile-ui .house-manage .listrow b{font-size:17px}
html.mobile-ui .house-manage .listrow span{font-size:13px;line-height:1.25}
html.mobile-ui .house-manage>form{margin:0}
html.mobile-ui .todo{align-items:flex-start}

/* Unit overview: information first, actions on their own line */
html.mobile-ui .unit-list-head{display:none}
html.mobile-ui .unit-overview-row{
  display:flex;flex-wrap:wrap;align-items:stretch;gap:5px;padding:10px 0
}
html.mobile-ui .unit-overview-link{
  flex:1 0 100%;width:100%;
  display:grid;grid-template-columns:minmax(0,1fr) 64px 64px;
  gap:7px 10px;padding:4px 0
}
html.mobile-ui .unit-col{grid-column:1/2}
html.mobile-ui .unit-col b{font-size:17px}
html.mobile-ui .unit-col small{font-size:13px;line-height:1.25}
html.mobile-ui .unit-metric{font-size:14px;align-self:center;text-align:right}
html.mobile-ui .tenant-col{
  grid-column:1/-1;padding-top:8px;border-top:1px dashed #e0e5e9
}
html.mobile-ui .tenant-col b{font-size:15px}
html.mobile-ui .unit-actions{
  width:100%;justify-content:flex-end;gap:4px;padding-top:2px
}
html.mobile-ui .unit-actions form{margin:0}

/* Contacts and generic row actions */
html.mobile-ui .contactrow,html.mobile-ui .party,html.mobile-ui .listline{
  flex-wrap:wrap;align-items:center;gap:6px;padding:10px 0
}
html.mobile-ui .contactrow .grow,html.mobile-ui .party .grow{min-width:0}
html.mobile-ui .contactrow .grow b,html.mobile-ui .party .grow b{font-size:17px}
html.mobile-ui .contactrow>.btn{margin-left:auto}
html.mobile-ui .rolebadges span{font-size:11px;padding:4px 7px}

/* Filter areas stack to full width */
html.mobile-ui .filterbar{
  display:grid;grid-template-columns:1fr;align-items:stretch;gap:9px;padding:12px
}
html.mobile-ui .filterbar label,html.mobile-ui .filterbar label:has(input[name=q]){
  min-width:0;width:100%;margin:0
}
html.mobile-ui .filterbar .btn{width:100%;height:auto;min-height:44px}

/* Mietverhältnisse become readable mobile cards */
html.mobile-ui .tenancy-list-head{display:none}
html.mobile-ui .listline:has(.tenancyrow){
  display:flex;flex-wrap:wrap;border:1px solid #e2e7eb;
  border-radius:10px;margin:9px 0;padding:10px;background:#fff
}
html.mobile-ui .tenancyrow{
  flex:1 0 100%;width:100%;
  display:grid;grid-template-columns:1fr 1fr;
  gap:7px 12px;padding:0;border:0
}
html.mobile-ui .tenancyrow .status{justify-self:start}
html.mobile-ui .tenancyrow .mobile-main{font-size:18px;align-self:center}
html.mobile-ui .tenancyrow [data-mobile-label]{
  display:flex;flex-direction:column;gap:2px;min-width:0
}
html.mobile-ui .tenancyrow [data-mobile-label]::before{
  content:attr(data-mobile-label);font-size:10px;font-weight:800;
  color:#7a8794;text-transform:uppercase;letter-spacing:.04em
}
html.mobile-ui .tenancyrow .tenancy-address,
html.mobile-ui .tenancyrow .tenancy-period,
html.mobile-ui .tenancyrow .tenancy-people{grid-column:1/-1}
html.mobile-ui .tenancyrow .tenancy-people{font-weight:700;font-size:15px}
html.mobile-ui .listline:has(.tenancyrow)>.source-lock{
  margin-top:7px;margin-left:auto
}

/* Übergaben list */
html.mobile-ui .handover-list-head{display:none}
html.mobile-ui .handover-line{
  display:flex;flex-wrap:wrap;align-items:stretch;
  border:1px solid #e2e7eb;border-radius:10px;
  margin:9px 0;padding:10px;background:#fff
}
html.mobile-ui .handover-list-row{
  flex:1 0 100%;width:100%;display:grid;grid-template-columns:1fr 1fr;
  gap:7px 12px;padding:0;border:0
}
html.mobile-ui .handover-list-row .mobile-main{font-size:17px;align-self:center}
html.mobile-ui .handover-list-row [data-mobile-label]{
  grid-column:1/-1;display:flex;flex-direction:column;gap:2px
}
html.mobile-ui .handover-list-row [data-mobile-label]::before{
  content:attr(data-mobile-label);font-size:10px;font-weight:800;
  color:#7a8794;text-transform:uppercase;letter-spacing:.04em
}

/* Übergabe durchführen: one room per row, large controls */
html.mobile-ui .jump{
  position:sticky;top:94px;z-index:70;
  display:flex;flex-wrap:nowrap;gap:6px;overflow-x:auto;
  margin:0 -10px 10px;padding:7px 10px;
  background:#f2f4f6eF;backdrop-filter:blur(8px);
  scrollbar-width:none
}
html.mobile-ui .jump::-webkit-scrollbar{display:none}
html.mobile-ui .jump a{
  flex:0 0 auto;min-height:40px;padding:8px 12px;
  display:flex;align-items:center;font-size:14px
}
html.mobile-ui .roomcards{grid-template-columns:1fr;gap:10px}
html.mobile-ui .workcard{padding:12px;border-radius:11px}
html.mobile-ui .workcard-head{
  display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:5px
}
html.mobile-ui .workcard-head h3{font-size:19px}
html.mobile-ui .workcard-head .btn{min-width:96px}
html.mobile-ui .room-quick{
  display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:10px 0
}
html.mobile-ui .room-quick .condition{grid-column:1/-1;justify-self:start;font-size:13px}
html.mobile-ui .room-quick .btn{width:100%}
html.mobile-ui .photo{width:102px;height:82px}
html.mobile-ui .photo-upload{
  display:grid;grid-template-columns:1fr;gap:7px;align-items:stretch;margin-top:10px
}
html.mobile-ui .photo-upload .filepick,
html.mobile-ui .photo-upload .btn{width:100%;min-height:46px}
html.mobile-ui .photo-upload .file-selection{width:100%;text-align:center}
html.mobile-ui .filepick{font-size:15px}
html.mobile-ui .meterwork{
  display:grid;grid-template-columns:1fr auto;gap:7px;padding:12px 0
}
html.mobile-ui .meterwork>.grow{grid-column:1/-1}
html.mobile-ui .meter-reading{display:flex;flex-direction:column;gap:3px}
html.mobile-ui .meterwork>.btn{grid-column:1/2;width:100%}
html.mobile-ui .meterwork>form{grid-column:2/3;margin:0}
html.mobile-ui .meterphotos,html.mobile-ui .meterupload{grid-column:1/-1}
html.mobile-ui .quick-reading-form{
  max-width:none;width:100%;display:grid;grid-template-columns:1fr auto;
  gap:7px;align-items:end
}
html.mobile-ui .quick-reading-form label{min-width:0}
html.mobile-ui .quick-reading-form .btn{min-width:100px;height:46px}
html.mobile-ui .quick-reading-form .save-state{grid-column:1/-1;padding:0}
html.mobile-ui .keywork{
  flex-wrap:wrap;align-items:center;gap:5px;padding:10px 0
}
html.mobile-ui .keywork .grow{flex:1 0 calc(100% - 50px)}
html.mobile-ui .keywork>.btn{margin-left:auto}

/* Win-CASA and journal */
html.mobile-ui .sync-house-head{grid-template-columns:1fr}
html.mobile-ui .sync-unit-grid{grid-template-columns:1fr;margin-left:0}
html.mobile-ui .sync-change-row{grid-template-columns:30px minmax(0,1fr)}
html.mobile-ui .sync-change-row>.row-actions{grid-column:2;width:100%}
html.mobile-ui .sync-change-row>.row-actions .btn{width:100%}
html.mobile-ui .bridge-main-button{width:100%;min-height:50px}
html.mobile-ui .sync-upload{align-items:stretch}
html.mobile-ui .sync-upload label{min-width:0;width:100%}
html.mobile-ui .sync-upload .btn{width:100%}
html.mobile-ui .journal-run-filter,html.mobile-ui .journal-pages{align-items:stretch}
html.mobile-ui .journal-run-filter .btn,html.mobile-ui .journal-run-filter form,
html.mobile-ui .journal-run-filter form .btn{width:100%}

/* Small visual breathing room on phones */
html.mobile-ui .badge,html.mobile-ui .status,html.mobile-ui .type{font-size:12px}
html.mobile-ui .source-lock{font-size:11px;min-height:34px;display:inline-flex;align-items:center}
html.mobile-ui .warningbox,html.mobile-ui .hint,html.mobile-ui .info,
html.mobile-ui .locked,html.mobile-ui .optionbox,html.mobile-ui .readonlybox{padding:12px}


/* ================================================================
   v0.9.9.2 – große Smartphone-Typografie für ALLE mobile-ui Seiten
   Die starke Vergrößerung gilt jetzt immer, sobald mobile-ui aktiv ist.
   Sie hängt NICHT mehr von einer bestimmten CSS-Viewport-Breite ab.
   ================================================================ */

html.mobile-ui body{font-size:22px;line-height:1.42}

/* Header / Navigation */
html.mobile-ui header{padding:12px 13px 0;gap:5px 10px}
html.mobile-ui .brand{font-size:25px;line-height:1.2}
html.mobile-ui .version{font-size:16px}
html.mobile-ui header nav{
  width:calc(100% + 26px);margin:7px -13px 0;padding:9px 12px 11px;gap:7px
}
html.mobile-ui header nav a{
  min-height:50px;padding:10px 14px;font-size:19px;border-radius:10px
}

/* Grundlayout und Text */
html.mobile-ui main{margin-top:18px;padding:0 13px 42px}
html.mobile-ui h1{font-size:36px;line-height:1.12;margin:11px 0 7px}
html.mobile-ui h2{font-size:29px;line-height:1.2;margin:8px 0 11px}
html.mobile-ui h3{font-size:25px;line-height:1.22}
html.mobile-ui p{font-size:21px;line-height:1.45}
html.mobile-ui .sub,
html.mobile-ui .muted,
html.mobile-ui small{font-size:18px;line-height:1.4}
html.mobile-ui .pagehead p{font-size:20px}
html.mobile-ui .back{font-size:19px;min-height:46px}
html.mobile-ui .card{padding:18px;border-radius:13px}
html.mobile-ui .flash,
html.mobile-ui .hint,
html.mobile-ui .info,
html.mobile-ui .warningbox,
html.mobile-ui .locked,
html.mobile-ui .optionbox,
html.mobile-ui .readonlybox{font-size:20px;line-height:1.42;padding:15px}

/* Formulare / Schaltflächen */
html.mobile-ui label,
html.mobile-ui .form label,
html.mobile-ui .stack label{font-size:20px;line-height:1.3;gap:8px}
html.mobile-ui input,
html.mobile-ui select,
html.mobile-ui textarea{
  min-height:56px;padding:13px 14px;font-size:21px;border-radius:10px
}
html.mobile-ui textarea{min-height:135px}
html.mobile-ui .btn{
  min-height:54px;padding:12px 16px;font-size:20px;line-height:1.2;border-radius:10px
}
html.mobile-ui .iconbtn{
  min-width:54px;min-height:54px;padding:9px;font-size:25px
}
html.mobile-ui .check{min-width:54px;min-height:54px}
html.mobile-ui .badge,
html.mobile-ui .status,
html.mobile-ui .type{font-size:17px;padding:6px 10px}
html.mobile-ui .source-lock{font-size:16px;min-height:42px;padding:6px 9px}
html.mobile-ui dt{font-size:17px}
html.mobile-ui dd{font-size:21px;line-height:1.35}
html.mobile-ui .rolebadges span{font-size:16px;padding:6px 8px}

/* Dashboard */
html.mobile-ui .stats{gap:10px}
html.mobile-ui .stat{min-height:112px;padding:14px}
html.mobile-ui .stat b{font-size:36px;line-height:1}
html.mobile-ui .stat span{font-size:17px;line-height:1.28}
html.mobile-ui .house-manage{padding:12px 0;gap:6px}
html.mobile-ui .house-manage .listrow{padding:10px 0 5px}
html.mobile-ui .house-manage .listrow b{font-size:24px;line-height:1.25}
html.mobile-ui .house-manage .listrow span{font-size:18px;line-height:1.38}
html.mobile-ui .todo b{font-size:22px}
html.mobile-ui .todo span{font-size:18px}

/* Einheiten */
html.mobile-ui .unit-overview-row{gap:7px;padding:13px 0}
html.mobile-ui .unit-overview-link{gap:9px 12px}
html.mobile-ui .unit-col b{font-size:25px;line-height:1.25}
html.mobile-ui .unit-col small{font-size:18px;line-height:1.38}
html.mobile-ui .unit-metric{font-size:20px}
html.mobile-ui .tenant-col b{font-size:21px}
html.mobile-ui .tenant-col small{font-size:18px}
html.mobile-ui .unit-actions{gap:6px;padding-top:6px}

/* Personen / Beteiligte / allgemeine Listen */
html.mobile-ui .contactrow,
html.mobile-ui .party,
html.mobile-ui .listline{padding:14px 0;gap:8px}
html.mobile-ui .contactrow .grow b,
html.mobile-ui .party .grow b{font-size:24px}
html.mobile-ui .contactrow .grow span,
html.mobile-ui .party .grow span{font-size:18px;line-height:1.35}

/* Filter */
html.mobile-ui .filterbar{gap:11px;padding:14px}
html.mobile-ui .filterbar label{font-size:19px}
html.mobile-ui .filterbar .btn{min-height:54px}

/* Mietverhältnisse */
html.mobile-ui .listline:has(.tenancyrow){
  padding:14px;margin:11px 0;border-radius:12px
}
html.mobile-ui .tenancyrow{gap:9px 14px}
html.mobile-ui .tenancyrow .mobile-main{font-size:25px}
html.mobile-ui .tenancyrow [data-mobile-label]::before{font-size:15px}
html.mobile-ui .tenancyrow [data-mobile-label]{font-size:20px}
html.mobile-ui .tenancyrow .tenancy-people{font-size:21px}

/* Übergabeliste */
html.mobile-ui .handover-line{padding:14px;margin:11px 0;border-radius:12px}
html.mobile-ui .handover-list-row{gap:9px 14px}
html.mobile-ui .handover-list-row .mobile-main{font-size:25px}
html.mobile-ui .handover-list-row [data-mobile-label]::before{font-size:15px}
html.mobile-ui .handover-list-row [data-mobile-label]{font-size:20px}

/* Übergabedetail / Arbeitsstruktur */
html.mobile-ui dl{font-size:21px}
html.mobile-ui .structure-list .listline,
html.mobile-ui .structure-list .grow,
html.mobile-ui .structure-list b,
html.mobile-ui .structure-list span{font-size:20px}
html.mobile-ui .structure-list .listline b{font-size:23px}
html.mobile-ui .checklist{font-size:20px;line-height:1.42}
html.mobile-ui .checklist b{font-size:22px}

/* Übergabe durchführen – wichtigste Vor-Ort-Ansicht */
html.mobile-ui .jump{top:113px;gap:8px;padding:9px 13px}
html.mobile-ui .jump a{
  min-height:50px;padding:9px 14px;font-size:19px
}
html.mobile-ui .roomcards{gap:13px}
html.mobile-ui .workcard{padding:16px;border-radius:13px}
html.mobile-ui .workcard-head{gap:7px}
html.mobile-ui .workcard-head h3{font-size:27px}
html.mobile-ui .workcard-head .btn{min-width:118px}
html.mobile-ui .condition{font-size:18px;padding:6px 10px}
html.mobile-ui .room-remark{font-size:19px;line-height:1.42}
html.mobile-ui .room-quick{gap:9px;margin:13px 0}
html.mobile-ui .photo-upload{gap:9px;margin-top:13px}
html.mobile-ui .filepick{font-size:20px;min-height:54px}
html.mobile-ui .file-selection{font-size:17px}
html.mobile-ui .photo{width:135px;height:105px}
html.mobile-ui .meterwork{gap:9px;padding:15px 0}
html.mobile-ui .meterwork .grow b{font-size:23px}
html.mobile-ui .meterwork .grow span{font-size:18px}
html.mobile-ui .meter-reading label{font-size:18px}
html.mobile-ui .quick-reading-form .btn{min-width:128px;height:56px}
html.mobile-ui .quick-reading-form label{font-size:19px}
html.mobile-ui .save-state{font-size:17px}
html.mobile-ui .keywork{gap:7px;padding:13px 0}
html.mobile-ui .keywork .grow b{font-size:23px}
html.mobile-ui .keywork .grow span{font-size:18px}

/* Verantwortliche / Zuordnungen */
html.mobile-ui .assignment-list .assignment-row,
html.mobile-ui .assignment-row{font-size:20px;line-height:1.35}
html.mobile-ui .assignment-row b{font-size:22px}
html.mobile-ui .assignment-form select{font-size:20px}

/* Win-CASA / Änderungsjournal */
html.mobile-ui .sync-last span{font-size:18px}
html.mobile-ui .source-state{font-size:16px;padding:6px 9px}
html.mobile-ui .sync-unit{font-size:19px;padding:11px}
html.mobile-ui .sync-change-title b{font-size:23px}
html.mobile-ui .sync-change-title span{font-size:17px}
html.mobile-ui .sync-change-location{font-size:19px}
html.mobile-ui .sync-change-description{font-size:19px;line-height:1.42}
html.mobile-ui .bridge-status{font-size:20px}
html.mobile-ui .bridge-main-button{font-size:21px;min-height:58px}
html.mobile-ui .bridge-progress{font-size:18px;line-height:1.42}

/* Sekundärseiten / Tabellen / Details */
html.mobile-ui table{font-size:19px}
html.mobile-ui th{font-size:17px}
html.mobile-ui td{font-size:19px}
html.mobile-ui .locked b,
html.mobile-ui .readonly-inline,
html.mobile-ui .optionbox b{font-size:21px}


/* ================================================================
   v0.9.9.5 – saubere responsive Smartphone-Basis
   Voraussetzung: Android Chrome "Desktopwebsite" ist AUS.
   Kein zoom, kein transform, keine künstliche Seitenbreite.
   ================================================================ */

.mobile-mode-label{display:none}
html.mobile-ui .mobile-mode-label{
  display:inline-block;
  margin-left:5px;
  padding:2px 6px;
  border-radius:8px;
  background:#dfeee4;
  color:#285d38;
  font-size:14px;
  font-weight:800;
  white-space:nowrap;
}

/* The viewport itself is the width reference. */
html.mobile-ui,
html.mobile-ui body{
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:visible;
}
html.mobile-ui body{margin:0}
html.mobile-ui header,
html.mobile-ui main{
  width:100%;
  max-width:100%;
  min-width:0;
}

/* Every regular content container may shrink to the viewport. */
html.mobile-ui main > *,
html.mobile-ui section,
html.mobile-ui .card,
html.mobile-ui .grid2,
html.mobile-ui .tabs,
html.mobile-ui .cols,
html.mobile-ui .summarygrid,
html.mobile-ui .workcols,
html.mobile-ui .filterbar,
html.mobile-ui .pagehead,
html.mobile-ui .sectionhead,
html.mobile-ui .form,
html.mobile-ui .stack,
html.mobile-ui .readonlybox,
html.mobile-ui .optionbox,
html.mobile-ui .warningbox,
html.mobile-ui .hint,
html.mobile-ui .info,
html.mobile-ui .locked{
  min-width:0;
  max-width:100%;
}

/* Forms/controls never exceed their parent. */
html.mobile-ui input,
html.mobile-ui textarea,
html.mobile-ui select,
html.mobile-ui button,
html.mobile-ui .btn,
html.mobile-ui .filepick{
  max-width:100%;
  min-width:0;
}

/* Text must wrap instead of being clipped off the right edge. */
html.mobile-ui p,
html.mobile-ui li,
html.mobile-ui dd,
html.mobile-ui .sub,
html.mobile-ui .muted,
html.mobile-ui .grow,
html.mobile-ui .listrow,
html.mobile-ui .room-remark,
html.mobile-ui .sync-change-description,
html.mobile-ui .sync-change-location{
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:normal;
}
html.mobile-ui .compact-list{max-width:100%;padding-left:24px}
html.mobile-ui .compact-list li{padding-right:2px}

/* Full-width mobile actions may wrap naturally. */
html.mobile-ui .actionbar .btn,
html.mobile-ui .form-actions .btn,
html.mobile-ui .sectionhead .btn,
html.mobile-ui .pagehead .btn{
  white-space:normal;
  overflow-wrap:anywhere;
}

/* Horizontal scrolling exists ONLY where it is intentional. */
html.mobile-ui header nav,
html.mobile-ui .jump{
  max-width:100vw;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
}

/* Avoid fixed desktop minimums surviving into phone cards. */
html.mobile-ui .compact-add,
html.mobile-ui .compact-add select,
html.mobile-ui .sync-upload label,
html.mobile-ui .meterwork,
html.mobile-ui .quick-reading-form{
  min-width:0!important;
  max-width:100%!important;
}

/* Mobile typography remains the larger v0.9.9.2 sizing. */
html.mobile-ui body{font-size:22px}
html.mobile-ui h1{font-size:36px}
html.mobile-ui h2{font-size:29px}
html.mobile-ui h3{font-size:25px}
html.mobile-ui p{font-size:21px}
html.mobile-ui .sub,
html.mobile-ui .muted,
html.mobile-ui small{font-size:18px}
html.mobile-ui .brand{font-size:25px}
html.mobile-ui .version{font-size:16px}
html.mobile-ui header nav a{font-size:19px;min-height:50px}
html.mobile-ui .btn{font-size:20px;min-height:54px}
html.mobile-ui input,
html.mobile-ui select,
html.mobile-ui textarea{font-size:21px;min-height:56px}


/* ================================================================
   v0.9.10 – Übergabe vor Ort / Kamera / konsistente Karten
   ================================================================ */

/* Room status has no redundant text badge anymore. */
.room-status-btn{background:#fff;border-color:#ccd5dd;color:#263341}
.room-status-btn.pending-choice{background:#fff2ce;border-color:#e2c96f;color:#5f4c16}
.room-status-btn.selected-ok{background:#dff2e4;border-color:#8fc99d;color:#285f37}
.room-status-btn.selected-defect{background:#f9dedb;border-color:#d98f87;color:#8b2f28}
.room-status-btn.selected-ok,
.room-status-btn.selected-defect{font-weight:800}

/* Camera input is visually a large normal button; native file input stays hidden. */
.camera-upload{display:flex;flex-direction:column;gap:6px;margin-top:10px}
.camera-pick{width:100%;background:#eef5fa;border-color:#b8cad8;color:#244861;font-weight:800;cursor:pointer}
.camera-pick input{position:absolute;left:-10000px;width:1px;height:1px;opacity:0}
.camera-state{text-align:center;color:#647382;font-size:12px;min-height:1em}

/* Compact icon header for rooms, meters and keys. */
.workcard-head,
.meter-card-head,
.key-card-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:7px;align-items:center}
.workcard-head h3,
.meter-title,
.key-title{min-width:0;margin:0}
.edit-icon{font-weight:800}

/* Meter and key cards are structurally independent from their action buttons. */
.meterwork{display:block;border-bottom:1px solid #edf0f2;padding:15px 0}
.meter-card-head{margin-bottom:8px}
.meter-title{font-size:18px}
.meter-body{padding-left:30px}
.meter-meta{color:#667584;font-size:13px;margin-bottom:6px}
.meterphotos{margin-left:30px}
.meter-photo-actions{margin-left:30px;display:grid;grid-template-columns:1fr;gap:7px}
.meter-photo-actions .photo-upload,
.meter-photo-actions .camera-upload{width:100%;margin:0}
.meter-photo-actions .filepick,
.meter-photo-actions .photo-upload>.btn{width:100%}

.key-list{display:flex;flex-direction:column}
.keywork{display:block;border-bottom:1px solid #edf0f2;padding:14px 0}
.key-card-head{margin-bottom:5px}
.key-title{font-size:18px}
.key-meta{padding-left:30px;color:#667584}

/* Handover overview */
.card-full-action{width:100%;margin-top:12px}
.card-title-actions{display:flex;flex-direction:row;align-items:center;justify-content:space-between}
.card-title-actions h2{margin:0}
.assignment-summary-list{display:flex;flex-direction:column}
.assignment-summary-row{display:grid;grid-template-columns:160px minmax(0,1fr);gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid #edf0f2}
.assignment-summary-role{font-weight:800}
.assignment-summary-content{min-width:0}
.assignment-mobile-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;align-items:center}
.personline{justify-content:flex-end}
.personline>span{margin-right:auto;min-width:0;overflow-wrap:anywhere}
.people-role-block{margin-bottom:14px}
.people-add-form{display:grid;grid-template-columns:160px minmax(0,1fr) auto;gap:8px;margin-top:10px}

html.mobile-ui{
  /* Slightly less oversized headings while keeping the now approved readable body size. */
}
html.mobile-ui h1{font-size:34px}
html.mobile-ui h2{font-size:26px}
html.mobile-ui h3{font-size:23px}
html.mobile-ui .workcard-head h3{font-size:25px}
html.mobile-ui .btn{font-size:19px}
html.mobile-ui .sub,
html.mobile-ui .muted,
html.mobile-ui small{font-size:17px}

/* Room cards: title gets space; only pencil/trash at top right. */
html.mobile-ui .workcard-head{grid-template-columns:minmax(0,1fr) 54px 54px}
html.mobile-ui .workcard-head .drag{display:none}
html.mobile-ui .workcard-head h3{grid-column:1}
html.mobile-ui .workcard-head .iconbtn{width:54px}
html.mobile-ui .room-quick{grid-template-columns:1fr 1fr;gap:9px;margin:12px 0}
html.mobile-ui .room-quick .btn{width:100%;font-size:19px}
html.mobile-ui .camera-upload,
html.mobile-ui .gallery-upload{width:100%}
html.mobile-ui .gallery-upload{display:grid;grid-template-columns:1fr;gap:8px}
html.mobile-ui .gallery-upload .filepick,
html.mobile-ui .gallery-upload .btn{width:100%}
html.mobile-ui .camera-state{font-size:16px}

/* Meter card: pencil/trash next to name, everything else below. */
html.mobile-ui .meterwork{padding:16px 0}
html.mobile-ui .meter-card-head{grid-template-columns:minmax(0,1fr) 54px 54px}
html.mobile-ui .meter-card-head .drag{display:none}
html.mobile-ui .meter-title{font-size:24px}
html.mobile-ui .meter-body,
html.mobile-ui .meterphotos,
html.mobile-ui .meter-photo-actions{padding-left:0;margin-left:0;width:100%}
html.mobile-ui .meter-meta{font-size:18px;line-height:1.4}
html.mobile-ui .meter-reading{font-size:20px;display:flex;flex-direction:column;gap:3px}
html.mobile-ui .quick-reading-form{grid-template-columns:minmax(0,1fr) auto}
html.mobile-ui .meterphotos{justify-content:center}
html.mobile-ui .meter-photo-actions{display:grid;grid-template-columns:1fr;gap:8px;margin-top:8px}
html.mobile-ui .meter-photo-actions .camera-pick,
html.mobile-ui .meter-photo-actions .filepick,
html.mobile-ui .meter-photo-actions .photo-upload>.btn{width:100%;text-align:center}

/* Keys: same title/action alignment as meter cards. */
html.mobile-ui .keywork{display:block;padding:15px 0}
html.mobile-ui .key-card-head{grid-template-columns:minmax(0,1fr) 54px 54px}
html.mobile-ui .key-card-head .drag{display:none}
html.mobile-ui .key-title{font-size:24px}
html.mobile-ui .key-meta{padding-left:0;font-size:19px;line-height:1.4}

/* Overview cards */
html.mobile-ui .summarygrid{grid-template-columns:1fr}
html.mobile-ui .handover-general-card dl{margin-bottom:0}
html.mobile-ui .card-full-action{width:100%;margin-top:14px}
html.mobile-ui .card-title-actions{flex-direction:row;align-items:center;margin-bottom:12px}
html.mobile-ui .card-title-actions .iconbtn{flex:0 0 54px}
html.mobile-ui .assignment-summary-row{grid-template-columns:1fr;gap:7px;padding:13px 0}
html.mobile-ui .assignment-summary-role{font-size:21px}
html.mobile-ui .assignment-summary-content{width:100%}
html.mobile-ui .assignment-mobile-form{grid-template-columns:1fr;gap:8px;width:100%}
html.mobile-ui .assignment-mobile-form select,
html.mobile-ui .assignment-mobile-form .btn{width:100%}
html.mobile-ui .personline{display:grid;grid-template-columns:minmax(0,1fr) 54px 54px;gap:6px;align-items:center}
html.mobile-ui .personline>span{font-size:21px}
html.mobile-ui .people-role-block h3{margin-bottom:7px}
html.mobile-ui .people-add-form{grid-template-columns:1fr;gap:8px}
html.mobile-ui .people-add-form select,
html.mobile-ui .people-add-form .btn{width:100%}
html.mobile-ui .landlord-confirmation-card h2{font-size:24px;overflow-wrap:anywhere}

/* Structure view rows return to a compact, consistent touch layout. */
html.mobile-ui .structure-list .manage-row{
  display:grid;grid-template-columns:minmax(0,1fr) 54px 54px;gap:6px;align-items:center;padding:10px 0
}
html.mobile-ui .structure-list .manage-row>.drag{display:none}
html.mobile-ui .structure-list .manage-row>.grow{font-size:21px}
html.mobile-ui .structure-list .manage-row>.grow small{font-size:17px}

/* Prevent any remaining action row clipping on the phone. */
html.mobile-ui .handover-main-actions{display:grid;grid-template-columns:1fr;gap:8px}
html.mobile-ui .handover-main-actions>form,
html.mobile-ui .handover-main-actions .btn{width:100%}


/* ================================================================
   v0.9.11 – mobile Kartenhierarchie und Zählerlayout
   ================================================================ */

/* On mobile the outer "Räume" card is dissolved. The heading/add control gets
   its own card and every room is an equal full-width peer card below it. */
html.mobile-ui #rooms.rooms-section{
  background:transparent;
  border:0;
  box-shadow:none;
  padding:0;
  overflow:visible;
}
html.mobile-ui #rooms .rooms-section-head{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:12px;
  background:#fff;
  border:1px solid #dce3e8;
  border-radius:13px;
  padding:18px;
  margin:0 0 12px;
  box-shadow:0 1px 2px #00000008;
}
html.mobile-ui #rooms .rooms-section-head .inlineform{width:100%}
html.mobile-ui #rooms .roomcards{
  width:100%;
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
html.mobile-ui #rooms .workcard{
  width:100%;
  max-width:100%;
  margin:0;
  padding:18px;
  border:1px solid #dce3e8;
  border-radius:13px;
  box-shadow:0 1px 2px #00000008;
}

/* Completely reset the old desktop/mobile grid behavior for meter cards.
   Every meter is a normal vertical full-width card row. */
html.mobile-ui #meters .meterwork{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  grid-template-columns:none!important;
  gap:0!important;
  padding:18px 0!important;
  margin:0!important;
}
html.mobile-ui #meters .meterwork > *{
  grid-column:auto!important;
  width:100%;
  max-width:100%;
  min-width:0;
}
html.mobile-ui #meters .meter-card-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 54px 54px!important;
  gap:7px!important;
  align-items:center!important;
  width:100%!important;
  margin:0 0 10px!important;
}
html.mobile-ui #meters .meter-card-head .drag{display:none!important}
html.mobile-ui #meters .meter-title{
  grid-column:1!important;
  font-size:24px!important;
  line-height:1.2;
  margin:0!important;
  min-width:0;
}
html.mobile-ui #meters .meter-card-head .edit-icon{grid-column:2!important;width:54px}
html.mobile-ui #meters .meter-card-head form{grid-column:3!important;margin:0;width:54px}
html.mobile-ui #meters .meter-card-head form .iconbtn{width:54px}
html.mobile-ui #meters .meter-body{
  display:block!important;
  width:100%!important;
  padding:0!important;
  margin:0!important;
}
html.mobile-ui #meters .meter-meta{
  display:block;
  width:100%;
  margin:0 0 8px;
  font-size:18px;
  line-height:1.4;
}
html.mobile-ui #meters .meter-reading{
  display:flex!important;
  flex-direction:column!important;
  gap:4px!important;
  width:100%;
  margin:0 0 12px!important;
  font-size:20px;
}
html.mobile-ui #meters .quick-reading-form{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:8px!important;
  align-items:end!important;
  width:100%!important;
  margin:0 0 12px!important;
}
html.mobile-ui #meters .quick-reading-form label{width:100%;min-width:0}
html.mobile-ui #meters .quick-reading-form input{width:100%}
html.mobile-ui #meters .quick-reading-form .btn{
  min-width:132px;
  width:auto!important;
  height:56px;
}
html.mobile-ui #meters .quick-reading-form .save-state{
  grid-column:1/-1!important;
  width:100%;
}
html.mobile-ui #meters .meterphotos{
  display:flex!important;
  justify-content:flex-start!important;
  width:100%!important;
  margin:8px 0!important;
  padding:0!important;
}
html.mobile-ui #meters .meter-photo-actions{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:9px!important;
  width:100%!important;
  margin:10px 0 0!important;
  padding:0!important;
}
html.mobile-ui #meters .meter-photo-actions form{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:8px!important;
  width:100%!important;
  margin:0!important;
}
html.mobile-ui #meters .meter-photo-actions .camera-pick,
html.mobile-ui #meters .meter-photo-actions .filepick,
html.mobile-ui #meters .meter-photo-actions .btn{
  width:100%!important;
  max-width:100%!important;
  text-align:center;
}

/* Overview structure rows: anchors are exact return points and should not hide
   under the sticky header/navigation. */
html.mobile-ui [id^="overview-room-"],
html.mobile-ui [id^="overview-key-"],
html.mobile-ui [id^="overview-meter-"]{
  scroll-margin-top:190px;
}


/* ================================================================
   v0.9.12 – Live-Übergabe: Karten, Sticky-Menü, Anlege-Workflow
   ================================================================ */

/* Der Sticky-Abstand basiert auf der tatsächlich gemessenen Headerhöhe. */
html.mobile-ui .jump{
  top:calc(var(--app-header-height, 0px) + 10px)!important;
  margin-top:10px!important;
  z-index:80;
}
html.mobile-ui #rooms,
html.mobile-ui #meters,
html.mobile-ui #keys,
html.mobile-ui #control,
html.mobile-ui .live-item-card{
  scroll-margin-top:calc(var(--app-header-height, 0px) + var(--handover-jump-height, 72px) + 24px);
}

/* Räume, Zähler und Schlüssel haben mobil dieselbe Hierarchie:
   1 Kopfkarte mit Hinweis + Aufklappformular, danach einzelne Vollbreiten-Karten. */
html.mobile-ui #rooms.live-section,
html.mobile-ui #meters.live-section,
html.mobile-ui #keys.live-section{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
  overflow:visible!important;
}
html.mobile-ui .live-section-head{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:12px!important;
  width:100%;
  margin:0 0 12px!important;
  padding:18px!important;
  background:#fff;
  border:1px solid #dce3e8;
  border-radius:13px;
  box-shadow:0 1px 2px #00000008;
}
html.mobile-ui .live-section-head h2{margin-top:0}
html.mobile-ui .live-section-head .sub{margin-bottom:0}

html.mobile-ui .live-addbox{
  width:100%;
  margin:2px 0 0!important;
  border:1px solid #d9e0e6;
  border-radius:11px;
  background:#fbfcfd;
  overflow:hidden;
}
html.mobile-ui .live-addbox summary{
  min-height:56px;
  display:flex;
  align-items:center;
  padding:13px 15px;
  font-size:20px;
  font-weight:800;
  cursor:pointer;
  list-style:none;
}
html.mobile-ui .live-addbox summary::-webkit-details-marker{display:none}
html.mobile-ui .live-addbox[open] summary{border-bottom:1px solid #e2e7eb}
html.mobile-ui .live-addbox form{padding:15px}
html.mobile-ui .live-addbox .optionbox{margin:2px 0 0}
html.mobile-ui .live-addbox .btn.primary{width:100%;margin-top:4px}

html.mobile-ui .live-card-list{
  width:100%;
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:12px!important;
}
html.mobile-ui .live-item-card{
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:18px!important;
  background:#fff!important;
  border:1px solid #dce3e8!important;
  border-radius:13px!important;
  box-shadow:0 1px 2px #00000008!important;
}

/* Zähler: jede Einheit ist eine echte eigene Karte. */
html.mobile-ui .meter-live-groups{display:flex;flex-direction:column;gap:10px;width:100%}
html.mobile-ui #meters .group-heading{
  margin:2px 0 0!important;
  padding:10px 14px!important;
  border-radius:9px!important;
  font-size:18px!important;
}
html.mobile-ui #meters .meter-live-card{
  display:block!important;
  border-bottom:1px solid #dce3e8!important;
  padding:18px!important;
}
html.mobile-ui #meters .meter-card-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 54px 54px!important;
  gap:7px!important;
  align-items:center!important;
  width:100%!important;
  margin:0 0 10px!important;
}
html.mobile-ui #meters .meter-card-head .drag{display:none!important}
html.mobile-ui #meters .meter-title{
  font-size:24px!important;
  line-height:1.2!important;
  margin:0!important;
}
html.mobile-ui #meters .meter-body{
  display:block!important;
  width:100%!important;
  padding:0!important;
  margin:0!important;
}
html.mobile-ui #meters .meter-meta{
  width:100%;
  margin:0 0 8px!important;
  font-size:18px!important;
  line-height:1.4;
}
html.mobile-ui #meters .meter-reading{
  width:100%;
  display:flex!important;
  flex-direction:column!important;
  gap:4px!important;
  margin:0 0 12px!important;
  font-size:20px!important;
}
html.mobile-ui #meters .quick-reading-form{
  width:100%!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:8px!important;
  align-items:end!important;
  margin:0 0 12px!important;
}
html.mobile-ui #meters .quick-reading-form label,
html.mobile-ui #meters .quick-reading-form input{width:100%;min-width:0}
html.mobile-ui #meters .quick-reading-form .btn{
  width:auto!important;
  min-width:132px!important;
  height:56px!important;
}
html.mobile-ui #meters .quick-reading-form .save-state{grid-column:1/-1!important}
html.mobile-ui #meters .meterphotos{
  width:100%!important;
  margin:8px 0!important;
  padding:0!important;
  justify-content:flex-start!important;
}
html.mobile-ui #meters .meter-photo-actions{
  width:100%!important;
  margin:10px 0 0!important;
  padding:0!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:9px!important;
}
html.mobile-ui #meters .meter-photo-actions form{
  width:100%!important;
  margin:0!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:8px!important;
}
html.mobile-ui #meters .meter-photo-actions .camera-pick,
html.mobile-ui #meters .meter-photo-actions .filepick,
html.mobile-ui #meters .meter-photo-actions .btn{
  width:100%!important;
  max-width:100%!important;
  text-align:center;
}

/* Schlüssel: dieselbe Kartenlogik plus Fotos. */
html.mobile-ui #keys .key-live-card{display:block!important}
html.mobile-ui #keys .key-card-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 54px 54px!important;
  gap:7px!important;
  align-items:center!important;
  width:100%!important;
  margin-bottom:7px!important;
}
html.mobile-ui #keys .key-card-head .drag{display:none!important}
html.mobile-ui #keys .key-title{font-size:24px!important}
html.mobile-ui #keys .key-meta{padding:0!important;font-size:19px!important;line-height:1.4}
html.mobile-ui #keys .key-remark{margin-top:8px;font-size:19px;line-height:1.4}
html.mobile-ui #keys .keyphotos{width:100%;margin:10px 0}
html.mobile-ui #keys .key-photo-actions{
  width:100%;
  display:grid;
  grid-template-columns:1fr;
  gap:9px;
  margin-top:10px;
}
html.mobile-ui #keys .key-photo-actions form{
  width:100%;
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  margin:0;
}
html.mobile-ui #keys .key-photo-actions .camera-pick,
html.mobile-ui #keys .key-photo-actions .filepick,
html.mobile-ui #keys .key-photo-actions .btn{width:100%;max-width:100%;text-align:center}

/* Kontrolle soll als Zielkarte sichtbar direkt unter dem Sticky-Menü landen. */
html.mobile-ui #control{margin-top:12px}


/* ================================================================
   v0.9.13 – Feinschliff Live-Übergabe mobil
   ================================================================ */

/*
  Sticky-Menü:
  Kein transparenter Spalt mehr zwischen App-Header und Sprungnavigation.
  Der optische Abstand entsteht innerhalb der Sprungleiste durch ihr Padding,
  nicht durch einen freien Bereich, durch den Seiteninhalt sichtbar wird.
*/
html.mobile-ui .jump{
  top:var(--app-header-height, 0px)!important;
  margin-top:6px!important;
}

/* Sprungziel direkt unterhalb der kompletten Sticky-Navigation positionieren. */
html.mobile-ui #rooms,
html.mobile-ui #meters,
html.mobile-ui #keys,
html.mobile-ui #control,
html.mobile-ui .live-item-card{
  scroll-margin-top:calc(
    var(--app-header-height, 0px) +
    var(--handover-jump-height, 72px) +
    8px
  )!important;
}

/*
  Einheitlicher Standardabstand zwischen den großen Bereichen:
  letzter Raum -> Zähler-Kopfkarte
  letzter Zähler -> Schlüssel-Kopfkarte
  Schlüssel -> Kontrolle
*/
html.mobile-ui .live-section + .live-section{
  margin-top:14px!important;
}
html.mobile-ui #control{
  margin-top:14px!important;
}

/*
  Aufklappbereich nicht mehr als schmaler Kasten im Kasten.
  Er gehört optisch zur Kopfkarte und läuft bis zu deren Innenkante.
  Damit entspricht die Flächennutzung wieder dem früheren,
  platzsparenderen Zähler-Aufklappbereich.
*/
html.mobile-ui .live-section-head .live-addbox{
  width:auto!important;
  max-width:none!important;
  margin:6px -18px -18px!important;
  border-left:0!important;
  border-right:0!important;
  border-bottom:0!important;
  border-radius:0 0 13px 13px!important;
  background:#fbfcfd;
}
html.mobile-ui .live-section-head .live-addbox summary{
  width:100%!important;
  padding:14px 18px!important;
  border-radius:0!important;
}
html.mobile-ui .live-section-head .live-addbox form{
  width:100%!important;
  max-width:100%!important;
  padding:16px 18px 18px!important;
}
html.mobile-ui .live-section-head .live-addbox form > .btn.primary{
  width:100%!important;
}

/* Die kurze Bezeichnung verhindert unnötige Umbrüche. */
html.mobile-ui #meters .live-section-head h2{
  white-space:nowrap;
}


/* ================================================================
   v0.9.14 – Auszugsübersicht und Vorbereitungsübersicht
   ================================================================ */

/* Übergabeliste mobil: Vorgang zuerst links, Status darunter. */
html.mobile-ui .handover-list-row{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:8px!important;
}
html.mobile-ui .handover-list-row .handover-mobile-title{
  grid-column:1!important;
  grid-row:1!important;
  justify-self:start!important;
  text-align:left!important;
  width:100%;
  font-size:25px!important;
}
html.mobile-ui .handover-list-row .handover-mobile-status{
  grid-column:1!important;
  grid-row:2!important;
  justify-self:start!important;
  width:auto!important;
  max-width:100%!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
}
html.mobile-ui .handover-list-row [data-mobile-label]{
  grid-column:1!important;
}

/* Mietbeginn/Mietende stehen im Auszug kompakt nebeneinander. */
.general-period-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:12px;
}
.general-period-grid.single-period{grid-template-columns:1fr}
.general-field{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}
.general-label{
  font-size:12px;
  font-weight:800;
  color:#6f7d89;
  text-transform:uppercase;
  letter-spacing:.03em;
}
html.mobile-ui .general-period-grid{gap:10px}
html.mobile-ui .general-label{font-size:17px}
html.mobile-ui .general-field>span:last-child{font-size:21px}

/* Verantwortliche / Mieter-Bewohner: deutlich kompakter, wie Allgemeines. */
.compact-people-card{padding-bottom:10px}
.compact-role-row{
  display:grid;
  grid-template-columns:160px minmax(0,1fr);
  gap:12px;
  align-items:center;
  padding:7px 0;
  border-bottom:1px solid #edf0f2;
}
.compact-role-row:last-child{border-bottom:0}
.compact-role-label{font-weight:800}
.compact-role-content{min-width:0}
.compact-personline{min-height:0!important;padding:0!important}
.compact-assignment-form{margin:0}
html.mobile-ui .compact-people-card{padding:18px}
html.mobile-ui .compact-people-card h2{margin:0 0 10px}
html.mobile-ui .compact-role-row{
  grid-template-columns:1fr;
  gap:4px;
  padding:8px 0;
}
html.mobile-ui .compact-role-label{
  font-size:17px;
  color:#6f7d89;
  text-transform:uppercase;
  letter-spacing:.03em;
}
html.mobile-ui .compact-role-content{width:100%}
html.mobile-ui .compact-personline{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 48px!important;
  gap:6px!important;
  align-items:center!important;
}
html.mobile-ui .compact-personline>span{font-size:21px}
html.mobile-ui .compact-personline .iconbtn{
  width:48px!important;
  min-width:48px!important;
  min-height:48px!important;
}
html.mobile-ui .compact-people-card .people-role-block{margin:0}

/* Arbeitsstruktur: alle drei Aufklapper gleich, volle nutzbare Breite. */
html.mobile-ui #arbeitsstruktur .overview-addbox{
  width:100%;
  max-width:100%;
  margin:10px 0 0!important;
  border:1px solid #d9e0e6;
  border-radius:11px;
  overflow:hidden;
  background:#fbfcfd;
}
html.mobile-ui #arbeitsstruktur .overview-addbox summary{
  min-height:56px;
  display:flex;
  align-items:center;
  padding:13px 15px;
  font-size:20px;
  font-weight:800;
  list-style:none;
}
html.mobile-ui #arbeitsstruktur .overview-addbox summary::-webkit-details-marker{display:none}
html.mobile-ui #arbeitsstruktur .overview-addbox[open] summary{border-bottom:1px solid #e2e7eb}
html.mobile-ui #arbeitsstruktur .overview-addbox form{
  width:100%;
  padding:15px;
}
html.mobile-ui #arbeitsstruktur .overview-addbox .btn.primary{width:100%}

/* Rücksprunganker neuer Datensätze unterhalb des mobilen Headers platzieren. */
html.mobile-ui [id^="overview-room-"],
html.mobile-ui [id^="overview-key-"],
html.mobile-ui [id^="overview-meter-"]{
  scroll-margin-top:190px;
}


/* ================================================================
   v0.9.15 – Auszug: Vermieter/Mieter + protokollbezogene Zusatzpersonen
   ================================================================ */

/* Zusatzpersonen und Struktur-Aufklapper verwenden dieselbe Komponente wie
   die Live-Übergabe: volle Kartenbreite, Trennlinie, Formular direkt darunter. */
html.mobile-ui .overview-person-addbox,
html.mobile-ui #arbeitsstruktur .overview-addbox.live-addbox{
  width:auto!important;
  max-width:none!important;
  margin:10px 0 0!important;
  border:1px solid #d9e0e6!important;
  border-radius:11px!important;
  background:#fbfcfd!important;
  overflow:hidden!important;
}
html.mobile-ui .overview-person-addbox summary,
html.mobile-ui #arbeitsstruktur .overview-addbox.live-addbox summary{
  min-height:56px;
  display:flex;
  align-items:center;
  width:100%;
  padding:13px 15px!important;
  font-size:20px!important;
  font-weight:800;
  list-style:none;
}
html.mobile-ui .overview-person-addbox summary::-webkit-details-marker,
html.mobile-ui #arbeitsstruktur .overview-addbox.live-addbox summary::-webkit-details-marker{display:none}
html.mobile-ui .overview-person-addbox[open] summary,
html.mobile-ui #arbeitsstruktur .overview-addbox.live-addbox[open] summary{border-bottom:1px solid #e2e7eb}
html.mobile-ui .overview-person-addbox form,
html.mobile-ui #arbeitsstruktur .overview-addbox.live-addbox form{
  width:100%!important;
  max-width:100%!important;
  padding:15px!important;
}
html.mobile-ui .overview-person-addbox .btn.primary,
html.mobile-ui #arbeitsstruktur .overview-addbox.live-addbox .btn.primary{width:100%!important}

/* Vermieter/Mieter möglichst informationsdicht wie Allgemeines. */
html.mobile-ui .compact-people-card .compact-role-row{
  padding:7px 0!important;
  gap:3px!important;
}
html.mobile-ui .compact-people-card .compact-role-label{
  font-size:16px!important;
}
html.mobile-ui .compact-people-card .compact-role-content small{
  display:block;
  margin-top:2px;
  font-size:16px!important;
  color:#6f7d89;
}
html.mobile-ui .compact-personline{
  grid-template-columns:minmax(0,1fr) 48px auto!important;
}
html.mobile-ui .compact-personline form{
  margin:0;
  width:48px;
}
html.mobile-ui .compact-personline form .iconbtn{
  width:48px!important;
  min-width:48px!important;
}
html.mobile-ui [id^="handover-person-"]{
  scroll-margin-top:calc(var(--app-header-height, 0px) + 14px);
}


/* ================================================================
   v0.9.16 – Übergabeliste Mietzeit + Arbeitsstruktur wie Live-Ansicht
   ================================================================ */

/* Mietzeit besteht beim Auszug aus zwei echten Teilspalten. */
.handover-tenancy-period{
  display:grid!important;
  grid-template-columns:1fr 1fr;
  gap:12px;
  min-width:0;
}
.handover-period-part{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.handover-period-part small{
  display:block;
  margin-bottom:2px;
  color:#6f7d89;
  font-weight:700;
}
.handover-period-part b{font-weight:400}

/* Arbeitsstruktur: Kategorien liegen nicht mehr in einer großen Umgebungs-Karte. */
.overview-workstructure{
  grid-column:1/-1;
  display:flex;
  flex-direction:column;
  gap:18px;
  min-width:0;
}
.overview-workstructure-intro{margin:0}
.overview-structure-section{
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:0;
}
.overview-structure-head{
  margin:0;
  overflow:hidden;
}
.overview-structure-head>h3{margin-top:0}
.overview-structure-list{
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:0;
}
.overview-structure-item{
  margin:0!important;
}
.overview-group-heading{
  margin:2px 0 0;
}

/* Der Hinzufügen-Aufklapper bildet wie in der Live-Ansicht den unteren Abschluss
   der jeweiligen Kopfkarte, statt als eingerückte Karte in ihr zu schweben. */
.overview-structure-head>.overview-addbox{
  width:auto;
  max-width:none;
  margin:14px -22px -22px!important;
  border-left:0!important;
  border-right:0!important;
  border-bottom:0!important;
  border-radius:0!important;
  background:#fbfcfd;
}
.overview-structure-head>.overview-addbox summary{
  padding-left:22px!important;
  padding-right:22px!important;
}
.overview-structure-head>.overview-addbox form{
  padding-left:22px!important;
  padding-right:22px!important;
}

/* Mobil exakt dieselbe Kartenebene wie bei "Übergabe durchführen". */
html.mobile-ui .handover-tenancy-period{
  grid-template-columns:1fr 1fr!important;
  gap:14px!important;
  width:100%;
}
html.mobile-ui .handover-tenancy-period::before{
  grid-column:1/-1;
}
html.mobile-ui .handover-period-part small{font-size:16px!important}
html.mobile-ui .handover-period-part b{font-size:20px!important}

html.mobile-ui .overview-workstructure{
  display:flex!important;
  flex-direction:column!important;
  gap:14px!important;
}
html.mobile-ui .overview-workstructure-intro,
html.mobile-ui .overview-structure-head,
html.mobile-ui .overview-structure-item{
  width:100%!important;
  max-width:100%!important;
}
html.mobile-ui .overview-structure-section{
  gap:12px!important;
}
html.mobile-ui .overview-structure-head{
  padding:18px!important;
  border-radius:13px!important;
}
html.mobile-ui .overview-structure-head>h3{
  font-size:26px!important;
  margin:0 0 8px!important;
}
html.mobile-ui .overview-structure-head>.sub{
  margin:0;
}
html.mobile-ui .overview-structure-head>.overview-addbox{
  width:auto!important;
  max-width:none!important;
  margin:14px -18px -18px!important;
  border-left:0!important;
  border-right:0!important;
  border-bottom:0!important;
  border-radius:0 0 13px 13px!important;
}
html.mobile-ui .overview-structure-head>.overview-addbox summary{
  width:100%!important;
  padding:14px 18px!important;
}
html.mobile-ui .overview-structure-head>.overview-addbox form{
  width:100%!important;
  padding:16px 18px 18px!important;
}
html.mobile-ui .overview-structure-list{
  gap:12px!important;
}
html.mobile-ui .overview-structure-item{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 54px 54px!important;
  gap:6px!important;
  align-items:center!important;
  padding:18px!important;
  border-radius:13px!important;
}
html.mobile-ui .overview-structure-item>.drag{display:none!important}
html.mobile-ui .overview-structure-item>.grow{
  font-size:22px!important;
}
html.mobile-ui .overview-structure-item>.grow small{
  display:block;
  margin-top:3px;
  font-size:17px!important;
  color:#6f7d89;
}
html.mobile-ui .overview-structure-item>form{
  margin:0;
  width:54px;
}
html.mobile-ui .overview-structure-item .iconbtn{
  width:54px!important;
  min-width:54px!important;
}
html.mobile-ui .overview-group-heading{
  margin:2px 0 0!important;
  padding:10px 14px!important;
  border-radius:9px!important;
}


/* ================================================================
   v0.9.17 – Vorbereitungsübersicht bewusst kompakt
   ================================================================ */

.overview-summary-card{
  overflow:hidden;
  margin:0;
}
.overview-summary-card>h2{margin-top:0}
.overview-summary-card>.sub{margin-bottom:0}

/* +Hinzufügen ist keine kleinere Karte in der Karte.
   Es bildet eine vollbreite Ebene wie in "Übergabe durchführen". */
.overview-fullbleed-addbox{
  width:auto;
  max-width:none;
  margin:16px -22px 0!important;
  border-left:0!important;
  border-right:0!important;
  border-radius:0!important;
  background:#fbfcfd;
}
.overview-fullbleed-addbox summary{
  padding:14px 22px!important;
  min-height:56px;
  display:flex;
  align-items:center;
  font-weight:800;
  list-style:none;
}
.overview-fullbleed-addbox summary::-webkit-details-marker{display:none}
.overview-fullbleed-addbox[open] summary{border-bottom:1px solid #e2e7eb}
.overview-fullbleed-addbox form{
  width:100%;
  max-width:100%;
  padding:16px 22px 18px!important;
}
.overview-fullbleed-addbox .btn.primary{width:100%}

/* Bestandsdaten bleiben INNERHALB derselben großen Karte.
   Keine einzelnen Unterkarten und kein grauer Zwischenraum. */
.overview-inline-list{
  display:flex;
  flex-direction:column;
  width:100%;
}
.overview-inline-row{
  display:grid;
  grid-template-columns:28px minmax(0,1fr) 42px 42px;
  gap:7px;
  align-items:center;
  width:100%;
  padding:12px 0;
  border-top:1px solid #e8ecef;
}
.overview-inline-row:first-child{border-top:1px solid #e0e5e9}
.overview-inline-row .grow{min-width:0}
.overview-inline-row .grow small{
  display:block;
  margin-top:2px;
  color:#6f7d89;
}
.overview-inline-row form{margin:0}
.overview-inline-groups{width:100%}
.overview-inline-group-heading{
  margin:12px 0 0!important;
}
.overview-inline-group-heading + .overview-inline-list .overview-inline-row:first-child{
  border-top:0;
}
.overview-conduct-form{margin:0}
.overview-conduct-button{width:100%}

/* Mobil: dieselbe kompakte Informationskarte, aber fingerfreundliche Aktionen. */
html.mobile-ui .overview-summary-card{
  width:100%!important;
  max-width:100%!important;
  padding:18px!important;
  border-radius:13px!important;
}
html.mobile-ui .overview-summary-card>h2{
  margin:0 0 8px!important;
  font-size:26px!important;
}
html.mobile-ui .overview-summary-card>.sub{
  margin:0!important;
}
html.mobile-ui .overview-fullbleed-addbox{
  width:auto!important;
  max-width:none!important;
  margin:14px -18px 0!important;
  border-left:0!important;
  border-right:0!important;
  border-radius:0!important;
}
html.mobile-ui .overview-fullbleed-addbox summary{
  width:100%!important;
  padding:14px 18px!important;
  font-size:20px!important;
}
html.mobile-ui .overview-fullbleed-addbox form{
  width:100%!important;
  max-width:100%!important;
  padding:16px 18px 18px!important;
}
html.mobile-ui .overview-inline-row{
  grid-template-columns:minmax(0,1fr) 54px 54px!important;
  gap:6px!important;
  padding:13px 0!important;
  border-top:1px solid #e5e9ec!important;
}
html.mobile-ui .overview-inline-row>.drag{display:none!important}
html.mobile-ui .overview-inline-row>.grow b{
  display:block;
  font-size:21px!important;
}
html.mobile-ui .overview-inline-row>.grow small{
  display:block;
  margin-top:2px;
  font-size:17px!important;
}
html.mobile-ui .overview-inline-row .iconbtn{
  width:54px!important;
  min-width:54px!important;
  min-height:54px!important;
}
html.mobile-ui .overview-inline-row>form{
  width:54px!important;
  margin:0!important;
}
html.mobile-ui .overview-inline-group-heading{
  margin:12px 0 0!important;
  padding:8px 12px!important;
  border-radius:8px!important;
  font-size:17px!important;
}
html.mobile-ui .overview-control-card{
  margin-top:0!important;
}
html.mobile-ui .overview-conduct-form{
  width:100%!important;
}
html.mobile-ui .overview-conduct-button{
  width:100%!important;
  min-height:58px!important;
  font-size:20px!important;
}

/* Direkte Rücksprünge auf Zeilen nicht unter dem mobilen Header verstecken. */
html.mobile-ui [id^="overview-room-"],
html.mobile-ui [id^="overview-meter-"],
html.mobile-ui [id^="overview-key-"]{
  scroll-margin-top:190px!important;
}


/* ================================================================
   v0.10.0 - Abschlusskontrolle, Signaturen, Protokoll und Mail
   ================================================================ */
.review-card{position:relative;overflow:hidden}.review-card>h2{margin-top:0}.review-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.review-grid>div{display:flex;flex-direction:column;gap:3px}.review-grid small,.review-line small{color:#6f7d89}.review-wide{grid-column:1/-1}.review-edit{position:absolute;right:18px;top:16px}.review-line{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:start;padding:10px 0;border-top:1px solid #e6eaed}.review-line:first-of-type{border-top:0}.review-line>span{display:flex;flex-direction:column;gap:3px}.review-actions{margin-top:16px}.lead{color:#657482;max-width:900px}
.signer-choice{display:flex!important;flex-direction:row!important;align-items:center!important;gap:12px;padding:12px 0;border-bottom:1px solid #e8ecef}.signer-choice input[type=checkbox]{width:24px;height:24px;flex:0 0 auto}.signer-choice span{display:flex;flex-direction:column;gap:2px}.signer-choice small{color:#6f7d89}.signature-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:10px;align-items:center;padding:12px 0;border-top:1px solid #e7ebee}.signature-row:first-of-type{border-top:0}.signature-row>span:first-child{display:flex;flex-direction:column}.signature-row small{color:#6f7d89}.signed-ok{color:#26734d;font-weight:700}
.signature-capture{max-width:920px}.signature-capture canvas{display:block;width:100%;height:280px;background:#fff;border:2px solid #cbd4da;border-radius:12px;touch-action:none;box-shadow:inset 0 0 0 1px #fff}.signature-tools{display:flex;justify-content:flex-end;margin:10px 0}.signature-capture form .btn{width:100%;min-height:58px}
.protocol-actions{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px}.hashtext{font-family:monospace;font-size:12px;word-break:break-all}.mail-log{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:10px 0;border-top:1px solid #e6eaed}.mail-log:first-of-type{border-top:0}.mail-log>span{display:flex;flex-direction:column}.mail-log small{color:#6f7d89}.mail-log.failed{color:#a0372f}.correction-card textarea{width:100%;min-height:90px}

html.mobile-ui .review-grid{grid-template-columns:1fr 1fr!important;gap:10px!important}html.mobile-ui .review-card h2{padding-right:54px}html.mobile-ui .review-line{padding:12px 0!important}html.mobile-ui .review-line b{font-size:20px}html.mobile-ui .review-line span span{font-size:18px;line-height:1.35}html.mobile-ui .review-actions{display:grid!important;grid-template-columns:1fr!important}html.mobile-ui .review-actions .btn{width:100%!important}html.mobile-ui .signature-row{grid-template-columns:1fr!important;gap:8px!important}html.mobile-ui .signature-row .btn{width:100%!important}html.mobile-ui .signature-row form{width:100%}html.mobile-ui .signature-capture canvas{height:250px}html.mobile-ui .protocol-actions{display:grid;grid-template-columns:1fr}html.mobile-ui .protocol-actions .btn{width:100%}html.mobile-ui .mail-log{grid-template-columns:1fr!important}html.mobile-ui .signer-plan .btn.primary{width:100%}


/* v0.10.1 – Abschlusskontrolle: Bearbeiten + Löschen */
.review-line-actions{
  grid-template-columns:minmax(0,1fr) auto auto!important;
  align-items:center!important;
}
.review-line-actions>form{
  margin:0;
}
html.mobile-ui .review-line-actions{
  grid-template-columns:minmax(0,1fr) 54px 54px!important;
  gap:6px!important;
}
html.mobile-ui .review-line-actions .iconbtn{
  width:54px!important;
  min-width:54px!important;
  min-height:54px!important;
}
html.mobile-ui .review-line-actions>form{
  width:54px!important;
  margin:0!important;
}


/* ================================================================
   v0.10.2 – Unterzeichnerauswahl und Signaturbedienung mobil
   ================================================================ */

/* "Mieter nicht erschienen" als große, eindeutig antippbare Auswahl. */
.tenant-absence-choice{
  display:flex!important;
  flex-direction:row!important;
  align-items:flex-start!important;
  gap:14px!important;
  cursor:pointer;
  padding:6px 0!important;
}
.tenant-absence-choice input[type=checkbox]{
  width:30px!important;
  height:30px!important;
  min-width:30px!important;
  flex:0 0 30px!important;
  margin:2px 0 0!important;
  accent-color:#1683e8;
}
.tenant-absence-choice span{
  flex:1 1 auto;
  min-width:0;
  line-height:1.35;
  font-weight:700;
}
html.mobile-ui .tenant-absence-box{
  padding:16px!important;
}
html.mobile-ui .tenant-absence-choice{
  gap:16px!important;
  padding:4px 0 10px!important;
}
html.mobile-ui .tenant-absence-choice input[type=checkbox]{
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  flex-basis:38px!important;
}
html.mobile-ui .tenant-absence-choice span{
  font-size:20px!important;
  line-height:1.3!important;
}

/* Signatur: beide Aktionen direkt sichtbar unter dem Unterschriftsfeld. */
.signature-actions{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:12px!important;
  margin:12px 0 0!important;
  width:100%;
}
.signature-actions .btn{
  width:100%!important;
  min-height:58px!important;
}
html.mobile-ui .signature-actions{
  grid-template-columns:1fr 1fr!important;
  gap:10px!important;
}
html.mobile-ui .signature-actions .btn{
  min-height:62px!important;
  font-size:19px!important;
  padding-left:8px!important;
  padding-right:8px!important;
}

/* ================================================================
   v0.12.0 – Benutzerverwaltung / Anmeldung / Passkeys
   ================================================================ */
.nav-logout{display:inline-flex;margin:0}.nav-logout button{border:0;background:transparent;color:inherit;font:inherit;font-weight:700;padding:10px 13px;cursor:pointer;white-space:nowrap}.nav-logout button:hover{background:#eef2f5;border-radius:9px}
.auth-page{background:#f2f5f7}.auth-shell{max-width:620px;margin:0 auto;padding:42px 20px}.auth-brand{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;font-size:18px}.auth-brand b{font-size:24px}.auth-brand span{color:#73818d}.auth-card{padding:26px}.auth-card h1{margin-top:0}.auth-card .btn{width:100%;min-height:52px}.passkey-main{font-size:18px;margin:12px 0}.auth-status{min-height:25px;margin:10px 0;color:#26734d;font-weight:700}.auth-status.error{color:#a0372f}.trust-choice{display:flex!important;flex-direction:row!important;gap:12px!important;align-items:flex-start!important;padding:12px 0}.trust-choice input{width:26px!important;height:26px!important;min-width:26px!important;margin-top:2px}.trust-choice span{display:flex;flex-direction:column;gap:3px}.trust-choice small{color:#6f7d89;font-weight:400}.security-info{margin-bottom:16px}.security-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:11px 0;border-top:1px solid #e6eaed}.security-row:first-of-type{border-top:0}.security-row>span{display:flex;flex-direction:column}.security-row small{color:#6f7d89}.passkey-register{border-top:1px solid #e6eaed;margin-top:10px;padding-top:14px}.passkey-register .btn{width:100%}.recovery-codes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:18px 0}.recovery-codes code{display:block;background:#f1f4f6;padding:12px;border-radius:8px;text-align:center;font-size:17px}.user-list{display:flex;flex-direction:column}.user-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;gap:10px;align-items:center;padding:13px 0;border-top:1px solid #e6eaed}.user-row:first-child{border-top:0}.user-row>.grow{display:flex;flex-direction:column}.user-row small{color:#6f7d89}.disabled-user{opacity:.6}.audit-row{display:grid;grid-template-columns:145px 160px minmax(220px,1fr);gap:10px;padding:10px 0;border-top:1px solid #e6eaed;align-items:start}.audit-row:first-child{border-top:0}.audit-row small{grid-column:3;color:#6f7d89}.pager{display:flex;gap:10px;margin-top:14px}
html.mobile-ui .auth-shell{padding:20px 14px}html.mobile-ui .auth-card{padding:20px}html.mobile-ui .auth-brand b{font-size:21px}html.mobile-ui .trust-choice input{width:34px!important;height:34px!important;min-width:34px!important}html.mobile-ui .security-row{grid-template-columns:minmax(0,1fr) auto!important}html.mobile-ui .security-row form .btn{width:auto!important}html.mobile-ui .recovery-codes{grid-template-columns:1fr!important}html.mobile-ui .user-row{grid-template-columns:minmax(0,1fr) 52px!important}html.mobile-ui .user-row>form{grid-column:1/-1;width:100%}html.mobile-ui .user-row>form .btn{width:100%!important}html.mobile-ui .audit-row{grid-template-columns:1fr!important;gap:3px!important}html.mobile-ui .audit-row small{grid-column:1!important}.auth-page .flash{margin-bottom:14px}
@media print{header,.back,.btn,.warning+button{display:none!important}.recovery-card{box-shadow:none;border:0}.recovery-codes{grid-template-columns:repeat(2,1fr)}}
