*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%;overflow:hidden;background:#fff;color:#111;font-family:-apple-system,BlinkMacSystemFont,'SF Pro Text','Helvetica Neue',sans-serif;font-size:15px;-webkit-font-smoothing:antialiased}
:root{--nav-h:64px;--header-h:52px}

.screen{position:fixed;inset:0;display:none;flex-direction:column}
.screen.active{display:flex}

/* ── Login ── */
#screen-login{align-items:center;justify-content:center;background:#f7f7f7;padding:20px}
.login-wrap{width:100%;max-width:360px;display:flex;flex-direction:column;align-items:center;gap:8px}
.login-logo{margin-bottom:12px}
.login-wrap h1{font-size:30px;font-weight:700;letter-spacing:-.5px}
.login-sub{font-size:12px;color:#aaa;margin-bottom:20px;text-transform:uppercase;letter-spacing:1.5px}
.auth-card{width:100%;background:#fff;border-radius:18px;padding:22px;border:0.5px solid #e8e8e8;display:flex;flex-direction:column;gap:16px;box-shadow:0 2px 16px rgba(0,0,0,.06)}
.invite-banner{background:#f5f5f5;border-radius:8px;padding:10px 12px;font-size:13px;color:#555;border-left:3px solid #111}
.ios-hint{width:100%;background:#fff;border-radius:14px;padding:16px;border:0.5px solid #e8e8e8;margin-top:8px;display:flex;flex-direction:column;gap:8px}
.ios-hint strong{font-size:14px;font-weight:600}
.ios-hint p{font-size:13px;color:#666;line-height:1.5}
.ios-hint b{font-weight:600;color:#111}
.err-msg{font-size:13px;color:#c0392b;min-height:18px;text-align:center;margin-top:4px}

/* ── Fields ── */
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.6px;color:#aaa}
.field input,.field select,.field textarea{background:#f7f7f7;border:0.5px solid #e8e8e8;border-radius:11px;padding:12px 14px;font-size:15px;color:#111;outline:none;width:100%;transition:border-color .15s,background .15s;font-family:inherit;-webkit-appearance:none;appearance:none}
.field input:focus,.field select:focus,.field textarea:focus{border-color:#111;background:#fff}
.field small{font-size:11px;color:#bbb}
.field textarea{resize:none}
.field-row{display:flex;gap:10px}
.field-row .field{flex:1}
.field-row .field.field-sm{flex:0 0 70px}
.hint{font-size:13px;color:#bbb;line-height:1.5}
.toggle-row{display:flex;align-items:center;gap:10px;cursor:pointer;padding:2px 0}
.toggle-row input[type=checkbox]{width:18px;height:18px;accent-color:#111;cursor:pointer;flex-shrink:0}
.toggle-label{font-size:14px;color:#111}

/* ── Buttons ── */
.btn-black{background:#111;color:#fff;border:none;padding:14px 20px;border-radius:13px;font-size:15px;font-weight:600;cursor:pointer;width:100%;transition:opacity .15s;font-family:inherit}
.btn-black:active{opacity:.75}
.btn-gray{background:#f0f0f0;color:#555;border:none;padding:12px 18px;border-radius:13px;font-size:14px;font-weight:500;cursor:pointer;font-family:inherit}
.btn-gray:active{background:#e5e5e5}
.btn-red{background:#c0392b;color:#fff;border:none;padding:12px 18px;border-radius:11px;font-size:14px;font-weight:500;cursor:pointer;width:100%;font-family:inherit;margin-top:8px}
.btn-red-sm{background:none;color:#c0392b;border:0.5px solid #c0392b;padding:8px 14px;border-radius:9px;font-size:13px;cursor:pointer;font-family:inherit;font-weight:500}
.btn-ghost{background:none;border:0.5px solid #ddd;color:#555;padding:9px 18px;border-radius:9px;font-size:13px;cursor:pointer;font-family:inherit}
.btn-sm{padding:9px 16px;font-size:13px;border-radius:10px}

/* ── Header ── */
.app-header{position:fixed;top:0;left:0;right:0;height:var(--header-h);background:rgba(255,255,255,.94);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-bottom:0.5px solid #ebebeb;display:flex;align-items:center;padding:0 10px;gap:8px;z-index:400}
.hdr-icon-btn{background:none;border:none;color:#111;padding:8px;cursor:pointer;display:flex;align-items:center;border-radius:9px;flex-shrink:0}
.hdr-icon-btn:active{background:#f0f0f0}
.revier-select{flex:1;background:#f5f5f5;border:0.5px solid #e8e8e8;border-radius:10px;padding:7px 10px;font-size:13px;font-weight:500;color:#111;outline:none;-webkit-appearance:none;min-width:0;cursor:pointer}
.wind-chip{display:flex;align-items:center;gap:4px;background:#f5f5f5;border:0.5px solid #e8e8e8;border-radius:10px;padding:5px 10px;font-size:11px;color:#555;white-space:nowrap;flex-shrink:0}
.wind-arr{font-size:12px;display:inline-block;transition:transform .6s}
.checkin-pill{display:flex;align-items:center;gap:5px;background:#111;color:#fff;border:none;border-radius:20px;padding:7px 12px;font-size:12px;font-weight:600;cursor:pointer;white-space:nowrap;flex-shrink:0;font-family:inherit}
.checkin-pill.active{background:#2d6a2d}

/* ── Map ──
   Wichtig: bottom muss nav-h + safe-area berücksichtigen */
#map{
  position:fixed;
  top:var(--header-h);
  left:0;right:0;
  bottom:calc(var(--nav-h) + env(safe-area-inset-bottom));
  z-index:1;
}
.leaflet-container{background:#2a3a1a}
.leaflet-control-zoom{border-radius:12px!important;overflow:hidden;margin-right:8px!important;margin-bottom:8px!important}
.leaflet-control-zoom a{background:#fff!important;color:#111!important;border-color:#e8e8e8!important;font-size:18px!important;width:36px!important;height:36px!important;line-height:36px!important}
.leaflet-bar{border-color:#e8e8e8!important;box-shadow:0 2px 12px rgba(0,0,0,.1)!important}
.leaflet-popup-content-wrapper{background:#fff;border:0.5px solid #e8e8e8;border-radius:14px;box-shadow:0 4px 24px rgba(0,0,0,.12);color:#111}
.leaflet-popup-tip{background:#fff}
.leaflet-popup-content{margin:14px 16px;font-size:13px;line-height:1.6}
.leaflet-draw.leaflet-control{display:none!important}
.leaflet-bottom.leaflet-right{bottom:8px}

/* ── Filter Pills — unten links auf Karte, NICHT als Banner ── */
.filter-bar{
  position:fixed;
  /* Über der Nav-Bar, mit safe-area */
  bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  left:0;right:0;
  z-index:300;
  padding:0 12px;
  display:flex;gap:6px;
  overflow-x:auto;scrollbar-width:none;
  pointer-events:none;
  justify-content:flex-start;
}
.filter-bar::-webkit-scrollbar{display:none}
.filter-btn{
  background:rgba(255,255,255,.95);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  border:0.5px solid rgba(0,0,0,.1);
  border-radius:20px;padding:7px 14px;
  font-size:12px;font-weight:500;color:#555;
  cursor:pointer;white-space:nowrap;font-family:inherit;flex-shrink:0;
  box-shadow:0 2px 8px rgba(0,0,0,.1);
  pointer-events:auto;transition:all .15s;
}
.filter-btn.active{background:#111;color:#fff;border-color:#111}

/* ── Draw Toolbar ── */
.draw-toolbar{
  position:fixed;top:calc(var(--header-h) + 8px);
  left:50%;transform:translateX(-50%);
  display:flex;align-items:center;gap:6px;flex-wrap:nowrap;
  background:rgba(255,255,255,.97);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
  border:0.5px solid #e8e8e8;border-radius:16px;
  padding:10px 14px;z-index:450;
  box-shadow:0 4px 24px rgba(0,0,0,.12);
  white-space:nowrap;max-width:calc(100vw - 24px);
}
.draw-info-text{font-size:12px;color:#666;margin-right:2px}
.draw-action-btn{display:flex;align-items:center;gap:5px;background:#f5f5f5;border:none;border-radius:10px;padding:8px 12px;font-size:12px;font-weight:500;cursor:pointer;font-family:inherit;color:#333;transition:background .15s;white-space:nowrap}
.draw-action-btn:active{background:#e8e8e8}
.draw-action-cancel{background:#fff0f0;color:#c0392b}
.draw-action-done{background:#111;color:#fff}
.draw-action-done:active{opacity:.8}

/* ── Bottom Nav ──
   Kritisch: padding-bottom = safe-area-inset-bottom */
.bottom-nav{
  position:fixed;bottom:0;left:0;right:0;
  height:calc(var(--nav-h) + env(safe-area-inset-bottom));
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
  border-top:0.5px solid #ebebeb;
  display:flex;align-items:flex-start;
  padding-top:8px;
  padding-bottom:env(safe-area-inset-bottom);
  z-index:400;
}
.nav-item{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;background:none;border:none;color:#c0c0c0;cursor:pointer;padding:2px 4px 0;font-size:10px;font-weight:400;position:relative;font-family:inherit;transition:color .15s}
.nav-item.active{color:#111;font-weight:600}
.nav-dot{position:absolute;top:-6px;left:50%;transform:translateX(-50%);width:4px;height:4px;border-radius:50%;background:#111;opacity:0;transition:opacity .15s}
.nav-item.active .nav-dot{opacity:1}
.nav-fab-wrap{flex:1;display:flex;justify-content:center;align-items:flex-start}
.nav-fab{width:54px;height:54px;background:#111;border-radius:50%;border:4px solid #fff;display:flex;align-items:center;justify-content:center;cursor:pointer;margin-top:-20px;box-shadow:0 4px 20px rgba(0,0,0,.22);transition:transform .15s}
.nav-fab:active{transform:scale(.93)}

/* ── Quick Menu (+ Button) ── */
.quick-menu{
  position:fixed;
  bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  left:50%;transform:translateX(-50%);
  background:#fff;border:0.5px solid #e8e8e8;border-radius:18px;
  padding:10px;display:flex;gap:8px;
  z-index:600;box-shadow:0 8px 40px rgba(0,0,0,.18);
}
.qm-btn{display:flex;flex-direction:column;align-items:center;gap:6px;padding:16px 22px;background:#f7f7f7;border:none;border-radius:14px;cursor:pointer;font-size:13px;font-weight:600;font-family:inherit;color:#111;transition:background .15s}
.qm-btn:active{background:#ebebeb}
.qm-icon{width:28px;height:28px}

/* ── Sidebar ── */
.sidebar{position:fixed;top:0;left:-100%;width:280px;height:100%;background:#fff;border-right:0.5px solid #ebebeb;z-index:700;transition:left .26s cubic-bezier(.4,0,.2,1);display:flex;flex-direction:column}
.sidebar.open{left:0}
/* Overlay: dunkelt ab bei Sidebar UND Sheets */
.overlay{position:fixed;inset:0;background:rgba(0,0,0,.28);z-index:699;display:none;opacity:0;transition:opacity .25s}
.overlay.show{display:block;opacity:1}
.sidebar-top{display:flex;align-items:center;justify-content:space-between;padding:16px;padding-top:calc(16px + env(safe-area-inset-top))}
.sidebar-user{display:flex;align-items:center;gap:12px}
.avatar{width:42px;height:42px;border-radius:50%;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;font-size:17px;font-weight:700;flex-shrink:0}
.sb-name{font-size:15px;font-weight:600;color:#111}
.sb-role{font-size:11px;color:#bbb;text-transform:uppercase;letter-spacing:.5px;margin-top:1px}
.sb-close{background:none;border:none;color:#bbb;cursor:pointer;padding:6px;border-radius:8px;display:flex}
.sb-nav{flex:1;padding:8px;display:flex;flex-direction:column;gap:2px;overflow-y:auto}
.sb-item{display:flex;align-items:center;gap:13px;padding:13px 14px;border:none;background:none;color:#444;border-radius:11px;cursor:pointer;font-size:14px;font-family:inherit;text-align:left;width:100%;transition:background .12s}
.sb-item:active{background:#f5f5f5}
.sb-danger{color:#c0392b}
.sb-divider{height:0.5px;background:#f2f2f2;margin:6px 8px}

/* ── Sheets — mit Overlay-Abdunkelung ── */
.sheet{position:fixed;bottom:0;left:0;right:0;background:#fff;border-radius:22px 22px 0 0;z-index:700;transform:translateY(100%);transition:transform .3s cubic-bezier(.4,0,.2,1);display:flex;flex-direction:column;max-height:88vh;box-shadow:0 -4px 40px rgba(0,0,0,.1)}
.sheet.open{transform:translateY(0)}
.sheet-tall{max-height:95vh}
.sheet-handle{width:38px;height:4px;background:#e0e0e0;border-radius:2px;margin:12px auto 0;flex-shrink:0}
.sheet-head{display:flex;align-items:center;justify-content:space-between;padding:14px 20px 10px;flex-shrink:0}
.sheet-head h2{font-size:18px;font-weight:700;color:#111;letter-spacing:-.3px}
.sheet-x{background:none;border:none;color:#c0c0c0;cursor:pointer;font-size:18px;padding:2px 4px}
.sheet-subhead{padding:0 20px 12px;display:flex;align-items:center;gap:12px;border-bottom:0.5px solid #f2f2f2;flex-shrink:0}
.sheet-body{flex:1;overflow-y:auto;padding:16px 20px 24px;display:flex;flex-direction:column;gap:14px}
.sheet-scroll{overflow-y:auto}
.sheet-foot{display:flex;gap:8px;padding:12px 20px;padding-bottom:calc(12px + env(safe-area-inset-bottom));border-top:0.5px solid #f2f2f2;flex-shrink:0}
.sheet-foot .btn-black{flex:1}

/* ── Typ Grid ── */
.typ-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.typ-btn{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 6px 10px;background:#f7f7f7;border:1px solid #ebebeb;border-radius:14px;cursor:pointer;font-size:11px;font-weight:500;color:#555;font-family:inherit;transition:all .15s}
.typ-btn:active{transform:scale(.96)}
.typ-btn.active{background:#111;color:#fff;border-color:#111}
.typ-icon-wrap{width:28px;height:28px;display:flex;align-items:center;justify-content:center}
.typ-icon-wrap svg{width:24px;height:24px}
.typ-btn.active .typ-icon-wrap svg{stroke:#fff}

/* ── Wildart Grid ── */
.wildart-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.wl-btn{display:flex;flex-direction:column;align-items:center;gap:5px;padding:10px 4px 8px;background:#f7f7f7;border:1px solid #ebebeb;border-radius:12px;cursor:pointer;font-size:11px;font-weight:500;color:#555;font-family:inherit;transition:all .15s}
.wl-btn:active{transform:scale(.95)}
.wl-btn.active{background:#111;color:#fff;border-color:#111}
.wl-icon{width:26px;height:26px}
.wl-btn.active .wl-icon{stroke:#fff}

/* ── Wetter ── */
.wetter-row{display:grid;grid-template-columns:repeat(6,1fr);gap:6px}
.wetter-btn{display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px 4px;background:#f7f7f7;border:1px solid #ebebeb;border-radius:11px;cursor:pointer;font-family:inherit;transition:all .15s}
.wetter-btn svg{width:20px;height:20px}
.wetter-btn small{font-size:9px;color:#888}
.wetter-btn.active{background:#111;border-color:#111}
.wetter-btn.active svg{stroke:#fff}
.wetter-btn.active small{color:#fff}

/* ── Layer ── */
.layer-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.layer-btn{display:flex;flex-direction:column;align-items:center;gap:8px;background:none;border:1px solid #ebebeb;border-radius:14px;padding:14px 8px;cursor:pointer;font-size:12px;font-weight:500;color:#666;font-family:inherit;transition:all .15s}
.layer-btn.active{border-color:#111;border-width:2px;color:#111}
.layer-thumb{width:62px;height:42px;border-radius:9px}
.lyr-osm{background:linear-gradient(135deg,#e8f0e0,#d0dcc8)}
.lyr-sat{background:linear-gradient(135deg,#2a4a1a,#1a3010)}
.lyr-topo{background:linear-gradient(135deg,#d0e8f0,#b0c8e0)}

/* ── Detail Popup ── */
.detail-popup{position:fixed;bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px);left:12px;right:12px;background:#fff;border:0.5px solid #ebebeb;border-radius:18px;z-index:450;box-shadow:0 8px 40px rgba(0,0,0,.12);padding:14px 16px}
.dp-close{position:absolute;top:12px;right:14px;background:none;border:none;color:#bbb;font-size:16px;cursor:pointer;padding:4px}
.dp-head{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.dp-icon-wrap{width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.dp-icon-wrap svg{width:22px;height:22px;stroke:#fff}
.dp-title{font-size:16px;font-weight:600;color:#111}
.dp-sub{font-size:12px;color:#aaa;text-transform:uppercase;letter-spacing:.4px;margin-top:1px}
.dp-fotos{display:flex;gap:6px;overflow-x:auto;margin-bottom:8px;scrollbar-width:none}
.dp-fotos::-webkit-scrollbar{display:none}
.dp-foto-img{width:82px;height:62px;object-fit:cover;border-radius:10px;flex-shrink:0;cursor:pointer}
.dp-notiz{font-size:13px;color:#666;font-style:italic;margin-bottom:4px}
.dp-meta{font-size:11px;color:#c0c0c0;margin-bottom:12px}
.dp-foot{display:flex;gap:6px;align-items:center}

/* ── Check-in ── */
.checkin-aktiv-box{background:#f5faf5;border:1px solid #c8e6c8;border-radius:14px;padding:16px;text-align:center}
.ca-label{font-size:13px;color:#666;margin-bottom:6px}
.ca-ort{font-size:18px;font-weight:700;color:#111;margin-bottom:10px}

/* ── Draußen ── */
.draussen-item{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:0.5px solid #f5f5f5}
.draussen-item:last-child{border-bottom:none}
.d-avatar{width:40px;height:40px;border-radius:50%;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:15px;flex-shrink:0}
.d-name{font-size:14px;font-weight:600;color:#111}
.d-ort{font-size:12px;color:#999;margin-top:1px}
.d-time{font-size:11px;color:#ccc;margin-left:auto;white-space:nowrap}

/* ── Tagebuch ── */
.tb-entry{background:#f9f9f9;border:0.5px solid #ebebeb;border-radius:13px;padding:12px 14px;margin-bottom:8px}
.tb-entry.abschuss{border-left:3px solid #c0392b;padding-left:11px}
.tb-header{display:flex;align-items:center;gap:8px;margin-bottom:6px;flex-wrap:wrap}
.tb-wildart{font-weight:600;font-size:14px;color:#111}
.tb-anzahl{background:#ebebeb;border-radius:20px;padding:2px 9px;font-size:12px;color:#666}
.tb-badge{background:#c0392b;color:#fff;border-radius:20px;padding:2px 9px;font-size:11px;font-weight:600}
.tb-meta{font-size:11px;color:#bbb;display:flex;flex-wrap:wrap;gap:8px}
.tb-notiz{font-size:12px;color:#777;margin-top:5px;font-style:italic}
.empty-hint{text-align:center;color:#c0c0c0;font-size:14px;padding:28px 0;font-style:italic}
