:root{
  font-family:Verdana,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#D2D2D2;background:#0c0c0c;
  --bg:#0c0c0c;--panel:#151515;--panel2:#1d1d1d;--text:#D2D2D2;--muted:#999;--border:#404040;
  --border-light:#888;--accent:#b7c4ff;--control:#d9e5ef;--danger:#d87070;
}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}body{padding-bottom:62px}
header{position:sticky;top:0;z-index:20;background:#0c0c0c;color:var(--text);padding:.65rem .9rem;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;gap:.8rem;align-items:center;min-height:54px}
.brand{display:flex;align-items:baseline;gap:.45rem}.brand strong{font-size:1.15rem}.brand #version{font-size:.72rem;color:var(--muted)}
.header-right{display:flex;align-items:center;gap:.8rem;min-width:0}.status{font-size:.72rem;color:#aaa;text-align:right;white-space:nowrap}.user-badge{display:flex;align-items:center;gap:.4rem;min-width:0;font-size:.82rem}.user-badge .avatar,.note-avatar{width:28px;height:28px;border:1px solid var(--border-light);border-radius:50%;display:grid;place-items:center;background:#1f1f1f;color:var(--accent);font-weight:700;flex:0 0 auto}.user-badge .user-name{max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
nav{position:fixed;left:0;right:0;bottom:0;z-index:30;height:58px;display:flex;background:#0c0c0c;border-top:1px solid var(--border);overflow-x:auto;padding-bottom:env(safe-area-inset-bottom)}
nav button{min-width:72px;flex:1;border:0;border-radius:0;background:transparent;color:var(--text);padding:.25rem .35rem;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.15rem;font-size:.68rem;white-space:nowrap;box-shadow:none}
nav button img{width:25px;height:25px;object-fit:contain;opacity:.72}nav button.active{color:#fff;background:#171717;border-top:2px solid var(--accent);font-weight:700}nav button.active img{opacity:1}
main{max-width:930px;margin:auto;padding:1rem 1rem 1.5rem}.view{display:none}.view.active{display:block}h1{font-size:1.25rem;margin:.25rem 0 1rem}h2{font-size:1rem;margin:.2rem 0 .7rem}h3{font-size:.95rem}
.rowform{display:flex;gap:.5rem;margin-bottom:.8rem}.rowform input{flex:1;min-width:0}.full{width:100%;margin-bottom:.8rem}.gridform{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;margin-bottom:1rem}.gridform label,fieldset label,.dialogform label{display:flex;flex-direction:column;gap:.25rem}.wide{grid-column:1/-1}
input,textarea,button,select{font:inherit}input,textarea,select{padding:.62rem;border:1px solid var(--border-light);border-radius:5px;background:#111;color:var(--text);outline:0}input:focus,textarea:focus,select:focus{border-color:var(--accent)}textarea{min-height:5rem}
button,.filebutton,.buttonlink{padding:.56rem .75rem;border:1px solid var(--border-light);border-radius:5px;background:#171717;color:var(--text);cursor:pointer;box-shadow:1px 1px rgba(0,0,0,.45);text-decoration:none}button:hover,.filebutton:hover,.buttonlink:hover{background:#222}.button-icon{display:inline-block;min-width:1.15em;color:var(--accent);font-weight:700}.buttons{display:flex;gap:.5rem;flex-wrap:wrap}.filebutton{display:inline-block}.filebutton input{display:none}
.list{display:grid;gap:.65rem}.card{background:rgba(12,12,12,.75);border:1px solid var(--border);border-radius:6px;padding:.75rem;display:flex;gap:.8rem;align-items:flex-start}.card .content{flex:1;min-width:0}.card .actions{display:flex;gap:.35rem;flex-wrap:wrap}.card img{max-width:140px;max-height:120px;object-fit:cover;border-radius:5px}.muted,.hint{color:var(--muted);font-size:.82rem}.done{text-decoration:line-through;opacity:.6}
.note-content{display:flex;gap:.65rem;align-items:flex-start}.note-body{flex:1;min-width:0}.note-meta{display:flex;gap:.4rem;align-items:center;color:var(--muted);font-size:.72rem;margin-top:.35rem}.note-avatar{width:24px;height:24px;font-size:.7rem}
fieldset{border:1px solid var(--border);border-radius:6px;margin:1rem 0;padding:1rem;display:grid;gap:.7rem;background:#101010}legend{color:var(--accent);padding:0 .35rem}.danger,.buttonlink.danger{border-color:#8d4545;color:#f1b0b0}pre{white-space:pre-wrap;word-break:break-word;background:#050505;border:1px solid #292929;padding:.7rem;border-radius:5px;color:#bbb}
.structure-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}.structure-panel{border:1px solid var(--border);border-radius:6px;background:#101010;padding:.8rem}.structure-panel:last-child{grid-column:1/-1}.compact-list .card{padding:.6rem}.membership-line{font-size:.75rem;color:var(--muted)}.current-person{border-color:var(--accent)}.mini-avatar{color:var(--accent)}
.storage-ok{color:#9ad18b}.storage-warn{color:#e2c26e}.storage-unknown{color:var(--muted)}
dialog{width:min(92vw,620px);border:1px solid var(--border-light);border-radius:7px;padding:0;background:#101010;color:var(--text);box-shadow:0 16px 50px rgba(0,0,0,.65)}dialog::backdrop{background:rgba(0,0,0,.7)}.dialogform{display:grid;gap:.8rem;padding:1rem}.dialogform h2{margin:.1rem 0 .3rem}.dialogform .checkline{flex-direction:row;align-items:center}.statusline{min-height:1.2em;font-size:.86rem}.busy-note{font-size:.82rem;color:var(--muted)}.provider-config{display:none;border-top:1px solid var(--border);padding-top:.7rem}.provider-config.active{display:grid;gap:.7rem}.compact-fieldset{margin:.2rem 0;padding:.7rem}#identityCodeSection{display:grid;gap:.7rem;border-top:1px solid var(--border);padding-top:.7rem}#identityCodeSection[hidden]{display:none}
@media(max-width:700px){header{align-items:flex-start}.header-right{flex-direction:column;align-items:flex-end;gap:.2rem}.status{font-size:.64rem}.user-badge .user-name{max-width:110px}.gridform,.structure-grid{grid-template-columns:1fr}.structure-panel:last-child{grid-column:auto}.card{flex-direction:column}.card .actions{width:100%}main{padding:.8rem}.rowform{flex-wrap:wrap}.rowform input{flex-basis:65%}nav button{min-width:64px}}

/* 4.4.1: kompakte reine Icon-Schaltflächen in Pinnwand und Inventar */
button.icon-only{min-width:2.45rem;min-height:2.35rem;padding:.45rem;display:inline-flex;align-items:center;justify-content:center}button.icon-only .button-icon{min-width:0;font-size:1.08rem;line-height:1}

/* 4.4.3: sichere untere Navigation und bedarfsgesteuerte Editoren */
:root{--bottom-nav-height:66px}
body{padding-bottom:calc(var(--bottom-nav-height) + env(safe-area-inset-bottom,0px))}
nav{height:auto;min-height:calc(var(--bottom-nav-height) + env(safe-area-inset-bottom,0px));padding-bottom:env(safe-area-inset-bottom,0px);align-items:stretch;overflow-x:hidden}
nav button{min-height:var(--bottom-nav-height);padding:.32rem .25rem .38rem;line-height:1.05;overflow:hidden}
nav button span{max-width:100%;font-size:.64rem;overflow:hidden;text-overflow:ellipsis}
main{padding-bottom:calc(var(--bottom-nav-height) + env(safe-area-inset-bottom,0px) + 1.5rem)}
.section-heading,.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:.65rem;margin-bottom:.7rem}
.section-heading h1,.panel-heading h2{margin:0}
.editor-form[hidden]{display:none!important}.editor-form{padding:.75rem;border:1px solid var(--border);border-radius:6px;background:#101010}
.structure-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.structure-panel{min-width:0}.structure-panel:last-child{grid-column:auto}
.path-line{font-size:.75rem;color:var(--muted);word-break:break-word}.owner-line{font-size:.72rem;color:var(--muted)}
@media(max-width:700px){
  :root{--bottom-nav-height:70px}
  main{padding:.8rem .8rem calc(var(--bottom-nav-height) + env(safe-area-inset-bottom,0px) + 1.25rem)}
  nav button{min-width:0;padding:.3rem .12rem .38rem;gap:.18rem}
  nav button img{width:24px;height:24px}
  nav button span{font-size:.58rem;letter-spacing:-.01em}
  .section-heading,.panel-heading{align-items:center}
}
@media(max-width:380px){nav button span{font-size:.54rem}nav button img{width:22px;height:22px}}


/* 4.4.4: Inventararchiv und eindeutiges einspaltiges Struktur-Layout auf Mobilgeräten */
.subsection-heading{display:flex;align-items:center;justify-content:space-between;gap:.65rem;margin:1rem 0 .65rem}
.subsection-heading h2{margin:0}.count-badge{display:inline-grid;place-items:center;min-width:1.55rem;height:1.55rem;padding:0 .35rem;border:1px solid var(--border);border-radius:999px;font-size:.68rem;color:var(--muted);font-weight:400}
.archive-list[hidden]{display:none!important}.archived-card{border-style:dashed;opacity:.88}.archived-card .content>strong{color:#bbb}
@media(max-width:700px){
  .structure-grid{display:grid;grid-template-columns:minmax(0,1fr)!important;width:100%}
  .structure-panel,.structure-panel:last-child{grid-column:1!important;width:100%;min-width:0;max-width:100%}
}


/* 4.4.5: Haushalt↔Adresse-Mehrfachzuordnung */
#addressHouseholds[multiple]{min-height:7.25rem}
#addressHouseholdsHint{display:block;margin-top:.3rem}
