/* TauschGarage App-Ansicht – wird nur aktiv, wenn <html class="tgapp-active"> gesetzt ist (JS entscheidet: Handy / installiert) */
:root{--tgapp-bg:#121212;--tgapp-accent:#d2a659;--tgapp-surface:#1b1b1b;--tgapp-line:#2e2e2e;--tgapp-ink:#f3efe6;--tgapp-muted:#a49e92;--tgapp-top:56px;--tgapp-tabs:64px;--tgapp-font:'Manrope','Segoe UI',system-ui,-apple-system,sans-serif}
.tgapp{font-family:var(--tgapp-font);color:var(--tgapp-ink)}
.tgapp[hidden]{display:none}
html.tgapp-active{background:var(--tgapp-bg)}
html.tgapp-active body{padding-top:calc(var(--tgapp-top) + env(safe-area-inset-top)) !important;padding-bottom:calc(var(--tgapp-tabs) + env(safe-area-inset-bottom)) !important;background:var(--tgapp-bg)}
html.tgapp-active.tgapp-no-top body{padding-top:env(safe-area-inset-top) !important}
html.tgapp-active.tgapp-no-tabs body{padding-bottom:env(safe-area-inset-bottom) !important}
html.tgapp-active body::-webkit-scrollbar{display:none}
html.tgapp-active{scrollbar-width:none}
/* Tap-Verhalten wie in Apps */
html.tgapp-active *{-webkit-tap-highlight-color:transparent}
html.tgapp-active a,html.tgapp-active button{touch-action:manipulation}
html.tgapp-active img{-webkit-user-drag:none}
html.tgapp-active{overscroll-behavior-y:none}

/* WordPress-Adminleiste: sie ist ausgeblendet, ihr reservierter Rand muss auch weg */
html.tgapp-active{margin-top:0 !important}
html.tgapp-active body{margin-top:0 !important}

/* Badge des Push-Plugins (.tg-push-link-badge) hängt sich an jeden /nachrichten-Link.
   In der App-Leiste und in den Tabs zeigen wir stattdessen unseren eigenen Badge,
   damit es nicht doppelt erscheint – die Zahl übernimmt app.js. */
.tgapp-top .tg-push-link-badge,.tgapp-tabs .tg-push-link-badge{display:none !important}

/* App-Leiste oben */
.tgapp-top{position:fixed;left:0;right:0;top:0;z-index:99990;display:flex;align-items:center;gap:6px;height:calc(var(--tgapp-top) + env(safe-area-inset-top));padding:env(safe-area-inset-top) 8px 0 8px;background:rgba(18,18,18,.94);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid var(--tgapp-line);transform:translateY(0);transition:transform .25s ease}
html.tgapp-hide-top .tgapp-top{transform:translateY(-100%)}
.tgapp-iconbtn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:12px;border:0;background:transparent;color:var(--tgapp-ink);cursor:pointer;flex-shrink:0;padding:0}
.tgapp-iconbtn svg{width:24px;height:24px}
.tgapp-iconbtn:active{background:rgba(255,255,255,.08)}
.tgapp-back{display:none}
html.tgapp-can-back .tgapp-back{display:inline-flex}
.tgapp-top__logo{display:flex;align-items:center;flex-grow:1;min-width:0;padding-left:4px}
.tgapp-top__logo img{height:30px;width:auto;display:block}
.tgapp-top__title{display:none;flex-grow:1;min-width:0;font-family:'Barlow Semi Condensed','Arial Narrow','Segoe UI',sans-serif;font-weight:700;font-size:19px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 4px}
html.tgapp-show-title .tgapp-top__title{display:block}
html.tgapp-show-title .tgapp-top__logo{display:none}
.tgapp-top__actions{display:flex;align-items:center;gap:2px}
.tgapp-badge{position:absolute;top:5px;right:5px;min-width:17px;height:17px;padding:0 5px;border-radius:9px;background:var(--tgapp-accent);color:#1a1408;font-size:10px;font-weight:800;display:inline-flex;align-items:center;justify-content:center;line-height:1}
.tgapp-badge[hidden]{display:none}

/* Tabs unten */
.tgapp-tabs{position:fixed;left:0;right:0;bottom:0;z-index:99990;display:flex;align-items:flex-end;padding:6px 4px calc(6px + env(safe-area-inset-bottom));background:rgba(22,22,22,.96);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-top:1px solid var(--tgapp-line);transition:transform .25s ease}
html.tgapp-hide-tabs .tgapp-tabs{transform:translateY(110%)}
.tgapp-tab{flex:1 1 0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:3px;min-height:52px;color:var(--tgapp-muted);text-decoration:none !important;font-size:11px;font-weight:600;line-height:1;padding-bottom:2px}
.tgapp-tab__icon{position:relative;display:flex;align-items:center;justify-content:center;width:44px;height:30px;border-radius:15px;transition:background .15s}
.tgapp-tab__icon .tgapp-badge{top:-2px;right:4px}
.tgapp-tab--cta .tgapp-tab__icon .tgapp-badge{top:2px;right:2px}
.tgapp-tab__icon svg{width:23px;height:23px}
.tgapp-tab.is-active{color:var(--tgapp-accent)}
.tgapp-tab.is-active .tgapp-tab__icon{background:rgba(210,166,89,.14)}
.tgapp-tab--cta .tgapp-tab__icon{width:54px;height:54px;border-radius:27px;background:linear-gradient(180deg,#e0b86a,#b88c3c);color:#1a1408;margin-top:-26px;box-shadow:0 6px 18px rgba(210,166,89,.35)}
.tgapp-tab--cta .tgapp-tab__icon svg{width:26px;height:26px;stroke-width:2.2}
.tgapp-tab--cta.is-active{color:var(--tgapp-accent)}
.tgapp-tab:active .tgapp-tab__icon{transform:scale(.94)}

/* Menü-Blatt */
.tgapp-sheet{position:fixed;inset:0;z-index:99995}
.tgapp-sheet[hidden]{display:none}
.tgapp-sheet__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.6);animation:tgappFade .2s ease}
.tgapp-sheet__panel{position:absolute;left:0;right:0;bottom:0;max-height:88vh;overflow-y:auto;background:#171717;border-radius:22px 22px 0 0;border-top:1px solid var(--tgapp-line);padding:8px 18px calc(18px + env(safe-area-inset-bottom));animation:tgappUp .25s cubic-bezier(.2,.8,.2,1);display:flex;flex-direction:column;gap:12px}
.tgapp-sheet__grip{width:40px;height:4px;border-radius:2px;background:#3a3a3a;margin:4px auto 2px}
.tgapp-sheet__head{display:flex;align-items:center;justify-content:space-between}
.tgapp-sheet__head img{height:30px;width:auto}
.tgapp-sheet__list{display:flex;flex-direction:column}
.tgapp-sheet__list a{display:flex;align-items:center;min-height:52px;padding:0 4px;font-size:17px;font-weight:600;color:var(--tgapp-ink);text-decoration:none;border-bottom:1px solid var(--tgapp-line)}
.tgapp-sheet__auth{display:flex;flex-direction:column;gap:10px;padding-top:6px}
.tgapp-sheet__foot{display:flex;flex-wrap:wrap;gap:6px 16px;padding-top:6px}
.tgapp-sheet__foot a{font-size:13px;color:var(--tgapp-muted);text-decoration:none}
.tgapp-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 20px;border-radius:12px;border:1.5px solid #3a3a3a;background:transparent;color:var(--tgapp-ink);font-weight:700;font-size:15px;text-decoration:none !important;cursor:pointer;font-family:var(--tgapp-font)}
.tgapp-btn--primary{background:linear-gradient(180deg,#e0b86a,#b88c3c);color:#1a1408 !important;border-color:transparent;box-shadow:0 6px 18px rgba(210,166,89,.25)}
.tgapp-btn--sm{min-height:40px;padding:0 14px;font-size:14px}
@keyframes tgappFade{from{opacity:0}to{opacity:1}}
@keyframes tgappUp{from{transform:translateY(40px);opacity:0}to{transform:none;opacity:1}}
html.tgapp-sheet-open{overflow:hidden}

/* Installations-Hinweis */
.tgapp-install{position:fixed;left:10px;right:10px;bottom:calc(var(--tgapp-tabs) + 10px + env(safe-area-inset-bottom));z-index:99992;display:flex;align-items:center;gap:12px;padding:12px;border-radius:16px;background:#1f1f1f;border:1px solid var(--tgapp-line);box-shadow:0 18px 50px rgba(0,0,0,.5);animation:tgappUp .3s ease}
.tgapp-install[hidden]{display:none}
.tgapp-install img{width:44px;height:44px;border-radius:12px;flex-shrink:0}
.tgapp-install__text{display:flex;flex-direction:column;gap:2px;flex-grow:1;min-width:0}
.tgapp-install__text strong{font-size:14px}
.tgapp-install__text span{font-size:12px;color:var(--tgapp-muted);line-height:1.4}
html.tgapp-no-tabs .tgapp-install{bottom:calc(10px + env(safe-area-inset-bottom))}

/* Pull-to-refresh */
.tgapp-ptr{position:fixed;left:0;right:0;top:calc(var(--tgapp-top) + env(safe-area-inset-top));z-index:99989;display:flex;justify-content:center;pointer-events:none;height:0;overflow:visible}
.tgapp-ptr span{width:30px;height:30px;border-radius:15px;border:3px solid rgba(210,166,89,.3);border-top-color:var(--tgapp-accent);opacity:0;transform:translateY(-40px);transition:transform .2s,opacity .2s;margin-top:8px}
.tgapp-ptr.is-pull span{opacity:1}
.tgapp-ptr.is-loading span{animation:tgappSpin .8s linear infinite;opacity:1;transform:translateY(0)}
@keyframes tgappSpin{to{transform:rotate(360deg)}}

/* Ladebalken bei Seitenwechsel */
.tgapp-progress{position:fixed;left:0;top:calc(var(--tgapp-top) + env(safe-area-inset-top));height:2px;width:0;background:var(--tgapp-accent);z-index:99991;opacity:0;transition:width .4s ease,opacity .3s}
.tgapp-progress.is-on{opacity:1;width:70%}
.tgapp-progress.is-done{width:100%;opacity:0}
html.tgapp-no-top .tgapp-progress,html.tgapp-no-top .tgapp-ptr{top:env(safe-area-inset-top)}

/* Seitenwechsel */
html.tgapp-active.tgapp-transitions body{animation:tgappPage .22s ease}
html.tgapp-active.tgapp-leaving body{opacity:.5;transition:opacity .15s}
@keyframes tgappPage{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* Inhalt: Karten am Handy etwas kompakter, Bilder abgerundet */
html.tgapp-active .tg-archive-card,html.tgapp-active .tgpm-card,html.tgapp-active .tg-card{border-radius:16px}
html.tgapp-active .tg-home-search-wrap{margin-top:12px !important}
