:root{
  --creme:#FBF9F5; --sand:#E9E2D3; --papier:#EFE6D8;
  --gruen:#2F6B4F; --oliv:#3B6D11; --linie:#EDE7DA;
  --grau:#777; --hellgrau:#9AA08E; --rot:#A33A2B;
  --safe-top:env(safe-area-inset-top,0px);
  --safe-bottom:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0;height:100%;overscroll-behavior-y:none}
body{
  background:var(--creme);color:#333;
  font-family:-apple-system,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;
  font-size:15px;line-height:1.45;
}
.hidden{display:none !important}
button{font-family:inherit}

/* ---------- Anmeldung ---------- */
.auth{min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px 18px;background:var(--papier)}
.auth-card{width:100%;max-width:400px;background:var(--creme);border-radius:18px;padding:28px 22px 24px;box-shadow:0 8px 28px rgba(0,0,0,.10)}
.auth-logo{text-align:center;margin-bottom:6px}
.auth-card h1{font-size:26px;margin:0;text-align:center;color:var(--gruen);font-weight:600}
.auth-sub{text-align:center;color:var(--grau);font-size:13px;margin:4px 0 20px}
.tabswitch{display:flex;background:#F1ECE1;border-radius:10px;padding:3px;margin-bottom:18px}
.tabswitch button{flex:1;border:0;background:none;padding:9px;border-radius:8px;font-size:13px;color:var(--grau);cursor:pointer}
.tabswitch button.on{background:#fff;color:var(--gruen);font-weight:600;box-shadow:0 1px 3px rgba(0,0,0,.07)}
.authform label{display:block;font-size:12px;color:var(--grau);margin:14px 0 5px}
.hintlbl{color:#b3ac9d;font-weight:400}
.legal{font-size:11px;color:#a49d8f;line-height:1.5;margin-top:14px}
.formerror{color:var(--rot);font-size:12.5px;margin-top:12px;min-height:0}

/* ---------- Formularfelder ---------- */
input,textarea,select{
  width:100%;padding:12px;border:1px solid var(--linie);border-radius:10px;
  font-size:16px;font-family:inherit;background:#fff;color:#333;
}
input:focus,textarea:focus{outline:2px solid var(--oliv);outline-offset:-1px;border-color:transparent}
textarea{min-height:84px;resize:vertical;line-height:1.5}
label{display:block;font-size:12px;color:var(--grau);margin:16px 0 5px}

/* ---------- App-Gerüst ---------- */
.app{height:100%;display:flex;flex-direction:column;max-width:520px;margin:0 auto;background:var(--creme)}
.topbar{
  background:var(--gruen);color:var(--creme);flex:0 0 auto;display:flex;align-items:center;gap:8px;
  padding:calc(14px + var(--safe-top)) 16px 14px;
}
.topbar h1{font-size:18px;font-weight:600;margin:0;flex:1}
.back{background:none;border:0;color:var(--creme);font-size:26px;line-height:1;cursor:pointer;padding:0 6px 3px 0}
.styleswitch{background:rgba(255,255,255,.16);border:0;color:var(--creme);font-size:11.5px;padding:6px 11px;border-radius:12px;cursor:pointer}

.content{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;position:relative}
.screen{display:none;padding:14px 16px 24px}
.screen.active{display:block}
.plant-mode .screen{padding-left:80px}

/* ---------- Chips ---------- */
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:10px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chips.wrap{flex-wrap:wrap;overflow:visible}
.chip{
  flex:0 0 auto;border:1px solid #CFC6B4;background:#F1ECE1;color:#555;
  font-size:13px;padding:7px 15px;border-radius:15px;cursor:pointer;white-space:nowrap;
}
.chip.on{background:var(--oliv);border-color:var(--oliv);color:var(--creme);font-weight:500}

.searchbox{margin-bottom:10px}
.meta{font-size:12px;color:#9c958a;margin:2px 0 12px}

/* ---------- Karten ---------- */
.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.plant-mode .grid{grid-template-columns:1fr}
.card{background:#fff;border:1px solid var(--linie);border-radius:12px;overflow:hidden;cursor:pointer}
.card:active{transform:scale(.985)}
.card .thumb{background:var(--sand);height:118px;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}
.card .thumb img{width:100%;height:100%;object-fit:cover}
.badge{position:absolute;top:8px;left:8px;background:rgba(255,255,255,.93);font-size:10.5px;color:var(--gruen);padding:3px 8px;border-radius:10px;font-weight:500}
.card .body{padding:9px 11px 11px}
.card .title{font-size:13.5px;font-weight:600;color:#333;line-height:1.3}
.card .sub{font-size:11.5px;color:var(--grau);margin-top:3px}
.card .time{font-size:11px;color:#b3ada2;margin-top:2px}

/* ---------- Detail ---------- */
.detail-img{background:var(--sand);border-radius:14px;height:220px;display:flex;align-items:center;justify-content:center;margin-bottom:16px;overflow:hidden}
.detail-img img{width:100%;height:100%;object-fit:cover}
#screen-detail h2{font-size:20px;margin:0 0 4px;color:#333}
.price{font-size:17px;color:var(--oliv);font-weight:600;margin-bottom:12px}
.kv{display:flex;justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--linie);font-size:13.5px}
.kv span:first-child{color:var(--grau)}
.desc{font-size:14px;line-height:1.6;color:#444;margin:16px 0;white-space:pre-wrap}

/* ---------- Buttons ---------- */
.btn{display:block;width:100%;padding:14px;border:0;border-radius:11px;background:var(--oliv);color:var(--creme);font-size:15px;font-weight:600;cursor:pointer;margin-top:12px}
.btn:active{opacity:.85}
.btn:disabled{opacity:.5}
.btn.ghost{background:none;border:1.5px solid var(--gruen);color:var(--gruen)}
.btn.danger{background:none;border:1.5px solid var(--rot);color:var(--rot)}

/* ---------- Foto-Auswahl ---------- */
.photo-drop{display:block;border:1.5px dashed #CFC6B4;border-radius:11px;padding:24px;text-align:center;color:var(--grau);font-size:13px;background:#FCFAF6;cursor:pointer;margin:0}
.thumbrow{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.thumbrow img{width:66px;height:66px;object-fit:cover;border-radius:9px;border:1px solid var(--linie)}

/* ---------- Listen ---------- */
.row{display:flex;gap:12px;align-items:center;padding:13px 0;border-bottom:1px solid var(--linie);cursor:pointer}
.row .av{width:48px;height:48px;border-radius:24px;background:var(--sand);flex:0 0 auto;display:flex;align-items:center;justify-content:center;overflow:hidden}
.row .av img{width:100%;height:100%;object-fit:cover}
.row .txt{flex:1;min-width:0}
.row .n{font-size:13.5px;font-weight:600;color:#333}
.row .p{font-size:12.5px;color:var(--grau);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .t{font-size:11px;color:#b3ada2;flex:0 0 auto;align-self:flex-start;padding-top:3px}
.dot{width:9px;height:9px;border-radius:5px;background:var(--oliv);flex:0 0 auto}
.status{font-size:10.5px;padding:4px 9px;border-radius:9px;background:#E7F0E3;color:var(--oliv);white-space:nowrap}
.status.off{background:#F0EDE6;color:#999}
.empty{text-align:center;color:#a49d8f;font-size:13.5px;padding:44px 20px;line-height:1.6}

/* ---------- Chat ---------- */
.chatscreen{padding:0;height:100%}
.chatscreen.active{display:flex;flex-direction:column}
.chatlog{flex:1;overflow-y:auto;padding:16px}
.plant-mode .chatlog{padding-left:80px}
.bubble{max-width:78%;padding:10px 13px;border-radius:15px;font-size:14px;line-height:1.45;margin-bottom:10px;word-wrap:break-word}
.bubble.them{background:#F0EDE6;color:#333;border-bottom-left-radius:4px}
.bubble.me{background:var(--gruen);color:var(--creme);margin-left:auto;border-bottom-right-radius:4px}
.bubble .ts{display:block;font-size:10px;opacity:.62;margin-top:4px}
.chatbar{display:flex;gap:8px;padding:10px 12px calc(10px + var(--safe-bottom));border-top:1px solid var(--linie);background:#fff}
.chatbar input{flex:1}
.chatbar button{background:var(--oliv);color:#fff;border:0;border-radius:10px;padding:0 18px;cursor:pointer;font-size:17px}

/* ---------- Profil ---------- */
.profile-head{text-align:center;padding:12px 0 20px}
.profile-head .big{width:82px;height:82px;border-radius:41px;background:var(--sand);margin:0 auto 12px;display:flex;align-items:center;justify-content:center;font-size:30px;color:var(--gruen);font-weight:600}
.profile-head .nm{font-size:18px;font-weight:600;color:#333}
.profile-head .sub{font-size:12.5px;color:var(--grau);margin-top:4px}
.stats{display:flex;justify-content:space-around;padding:16px 0;border-top:1px solid var(--linie);border-bottom:1px solid var(--linie);margin-bottom:8px}
.stats div{text-align:center}
.stats .num{font-size:18px;font-weight:600;color:var(--oliv)}
.stats .lbl{font-size:11px;color:var(--grau);margin-top:3px}
.menuitem{padding:15px 2px;border-bottom:1px solid var(--linie);font-size:14px;color:#333;cursor:pointer;display:flex;justify-content:space-between}
.menuitem span:last-child{color:#ccc}
.version{font-size:11px;color:#b8b1a4;text-align:center;margin-top:22px}

/* ---------- Tab-Leiste ---------- */
.tabbar{display:flex;background:#fff;border-top:1px solid var(--linie);flex:0 0 auto;padding-bottom:var(--safe-bottom)}
.plant-mode .tabbar{display:none}
.tabbar .tab{flex:1 1 0;padding:9px 0 10px;background:none;border:0;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:4px;position:relative}
.tabbar .tab svg{width:22px;height:22px;stroke:var(--hellgrau);fill:none;stroke-width:1.8}
.tabbar .tab span{font-size:10px;color:var(--hellgrau)}
.tabbar .tab.on svg{stroke:var(--gruen)}
.tabbar .tab.on span{color:var(--gruen);font-weight:600}
.tabbar .badge{position:absolute;top:6px;right:calc(50% - 18px);min-width:16px;height:16px;border-radius:8px;background:var(--rot);color:#fff;font-size:10px;font-style:normal;display:flex;align-items:center;justify-content:center;padding:0 4px}

/* ---------- Inserieren-Knopf ---------- */
.fab{position:absolute;right:18px;bottom:calc(80px + var(--safe-bottom));width:54px;height:54px;border-radius:27px;background:var(--oliv);color:#fff;border:0;font-size:28px;line-height:1;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.22);z-index:5}
.plant-mode .fab{bottom:calc(22px + var(--safe-bottom))}

/* ---------- Ranken-Navigation ---------- */
.vinenav{display:none;position:absolute;left:0;bottom:0;width:100%;height:100%;z-index:8;pointer-events:none}
.plant-mode .vinenav{display:block}
.vinebg{position:absolute;left:0;bottom:0;width:76px;height:680px;pointer-events:none}
.vinedim{position:absolute;inset:0;opacity:0;pointer-events:none;z-index:0}
.vineopen .vinedim{opacity:1;pointer-events:auto}
.potbtn{position:absolute;left:0;bottom:calc(60px + var(--safe-bottom));width:76px;height:96px;background:none;border:0;cursor:pointer;padding:0;pointer-events:auto;z-index:2}
.navleaf{
  position:absolute;left:34px;background:none;border:0;padding:0;cursor:pointer;z-index:3;
  display:flex;align-items:center;white-space:nowrap;
  opacity:0;transform:translateX(-14px);pointer-events:none;transition:opacity .3s,transform .3s;
}
.vineopen .navleaf{opacity:1;transform:translateX(0);pointer-events:auto}
.navleaf .lf{width:26px;height:20px;flex:0 0 auto}
.navleaf .lf path{fill:var(--oliv)}
.navleaf.on .lf path{stroke:#1F4A0C;stroke-width:2}
.navleaf .lb{font-size:12.5px;color:#444;margin-left:6px;background:rgba(251,249,245,.94);padding:4px 9px;border-radius:10px;box-shadow:0 1px 5px rgba(0,0,0,.09)}
.navleaf.on .lb{color:var(--oliv);font-weight:600}
.stem{stroke-dasharray:640;stroke-dashoffset:640;transition:stroke-dashoffset .9s ease-out}
.vineopen .stem{stroke-dashoffset:0}
.deco{opacity:0;transition:opacity .4s .3s}
.vineopen .deco{opacity:1}

/* ---------- Hinweise ---------- */
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(90px + var(--safe-bottom));background:#333;color:#fff;font-size:13px;padding:11px 18px;border-radius:10px;z-index:50;max-width:88%;text-align:center}
.updatebar{position:fixed;left:0;right:0;bottom:0;background:var(--gruen);color:var(--creme);display:flex;align-items:center;justify-content:center;gap:14px;padding:12px calc(12px + var(--safe-bottom));font-size:13.5px;z-index:60}
.updatebar button{background:var(--creme);color:var(--gruen);border:0;border-radius:8px;padding:7px 14px;font-size:13px;font-weight:600;cursor:pointer}

@media (prefers-reduced-motion:reduce){*{animation:none !important;transition:none !important}}

/* ---------- Lightbox ---------- */
.lightbox{
  position:fixed;inset:0;z-index:90;background:rgba(20,18,14,.92);
  display:flex;align-items:center;justify-content:center;padding:20px;
}
.lightbox img{max-width:100%;max-height:100%;border-radius:8px}

/* ---------- Splashscreen ---------- */
.splash{
  position:fixed;inset:0;z-index:100;max-width:520px;margin:0 auto;
  animation:splashFadeOut .5s ease-in 3.6s forwards;
}
.splash svg{width:100%;height:100%}
.splash .monstera-g{animation:mIn 1.3s ease-out 1.9s both}
.splash .ivy-vine{stroke-dasharray:420;animation:draw 1.8s ease-out 1.4s both}
.splash .ivy-leaf{opacity:0;animation:lIn .5s ease-out forwards}
.splash .ivy-leaf:nth-of-type(1){animation-delay:2.1s}
.splash .ivy-leaf:nth-of-type(2){animation-delay:2.25s}
.splash .ivy-leaf:nth-of-type(3){animation-delay:2.4s}
.splash .ivy-leaf:nth-of-type(4){animation-delay:2.55s}
.splash .ivy-leaf:nth-of-type(5){animation-delay:2.7s}
.splash .soil{opacity:0;animation:soilIn .4s ease-out 1s forwards}
.splash .sprout{opacity:0;transform:scaleY(0);animation:sproutGrow .6s ease-out forwards}
.splash .sprout1{animation-delay:1.2s} .splash .sprout2{animation-delay:1.4s}
.splash .sprout3{animation-delay:1.6s} .splash .sprout4{animation-delay:1.8s}
.splash .sprouts-wrap{animation:fadeOut .4s ease-in 3.1s forwards}
.splash .word{opacity:0;animation:wordIn .5s ease-out 2.6s forwards}
@keyframes mIn{from{opacity:0;transform:translate(300px,95px) rotate(28deg) scale(.6)}to{opacity:1;transform:translate(300px,95px) rotate(28deg) scale(1)}}
@keyframes draw{from{stroke-dashoffset:420}to{stroke-dashoffset:0}}
@keyframes lIn{from{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}
@keyframes soilIn{from{opacity:0}to{opacity:1}}
@keyframes sproutGrow{from{opacity:0;transform:scaleY(0)}to{opacity:1;transform:scaleY(1)}}
@keyframes fadeOut{from{opacity:1}to{opacity:0}}
@keyframes wordIn{from{opacity:0;transform:translateY(8px) scale(.9)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes splashFadeOut{from{opacity:1;pointer-events:auto}to{opacity:0;pointer-events:none;visibility:hidden}}
