/* Schussbild - App-Styles
   Ton: dunkel, ruhig, seriös. Ein Akzent (Gold) nur für Resultate und Primäraktionen. */
:root {
  --bg: #121417;
  --panel: rgba(24, 27, 32, 0.78);
  --tile: #262a31;
  --tile-hi: #2d323a;
  --field: rgba(10, 12, 15, 0.72);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eceef1;
  --dim: #9aa1ab;
  --faint: #6b727c;
  --accent: #d9a520;
  --accent-ink: #1c1500;
  --danger: #e5484d;
  --ok: #3fb950;
  --radius: 14px;
  --radius-s: 9px;
  --f: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--f); font-size: 16px; line-height: 1.5;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
/* Hintergrundbild fix, mit starker Abdunklung damit Inhalte lesbar bleiben */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(14,16,19,.66) 0%, rgba(14,16,19,.82) 55%, rgba(14,16,19,.94) 100%),
    url("../img/background.jpg") center 30% / cover no-repeat;
}
@media (min-width: 900px) {
  body::before {
    background:
      linear-gradient(90deg, rgba(14,16,19,.96) 0%, rgba(14,16,19,.86) 45%, rgba(14,16,19,.72) 100%),
      url("../img/background.jpg") right 20% / auto 140% no-repeat, var(--bg);
  }
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; margin: 1.6rem 0 0.7rem; }
p { margin: 0 0 0.8em; }
.dim { color: var(--dim); }
.hint { color: var(--dim); font-size: 0.86rem; }
.error { color: var(--danger); font-size: 0.86rem; min-height: 1.2em; margin: 0.8rem 0 0; }
.ok { color: var(--ok); font-size: 0.86rem; margin: 0.8rem 0 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem max(1rem, calc((100% - 1080px) / 2));
  padding-top: calc(0.7rem + env(safe-area-inset-top, 0px));
  background: rgba(16, 18, 22, 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.app-header .title { flex: 1; font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { flex: 1; display: flex; align-items: center; gap: 0.55rem; font-weight: 800; font-size: 1.12rem; letter-spacing: -0.02em; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  background: transparent; border: 1px solid transparent; border-radius: 10px; color: var(--dim);
  cursor: pointer; text-decoration: none; padding: 0;
}
.icon-btn:hover { background: rgba(255,255,255,.06); color: var(--text); }
.icon-btn svg { width: 22px; height: 22px; }

/* Sprachwahl */
.lang-switch { position: relative; }
.lang-current { display: inline-flex; align-items: center; gap: 0.4rem; height: 40px; padding: 0 0.6rem; border-radius: 10px;
  background: transparent; border: 1px solid var(--line); color: var(--dim); font: 600 0.78rem var(--f); cursor: pointer; }
.lang-current:hover { color: var(--text); border-color: var(--line-strong); }
.flag { width: 22px; height: 15px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.15); flex: none; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 170px; padding: 0.35rem;
  background: #1c1f25; border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.5); display: none; z-index: 60; }
.lang-switch.open .lang-menu { display: block; }
.lang-menu button { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.55rem 0.6rem; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font: 500 0.9rem var(--f); cursor: pointer; text-align: left; }
.lang-menu button:hover, .lang-menu button.active { background: rgba(255,255,255,.07); }
.lang-inline { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.lang-inline button { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--field); color: var(--text); font: 500 0.9rem var(--f); cursor: pointer; }
.lang-inline button.active { border-color: var(--accent); }

/* ---------- Layout ---------- */
.page { width: min(100% - 2rem, 1080px); margin: 0 auto; padding: 1.5rem 0 0; }
.page-narrow { width: min(100% - 2rem, 820px); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 1.25rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); margin-bottom: 1.1rem; }
@media (min-width: 700px) { .panel { padding: 1.6rem 1.8rem; } }
.panel > h2 { margin-bottom: 0.9rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.8rem 1.2rem;
  border-radius: 11px; border: 1px solid transparent; font: 600 0.95rem var(--f); cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-ghost { background: transparent; color: var(--dim); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.04); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(229,72,77,.35); }
.btn-block { width: 100%; }
.btn-row { display: grid; gap: 0.6rem; margin-top: 1.4rem; }
@media (min-width: 640px) { .btn-row { grid-template-columns: 2fr 1fr; } .btn-row.three { grid-template-columns: 2fr 1fr 1fr; } }

/* ---------- Formulare ---------- */
label, .field-label { display: block; font-size: 0.82rem; color: var(--dim); margin: 0 0 0.3rem; }
input, select, textarea {
  width: 100%; padding: 0.7rem 0.8rem; border-radius: var(--radius-s); border: 1px solid var(--line-strong);
  background: var(--field); color: var(--text); font: 400 1rem var(--f);
}
input[type="date"], input[type="time"] { color-scheme: dark; min-height: 46px; }
select { appearance: none; -webkit-appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa1ab' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center; }
.form-grid { display: grid; gap: 0.9rem 1rem; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span2 { grid-column: 1 / -1; } }
.field { min-width: 0; }

.tag-suggestions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.tag-chip { padding: 0.28rem 0.7rem; background: var(--field); border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 0.8rem; color: var(--dim); cursor: pointer; }
.tag-chip:hover { color: var(--text); }

/* ---------- Dashboard ---------- */
.hello { display: flex; align-items: center; gap: 1rem; margin: 0.6rem 0 1.6rem; }
.hello p { margin: 0.35rem 0 0; color: var(--dim); }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-lg { width: 96px; height: 96px; }
.empty-cta { display: inline-block; margin-top: 0.6rem; color: var(--accent); font-weight: 600; text-decoration: none; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
@media (min-width: 820px) { .tiles { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; } }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem;
  min-height: 118px; padding: 1rem 0.6rem; border-radius: var(--radius); cursor: pointer; text-decoration: none;
  background: linear-gradient(180deg, var(--tile-hi), var(--tile)); color: #d9dde2;
  border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 10px 22px -12px rgba(0,0,0,.7);
  font: 600 1rem var(--f); text-align: center; transition: transform .15s, border-color .15s;
}
@media (min-width: 820px) { .tile { min-height: 168px; font-size: 1.08rem; } }
.tile:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.tile:active { transform: translateY(1px); }
.tile svg { width: 40px; height: 40px; color: #c9ced5; }
.tile.soon { opacity: 0.55; }

/* ---------- Resultat-Blöcke (Editor + Protokoll) ---------- */
.blocks { display: grid; gap: 0.9rem; }
.block { border: 1px solid var(--line-strong); border-radius: 12px; padding: 0.8rem 0.9rem; background: rgba(0,0,0,.18); }
.block-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.block-head select { flex: 1; font-weight: 600; }
.block-head .sum { color: var(--dim); font-size: 0.82rem; white-space: nowrap; }
.block-head .icon-btn { width: 36px; height: 36px; }
.block h4 { font-size: 0.95rem; margin: 0 0 0.3rem; }

/* Feste Spaltenbreiten: # / Ring / Punkte / Aktionen stehen in allen Blöcken exakt untereinander */
.shot-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.shot-table col.c-nr { width: 2.2rem; }
.shot-table col.c-act { width: 5.2rem; }
.shot-table th { text-align: left; font-weight: 500; font-size: 0.78rem; color: var(--dim); padding: 0.3rem 0.4rem; }
.shot-table td { padding: 0.2rem 0.4rem; }
.shot-table td.nr { color: var(--dim); }
.shot-table input { padding: 0.45rem 0.55rem; font-size: 0.95rem; }
.shot-table .acts { display: flex; justify-content: flex-end; gap: 0.1rem; }
.shot-table .acts .icon-btn { width: 34px; height: 34px; }
.shot-table .acts .icon-btn svg { width: 18px; height: 18px; }
.shot-table .split-btn:hover { color: var(--accent); }
.shot-table .invisible { visibility: hidden; }
.add-shot { margin-top: 0.5rem; width: 100%; padding: 0.55rem; font-size: 0.88rem; }
.add-block { margin-top: 0.9rem; }

/* ---------- Icon-Auswahl (Wetter/Wind/Gefühl) ---------- */
.pick-group { margin-bottom: 1rem; }
.pick-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 0.5rem; }
.pick {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.7rem 0.3rem;
  border-radius: 11px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--tile-hi), var(--tile));
  color: var(--dim); font: 500 0.74rem var(--f); cursor: pointer; text-align: center; line-height: 1.2;
}
.pick svg { width: 26px; height: 26px; }
.pick .emo { font-size: 1.5rem; line-height: 26px; filter: grayscale(.35); }
.pick.active { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 1px var(--accent) inset; }
.pick.active .emo { filter: none; }
.pick-show { display: inline-flex; align-items: center; gap: 0.35rem; margin-right: 1rem; color: var(--dim); font-size: 0.85rem; }
.pick-show svg { width: 18px; height: 18px; }

/* ---------- Bilder ---------- */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.6rem; }
.img-grid .thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); cursor: zoom-in; background: #0c0e11; }
.img-grid .thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-grid .thumb .rm { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.7); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; }
.img-grid .thumb .rm svg { width: 15px; height: 15px; }
.img-add { aspect-ratio: 1; border-radius: 10px; border: 1.5px dashed var(--line-strong); display: grid; place-items: center;
  color: var(--dim); cursor: pointer; text-align: center; font-size: 0.75rem; padding: 0.4rem; }
.img-add svg { width: 26px; height: 26px; margin: 0 auto 0.3rem; }
.upload-box { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; border: 1.5px dashed var(--line-strong);
  border-radius: 14px; padding: 2.2rem 1rem; cursor: pointer; margin: 1rem 0; color: var(--dim); text-align: center; }
.upload-box svg { width: 38px; height: 38px; }

.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.94); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 96vw; max-height: 90vh; border-radius: 6px; }
.lightbox .icon-btn { position: absolute; color: #fff; background: rgba(255,255,255,.08); width: 46px; height: 46px; }
.lightbox .lb-close { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }
.lightbox .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ---------- Protokoll ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; text-align: center; }
.stats .value { font-size: 1.55rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.stats .label { font-size: 0.76rem; color: var(--dim); }
.list { display: grid; gap: 0.7rem; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0.95rem 1.1rem; cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.item:hover { border-color: var(--line-strong); }
.item-head { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; }
.item-head .date { font-weight: 700; display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem; }
.item-head .avg { color: var(--accent); font-weight: 800; font-size: 1.12rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item .sub { color: var(--dim); font-size: 0.86rem; margin-top: 0.15rem; }
.badge { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 0.3rem; border-radius: 5px;
  border: 1px solid var(--line-strong); font-size: 0.7rem; color: var(--dim); font-weight: 600; }
.img-flag { display: inline-grid; place-items: center; color: var(--accent); }
.img-flag svg { width: 17px; height: 17px; }
.share-flag { color: var(--dim); }
.item-head .ring-sum { color: var(--text); }
.detail { display: none; margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line); cursor: default; }
.item.open .detail { display: block; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 1rem; }
.detail .blocks { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.detail .meta { margin: 1rem 0 0.4rem; }
.detail h4.sec { font-size: 0.82rem; color: var(--dim); font-weight: 600; margin: 1rem 0 0.5rem; }

/* ---------- Einstellungen ---------- */
.settings-grid { display: grid; gap: 1.1rem; }
@media (min-width: 960px) { .settings-grid { grid-template-columns: 1fr 1fr; align-items: start; } .settings-grid .panel { margin: 0; } }
.profile-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.avatar-pick { width: 96px; height: 96px; border-radius: 50%; border: 1.5px dashed var(--line-strong); display: grid; place-items: center;
  color: var(--dim); cursor: pointer; overflow: hidden; flex: none; }
.avatar-pick img { width: 100%; height: 100%; object-fit: cover; }
.avatar-pick svg { width: 30px; height: 30px; }
.logo-pick { width: 110px; height: 110px; border: 1.5px dashed var(--line-strong); border-radius: 50%; display: grid; place-items: center;
  cursor: pointer; color: var(--dim); padding: 0.6rem; text-align: center; font-size: 0.8rem; overflow: hidden; }
.logo-pick img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.logo-pick:has(img:not([hidden])) { border-style: solid; padding: 0; }
.gun { border: 1px solid var(--line-strong); border-radius: 12px; padding: 0.9rem; margin-bottom: 0.8rem; background: rgba(0,0,0,.18); }
.gun-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; }
.gun-head .count { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.radio { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.86rem; color: var(--dim); cursor: pointer; margin: 0; }
.radio input { width: 18px; height: 18px; accent-color: var(--accent); }
.kv { display: flex; justify-content: space-between; padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.kv:last-child { border: 0; }
.kv span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Login ---------- */
.auth-wrap { flex: 1; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: min(100%, 400px); }
.auth-card .brand { justify-content: center; font-size: 1.6rem; margin-bottom: 0.4rem; }
.auth-card .brand-mark { width: 38px; height: 38px; }
.auth-card .sub { text-align: center; color: var(--dim); margin-bottom: 1.6rem; }
.auth-card .field { margin-bottom: 0.9rem; }
.auth-top { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }

/* ---------- Footer ---------- */
.app-footer { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; padding: 0.4rem 1rem 2rem; color: var(--faint); font-size: 0.75rem; }
.app-footer:empty { display: none; }
/* Vereinslogo rund wie das Profilbild; contain + weisser Grund, damit das Logo nie abgeschnitten wird */
.app-footer .club-logo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.app-footer .ver { display: flex; align-items: center; gap: 0.7rem; }
.ver-btn { padding: 0.3rem 0.7rem; font: 600 0.75rem var(--f); background: transparent; color: var(--accent); border: 1px solid var(--line-strong); border-radius: 7px; cursor: pointer; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: #22262d; border: 1px solid var(--line-strong); color: var(--text); padding: 0.7rem 1.1rem; border-radius: 11px;
  font-size: 0.9rem; z-index: 2000; box-shadow: 0 14px 30px rgba(0,0,0,.5); max-width: calc(100% - 2rem); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
[hidden]{display:none !important}
.scan-chip { display: inline-flex; align-items: center; gap: .4rem; margin-top: .55rem; padding: .25rem .7rem; border-radius: 99px;
  border: 1px solid var(--line-strong); color: var(--dim); font-size: .8rem; font-weight: 600; text-decoration: none; }
.scan-chip:hover { color: var(--text); }
/* ---------- Produkt & Scans ---------- */
.prod-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.prod-stats { display: flex; gap: 1.6rem; text-align: center; }
.prod-stats .v { font-size: 1.6rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.prod-stats .k { font-size: .75rem; color: var(--dim); }
.buy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: 1.3rem 0 .6rem; }
.buy { display: grid; gap: .15rem; text-align: left; padding: 1rem 1.1rem; border-radius: 13px; cursor: pointer; color: var(--text);
  background: linear-gradient(180deg, var(--tile-hi), var(--tile)); border: 1px solid var(--line-strong); font: 500 .9rem var(--f); }
.buy b { font-size: 1.05rem; }
.buy span { font-size: 1.35rem; font-weight: 800; color: var(--accent); }
.buy small { color: var(--dim); }
.buy-hi { border-color: var(--accent); }
.buy:disabled { opacity: .6; cursor: progress; }
.prod-cols { display: grid; gap: 1.2rem; }
@media (min-width: 800px) { .prod-cols { grid-template-columns: 1fr 1fr; gap: 2rem; } }
.ref-row { display: flex; gap: .5rem; }
.ref-row input { font-size: .85rem; }
.ref-row .btn { flex: none; }
.credit { display: flex; justify-content: space-between; gap: .8rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.credit:last-child { border: 0; }
.credit b { color: var(--ok); font-variant-numeric: tabular-nums; }
.lock { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--accent); margin: .5rem 0 .8rem; }
.lock svg { width: 15px; height: 15px; flex: none; }
.locked { opacity: .45; pointer-events: none; }
@media (max-width: 520px) { .buy-grid { grid-template-columns: 1fr; } }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .85rem; color: var(--dim); margin: .2rem 0 1rem; cursor: pointer; }
.check input { width: 18px; height: 18px; flex: none; margin-top: .1rem; accent-color: var(--accent); }
.check a, .legal-links a { color: var(--accent); }
.legal-links { display: flex; justify-content: center; gap: 1rem; margin: .4rem 0 0; font-size: .8rem; }
.legal-links a { color: var(--faint); text-decoration: none; }
.legal-links a:hover { color: var(--dim); }
/* ---------- Dialog ---------- */
.modal { position: fixed; inset: 0; z-index: 900; background: rgba(0,0,0,.7); display: grid; place-items: center; padding: 1rem; }
.modal-card { width: min(100%, 520px); max-height: 92vh; overflow: auto; margin: 0; background: #1a1d23; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.rep-cats { display: grid; gap: .45rem; margin: .8rem 0 1rem; }
.link-btn { background: none; border: 0; color: var(--dim); font: 500 .85rem var(--f); text-decoration: underline; cursor: pointer; padding: .4rem 0; }
.link-btn:hover { color: var(--text); }
.toolbar { display: flex; justify-content: flex-end; gap: .6rem; margin: -.4rem 0 1rem; }
.toolbar .btn { padding: .55rem .9rem; font-size: .88rem; }
/* ---------- Analyse ---------- */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
#kpis { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 520px) { #kpis { grid-template-columns: repeat(2, 1fr); row-gap: 1rem; } }
.ana-grid { display: grid; gap: 1.1rem; }
@media (min-width: 900px) { .ana-grid { grid-template-columns: 1fr 1fr; } .ana-card.wide { grid-column: 1 / -1; } }
.ana-card { position: relative; margin: 0; overflow: hidden; }
.ana-card h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.ana-card .ins { color: var(--text); font-size: .92rem; min-height: 2.6em; margin: 0 0 .8rem; }
.ana-card .ins b { color: var(--accent); }
.ana-card .chart { position: relative; height: 230px; }
.ana-card.wide .chart { height: 270px; }
.ana-card .few { color: var(--dim); font-size: .9rem; display: grid; place-items: center; height: 100%; }
.ana-card.is-locked .body { filter: blur(7px); opacity: .55; pointer-events: none; user-select: none; }
.lock-over { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .7rem; text-align: center; padding: 1rem;
  background: linear-gradient(180deg, rgba(20,22,26,.2), rgba(20,22,26,.55)); }
.lock-over svg { width: 30px; height: 30px; color: var(--accent); }
.lock-over p { margin: 0; font-weight: 600; }
.lock-over .btn { padding: .6rem 1.1rem; font-size: .9rem; }
.danger-zone { border-color: rgba(229,72,77,.35); }
/* ---------- Admin ---------- */
.btn-mini { padding: .45rem .8rem; font-size: .82rem; }
.admin .panel h2 { font-size: 1.05rem; margin-bottom: .8rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; margin-bottom: 1.1rem; }
@media (min-width: 700px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .kpi-grid { grid-template-columns: repeat(5, 1fr); } }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; }
.kpi .v { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi .v.pos { color: var(--ok); } .kpi .v.neg { color: var(--danger); } .kpi .v.acc { color: var(--accent); }
.kpi .k { font-size: .76rem; color: var(--dim); }
.kpi .s { font-size: .74rem; color: var(--faint); margin-top: .15rem; }
.adm-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.adm-head h2 { margin: 0 !important; }
.adm-head input { max-width: 260px; padding: .5rem .7rem; font-size: .88rem; }
.adm-chart { position: relative; height: 300px; }
.adm-chart.small { height: 230px; }
.adm-2 { display: grid; gap: 1.1rem; margin-bottom: 1.1rem; }
.adm-2 .panel { margin: 0; }
@media (min-width: 900px) { .adm-2 { grid-template-columns: 1fr 1fr; } }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; color: var(--dim); font-weight: 500; padding: .5rem .6rem; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.tbl td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl .tag { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .72rem; font-weight: 700; border: 1px solid var(--line-strong); }
.tbl .tag.pro { border-color: var(--accent); color: var(--accent); }
.tbl .tag.basic { border-color: var(--ok); color: var(--ok); }
.adm-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.adm-links a { padding: .5rem .9rem; border: 1px solid var(--line-strong); border-radius: 99px; text-decoration: none; font-size: .86rem; }
.adm-links a:hover { border-color: var(--accent); }
.rep-item { border-bottom: 1px solid var(--line); padding: .7rem 0; font-size: .88rem; }
.rep-item:last-child { border: 0; }
.rep-item a { color: var(--accent); margin-right: .6rem; }
.app-footer .made { font-size: .72rem; color: var(--faint); letter-spacing: .02em; }
/* ---------- Dashboard KPIs ---------- */
.hello h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: -.6rem 0 1.1rem; }
.kpi-card { display: flex; flex-direction: column; gap: .1rem; min-width: 0; padding: .7rem .8rem; border-radius: 13px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.kpi-card .k { font-size: .7rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-card .v { font-size: 1.25rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-card .s { font-size: .7rem; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-card.warn { border-color: rgba(229,72,77,.5); }
.kpi-card.warn .v { color: var(--danger); }
@media (min-width: 700px) { .kpi-card { padding: .9rem 1.1rem; } .kpi-card .v { font-size: 1.6rem; } .kpi-card .k, .kpi-card .s { font-size: .8rem; } }
.desk-only { display: none !important; }
@media (min-width: 820px) {
  .desk-only { display: flex !important; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
/* ---------- Waffenpflege ---------- */
.care-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.care-head h2 { margin: 0 0 .15rem !important; }
.care-badge { font-size: .75rem; font-weight: 700; padding: .25rem .7rem; border-radius: 99px; border: 1px solid; white-space: nowrap; }
.care-badge.due { color: var(--danger); border-color: rgba(229,72,77,.5); }
.care-badge.ok { color: var(--ok); border-color: rgba(63,185,80,.5); }
.care-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: .5rem; margin-bottom: 1rem; }
.care-stats .v { font-size: 1.7rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.care-stats .k { font-size: .75rem; color: var(--dim); }
.care-more { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.care-more summary { cursor: pointer; color: var(--dim); font-size: .9rem; font-weight: 600; }
.care-more summary:hover { color: var(--text); }
/* ---------- Einstellungen: Gruppen ---------- */
.settings .group { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; margin-bottom: .7rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); scroll-margin-top: 80px; }
.settings .group[open] { border-color: var(--line-strong); }
.settings summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .8rem; padding: 1rem 1.2rem; }
.settings summary::-webkit-details-marker { display: none; }
.settings summary svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.settings summary .g-title { font-weight: 700; flex: 1; }
.settings summary .g-meta { color: var(--dim); font-size: .82rem; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.settings summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--dim); border-bottom: 2px solid var(--dim); transform: rotate(45deg); transition: transform .2s; margin-left: .2rem; }
.settings .group[open] summary::after { transform: rotate(-135deg); }
.settings .g-body { padding: 0 1.2rem 1.3rem; }
.settings .g-body > .save-all { margin-top: 1.2rem; }
.settings #konto summary svg { color: var(--danger); }
.filters .span2 { grid-column: 1 / -1; }
.view-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--dim); font: 600 .85rem var(--f); padding: .5rem .9rem; cursor: pointer; }
.seg button.active { background: var(--accent); color: var(--accent-ink); }
.ana-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.ana-acts { display: flex; gap: .1rem; margin: -.4rem -.5rem 0 0; position: relative; z-index: 3; }
.ana-acts .icon-btn { width: 36px; height: 36px; }
.ana-acts .icon-btn svg { width: 19px; height: 19px; }
.ana-acts .icon-btn.on { color: var(--accent); }
.ana-acts .icon-btn.on svg { fill: currentColor; }
.ana-card.is-hidden { opacity: .55; }

/* ---------- Erfassen: Auswahl ---------- */
.choice { display: flex; align-items: center; gap: 1.1rem; padding: 1.3rem 1.2rem; margin-bottom: .9rem; border-radius: 16px; text-decoration: none;
  background: linear-gradient(180deg, var(--tile-hi), var(--tile)); border: 1px solid var(--line); box-shadow: 0 10px 22px -12px rgba(0,0,0,.7); }
.choice:hover { border-color: var(--line-strong); }
.choice > svg { width: 42px; height: 42px; color: #c9ced5; flex: none; }
.choice h2 { font-size: 1.15rem; margin: 0 0 .2rem; }
.choice p { margin: 0; color: var(--dim); font-size: .9rem; }
.choice .scan-chip { margin-top: .5rem; }
.choice.soon { opacity: .55; }
/* ---------- Schiessbuch Suche ---------- */
.search { margin-bottom: 1rem; }
.search .q { position: relative; }
.search .q svg { position: absolute; z-index: 2; left: 1.05rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--dim); pointer-events: none; }
.search .q input { height: 52px; padding: 0 1.2rem 0 3rem; border-radius: 99px; font-size: 1rem;
  background: var(--panel); border: 1px solid var(--line-strong); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  -webkit-appearance: none; appearance: none; }
.search .q input:focus { outline: none; border-color: var(--accent); }
.search .q input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search .count { font-size: .8rem; color: var(--dim); margin: .5rem 0 0 1.2rem; }
.care-hist { border-top: 1px solid var(--line); padding-top: .9rem; margin-top: .8rem !important; }
/* ---------- Freunde ---------- */
.seg-wide { display: flex; width: 100%; margin-bottom: 1rem; }
.seg-wide button { flex: 1; padding: .7rem; font-size: .92rem; }
.feed { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; margin-bottom: .8rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.feed-head { display: flex; align-items: center; gap: .7rem; }
.feed-head .who { flex: 1; min-width: 0; }
.feed-head .who b { display: block; }
.feed-head .who span { font-size: .8rem; color: var(--dim); }
.feed-head .avg { color: var(--accent); font-weight: 800; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.mini-av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--tile-hi);
  display: grid; place-items: center; font-weight: 800; color: var(--accent); }
.feed .sub { margin: .6rem 0 0; font-size: .88rem; color: var(--dim); }
.feed-img { margin-top: .7rem; width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; cursor: zoom-in; }
.feed-foot { display: flex; align-items: center; gap: .7rem; margin-top: .7rem; }
.like { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .9rem; border-radius: 99px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--dim); font: 700 .9rem var(--f); cursor: pointer; }
.like.on { border-color: var(--accent); color: var(--accent); background: rgba(217,165,32,.1); }
.likers { font-size: .78rem; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-row { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.friend-row:last-child { border: 0; }
.friend-row .who { flex: 1; min-width: 0; }
.friend-row .who small { display: block; color: var(--dim); }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); cursor: pointer; margin: 0; color: var(--text); font-size: .95rem; }
.switch-row:last-child { border: 0; }
.switch-row small { display: block; color: var(--dim); font-size: .8rem; margin-top: .15rem; }
.switch { -webkit-appearance: none; appearance: none; width: 48px; height: 28px; flex: none; border-radius: 99px; background: var(--tile-hi);
  border: 1px solid var(--line-strong); position: relative; cursor: pointer; transition: background .2s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--dim); transition: transform .2s, background .2s; }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(20px); background: var(--accent-ink); }
.tile-wide { grid-column: 1 / -1; min-height: 72px !important; flex-direction: row !important; gap: .8rem !important; }
.tile-wide svg { width: 30px !important; height: 30px !important; }
.like-chip { font-size: .8rem; color: var(--accent); font-weight: 700; white-space: nowrap; }
@media (min-width: 820px) { .tiles .tile-wide { order: 10; } }
/* ---------- Feed kompakt ---------- */
.feed { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem .85rem; margin-bottom: .55rem; cursor: pointer; border-radius: 14px; }
.feed:hover { border-color: var(--line-strong); }
.feed-av { background: none; border: 0; padding: 0; cursor: pointer; flex: none; }
.feed .mini-av { width: 36px; height: 36px; font-size: .9rem; }
.feed-main { flex: 1; min-width: 0; }
.feed-top { display: flex; align-items: baseline; gap: .5rem; }
.feed-name { background: none; border: 0; padding: 0; color: var(--text); font: 700 .95rem var(--f); cursor: pointer; }
.feed-name:hover { color: var(--accent); }
.feed-date { font-size: .78rem; color: var(--dim); }
.feed-sub { font-size: .86rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .05rem; }
.feed-meta { display: flex; align-items: center; gap: .35rem; margin-top: .35rem; font-size: .76rem; color: var(--dim); min-width: 0; }
.feed-meta .badge { min-width: 1.15rem; height: 1.15rem; font-size: .62rem; }
.feed-meta .like { padding: .15rem .55rem; font-size: .78rem; margin-left: .2rem; }
.feed-meta .likers { font-size: .72rem; }
.feed-right { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; flex: none; }
.feed-right .avg { color: var(--accent); font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.feed-filter { display: flex; gap: .5rem; align-items: center; margin-bottom: .8rem; flex-wrap: wrap; }
.feed-filter .seg button { padding: .45rem .75rem; font-size: .8rem; }
.feed-filter select { flex: 1; min-width: 140px; padding: .5rem .8rem; font-size: .88rem; height: auto; }
.friend-row { cursor: pointer; }
.friend-row:hover .who b { color: var(--accent); }
/* ---------- Person ---------- */
.person-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.person-head .mini-av, .person-head .big-av { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: grid; place-items: center;
  background: var(--tile-hi); color: var(--accent); font-weight: 800; font-size: 1.6rem; flex: none; }
.person-head h1 { font-size: 1.6rem; }
.person-head p { margin: .2rem 0 0; color: var(--dim); }

/* ---------- Update 17: Startseite Gewehre, Einstellungen, Erfassung ---------- */
.kpi-row.two { grid-template-columns: repeat(2, 1fr); }
.gun-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin: -.4rem 0 1.1rem; }
.gun-card { display: flex; flex-direction: column; gap: .15rem; min-width: 0; padding: .75rem .85rem; border-radius: 13px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--text); }
.gun-card .gc-name { font-weight: 700; font-size: .9rem; overflow-wrap: anywhere; line-height: 1.25; }
.gun-card .gc-v { font-size: 1.4rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: .2rem; }
.gun-card .gc-k { font-size: .72rem; color: var(--dim); line-height: 1.3; }
.gun-card .gc-s { font-size: .72rem; color: var(--faint); line-height: 1.3; }
.gun-card.warn { border-color: rgba(229,72,77,.5); }
.gun-card.warn .gc-v { color: var(--danger); }
.gun-card.empty { grid-column: 1 / -1; }
@media (min-width: 700px) { .gun-card { padding: .9rem 1.1rem; } .gun-card .gc-v { font-size: 1.6rem; } .gun-card .gc-k, .gun-card .gc-s { font-size: .8rem; } }
.settings .g-body h3 { margin: 1.3rem 0 .3rem; font-size: 1rem; }
.settings .g-body h3:first-child { margin-top: .2rem; }
.danger-zone { margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.danger-zone h3 { color: var(--danger); margin-top: 0 !important; }
.app-info { display: flex; flex-direction: column; align-items: center; gap: .8rem; padding: 1.2rem .5rem .4rem; text-align: center; }
.app-info #verify-box { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.app-info #verify-box[hidden] { display: none; }
.app-info .adm-links { justify-content: center; }
.app-info .app-footer { padding: 0; }
.temp-field { margin: .9rem 0 .4rem; }
.temp-row { display: flex; align-items: center; gap: .8rem; }
.temp-row input { max-width: 110px; }
.temp-hint { margin: 0 !important; font-size: .8rem; }
/* Nur ein Gewehr: volle Breite, aber flach (Name und Datum links, Zahl rechts) */
.gun-card.single { display: grid; grid-template-columns: 1fr auto; column-gap: 1rem; row-gap: .1rem; align-items: center; padding: .6rem .9rem; }
.gun-card.single .gc-name { grid-column: 1; grid-row: 1; }
.gun-card.single span:nth-of-type(4) { grid-column: 1; grid-row: 2; }
.gun-card.single span:nth-of-type(5) { grid-column: 1; grid-row: 3; }
.gun-card.single .gc-v { grid-column: 2; grid-row: 1 / 3; margin: 0; text-align: right; }
.gun-card.single .gc-k { grid-column: 2; grid-row: 3; text-align: right; }
@media (min-width: 700px) { .gun-card.single { padding: .7rem 1.1rem; } }

/* ---------- Benachrichtigungen ---------- */
.bell { position: relative; }
.bell-n { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  background: var(--danger); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.bell-n[hidden] { display: none; }
.nt-list { display: grid; gap: .5rem; }
.nt-item { display: flex; gap: .8rem; align-items: flex-start; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.nt-item.neu { border-color: var(--accent); }
.nt-item .nt-txt { flex: 1; min-width: 0; }
.nt-item b { display: block; }
.nt-item p { margin: .15rem 0 0; color: var(--dim); font-size: .88rem; }
.nt-item small { color: var(--dim); font-size: .75rem; }
.nt-item .icon-btn { width: 32px; height: 32px; flex: none; }
.nt-item .icon-btn svg { width: 16px; height: 16px; }
.nt-table { width: 100%; border-collapse: collapse; margin: .4rem 0 1rem; }
.nt-table th { font-size: .75rem; color: var(--dim); font-weight: 600; text-align: center; padding: .3rem; }
.nt-table th:first-child, .nt-table td:first-child { text-align: left; }
.nt-table td { padding: .45rem .3rem; border-top: 1px solid var(--line); text-align: center; font-size: .9rem; }
.nt-table tr.grp td { color: var(--dim); font-size: .78rem; font-weight: 700; border-top: none; padding-top: .9rem; }
.nt-table input { width: 18px; height: 18px; accent-color: var(--accent); }
.push-box { border: 1px solid var(--line); border-radius: 12px; padding: .9rem; margin-bottom: 1rem; }
.push-box .btn-row { margin-top: .6rem; }
.adm-del { margin-left: auto; }
.adm-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
