:root {
  --bg: #f4f5f2; --card: #ffffff; --text: #1b1f22; --muted: #5f676d; --line: #dfe2dc;
  --accent: #0f5f8a; --accent-ink: #ffffff; --accent-soft: #e2eef5;
  --cg: #e2540f; --ok: #237a45; --ok-soft: #e1f2e7; --danger: #b3261e;
  --radius: 14px; --tabh: 62px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181b; --card: #1f2327; --text: #eceeec; --muted: #9aa3a9; --line: #30363b;
    --accent: #5fb2e0; --accent-ink: #0c1a22; --accent-soft: #1d3342;
    --cg: #ff7a3d; --ok: #6fcf94; --ok-soft: #1c3526; --danger: #ff8a80;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  padding-bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 16px);
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1.h-sm { font-size: 1.15rem; }
h2 { font-size: 1.1rem; margin: 0 0 .7rem; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
h3 { font-size: .95rem; margin: 1.2rem 0 .5rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: .4rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* Header / Navigation */
.top {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  border-bottom: 1px solid var(--line); padding: calc(env(safe-area-inset-top) + 8px) 16px 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: .45rem; font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.05rem; }
.brand svg { color: var(--accent); transform: rotate(45deg); }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); height: calc(var(--tabh) + env(safe-area-inset-bottom));
}
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600;
}
.tabs a svg { width: 24px; height: 24px; }
.tabs a.on { color: var(--accent); }
@media (min-width: 760px) {
  body { padding-bottom: 32px; }
  .tabs { position: static; height: auto; border: 0; background: none; padding: 0; gap: 4px; }
  .tabs a { flex-direction: row; gap: 6px; font-size: .9rem; padding: 6px 12px; border-radius: 99px; }
  .tabs a svg { width: 18px; height: 18px; }
  .tabs a.on { background: var(--accent-soft); }
}

.wrap { max-width: 760px; margin: 0 auto; padding: 14px 16px; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 14px; min-height: 44px; }
.back { text-decoration: none; font-weight: 600; font-size: 1.02rem; padding: 8px 0; }

/* Karten */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
section[id] { scroll-margin-top: 100px; }
.flash { background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }
.flash.err { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.empty { text-align: center; padding: 28px 18px; }
.empty .btn { margin-top: 10px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  white-space: nowrap; flex: none;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: transparent; }
.btn.block { width: 100%; flex: 1 1 auto; }
.btn:active { transform: scale(.98); }
.icon { border: 0; background: none; color: var(--muted); font-size: 1.5rem; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; flex: none; }
.icon:hover { background: var(--bg); color: var(--danger); }
.linkbtn { border: 0; background: none; color: var(--accent); font: inherit; padding: 0; cursor: pointer; text-decoration: underline; }
.btnrow, .actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.actions-row { justify-content: center; margin: 18px 0 6px; }

/* Liste */
.search { width: 100%; margin-bottom: 12px; }
.plane-list { display: flex; flex-direction: column; gap: 10px; }
.plane-item {
  display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; text-decoration: none; color: var(--text);
}
.plane-item img, .plane-item .ph { width: 84px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.plane-item .ph { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.plane-item .ph svg { width: 30px; transform: rotate(45deg); }
.plane-item .ph.batt { font-weight: 800; font-size: 1.3rem; }
.pi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pi-body strong { font-size: 1.08rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { font-size: 1.6rem; color: var(--muted); padding-right: 4px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.chip { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); vertical-align: middle; }
.chip.cg { color: var(--cg); border-color: color-mix(in srgb, var(--cg) 35%, transparent); background: color-mix(in srgb, var(--cg) 9%, transparent); }
.chip.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }

/* Detail */
.hero { margin-bottom: 12px; }
.hero img { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius); display: block; margin-bottom: 12px; cursor: zoom-in; }
.jump {
  position: sticky; top: calc(env(safe-area-inset-top) + 41px); z-index: 10; display: flex; gap: 6px; overflow-x: auto;
  padding: 8px 0; margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px; background: var(--bg); scrollbar-width: none;
}
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: none; padding: 7px 13px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: .88rem; color: var(--text); }
.bigval { font-size: 1.1rem; font-weight: 600; color: var(--cg); }
.bigval span { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.markwrap { position: relative; margin-top: 12px; border-radius: 10px; overflow: hidden; line-height: 0; }
.markwrap img { width: 100%; display: block; cursor: zoom-in; }
.markwrap.editable img { cursor: crosshair; }
.cgmark {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; pointer-events: none;
  background:
    conic-gradient(var(--cg) 0 25%, #fff 0 50%, var(--cg) 0 75%, #fff 0);
  border: 2px solid var(--cg); box-shadow: 0 0 0 3px rgba(255,255,255,.8), 0 2px 8px rgba(0,0,0,.4);
}
.pack { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.pack:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.pack-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pack-head strong { font-size: 1.05rem; }
.ftime { text-align: right; flex: none; }
.ftime span { display: block; font-size: 1.7rem; font-weight: 800; color: var(--accent); line-height: 1; }
.ftime small { color: var(--muted); font-size: .72rem; }
.packimg { width: 100%; border-radius: 10px; margin-top: 10px; cursor: zoom-in; display: block; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0 0; }
.kv dt { color: var(--muted); font-size: .88rem; padding-top: 1px; }
.kv dd { margin: 0; font-weight: 500; }
.slot { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.slot div { background: var(--accent-soft); border-radius: 10px; padding: 8px 14px; }
.slot small { display: block; font-size: .72rem; color: var(--muted); }
.slot b { font-size: 1.25rem; }
.tscroll { overflow-x: auto; margin: 0 -4px; }
table.grid { border-collapse: collapse; width: 100%; font-size: .95rem; }
.grid th, .grid td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.grid thead th { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.grid tbody th { font-weight: 800; white-space: nowrap; }
.grid.sw tbody th { color: var(--accent); font-size: 1.05rem; }
.grid.rates td, .grid.rates thead th { text-align: center; }
.grid.rates td { font-variant-numeric: tabular-nums; font-weight: 600; }
.grid.rates tbody th { text-align: left; font-weight: 700; }
.grid.rates b { font-size: 1.1rem; }
.ex { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; }
.grid.sw td { font-size: .92rem; }
h2 .linkbtn { font-size: .85rem; font-weight: 500; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { border-bottom: 1px solid var(--line); }
.checklist label { display: flex; gap: 12px; align-items: center; padding: 11px 2px; cursor: pointer; }
.checklist input { width: 24px; height: 24px; accent-color: var(--ok); flex: none; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }
.flights { list-style: none; padding: 0; margin: 12px 0 0; }
.flights li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.flights .chip { margin-left: 4px; }
.addflight summary { list-style: none; }
.addflight summary::-webkit-details-marker { display: none; }
.addflight[open] summary { display: none; }
.addflight form { margin-top: 4px; }

/* Formulare */
.form label, .form .field { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; font-weight: 600; color: var(--muted); }
.form .lbl { font-size: .86rem; font-weight: 600; color: var(--muted); }
.form > label, .form > .field { margin-bottom: 12px; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px; font-weight: 400;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type=file] { padding: 8px; background: transparent; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
textarea { resize: vertical; }
label.check { flex-direction: row !important; align-items: center; gap: 10px; color: var(--text); font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .full { grid-column: 1 / -1; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }
.curimg { display: flex; align-items: center; gap: 12px; }
.curimg img { width: 110px; height: 80px; object-fit: cover; border-radius: 8px; }
.dynlist { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.dynrow { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 44px 10px 10px; }
.dynrow > .icon { position: absolute; top: 4px; right: 2px; }
.dynrow input, .dynrow select, .dynrow textarea { background: var(--card); }
.sw-row { display: grid; grid-template-columns: 90px 1fr 1fr 1fr; gap: 6px; }
@media (max-width: 560px) { .sw-row { grid-template-columns: 1fr 1fr; } .sw-row .sw-name { grid-column: 1 / -1; } }
.rt-label { margin-bottom: 8px; }
.rt-grid { display: grid; grid-template-columns: auto 1fr 1fr; gap: 6px 8px; align-items: center; }
.rt-grid span { font-size: .82rem; font-weight: 700; color: var(--muted); }
.savebar { position: sticky; bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 8px); z-index: 5; padding: 6px 0; }
@media (min-width: 760px) { .savebar { bottom: 12px; } }
.savebar .btn { box-shadow: 0 6px 20px rgba(0,0,0,.18); min-height: 50px; font-size: 1.05rem; }
.danger-zone { margin: 26px 0 10px; text-align: center; }

/* Login */
.auth { max-width: 400px; margin: 8vh auto 0; text-align: center; }
.auth h1 { margin-bottom: 18px; }
.auth .form { text-align: left; }
.auth-logo { color: var(--accent); margin-bottom: 6px; }
.auth-logo svg { transform: rotate(45deg); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; align-items: center; justify-content: center; }
.lb-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 56px) 0 calc(env(safe-area-inset-bottom) + 64px); }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-stage video { width: 100%; background: #000; }
.lightbox button.lb-close, .lightbox button.lb-prev, .lightbox button.lb-next {
  position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16);
  color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; z-index: 2; }
.lb-close { top: calc(env(safe-area-inset-top) + 10px); right: 12px; }
.lb-prev, .lb-next { top: 50%; margin-top: -24px; }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
.lb-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px calc(env(safe-area-inset-bottom) + 10px); background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; }
.lb-actions { display: flex; gap: 8px; margin-left: auto; }
.lb-actions .btn { min-height: 38px; padding: 0 12px; font-size: .88rem; background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.25); }
.lb-actions .btn.danger { color: #ff9b93; }

/* Galerie */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 12px; border-radius: 10px; overflow: hidden; }
@media (min-width: 560px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gitem { position: relative; aspect-ratio: 1; border: 0; padding: 0; background: var(--bg); cursor: pointer; overflow: hidden; }
.gitem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gitem .vph { position: absolute; inset: 0; background: linear-gradient(135deg, #2a3a46, #13212b); }
.gitem .play { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%;
  background: rgba(0,0,0,.55); box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.gitem .play::after { content: ''; position: absolute; left: 16px; top: 12px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #fff; }
.uploader { display: flex; flex-direction: column; gap: 10px; }
.uploader > .btn { align-self: flex-start; cursor: pointer; }
.upqueue:empty { display: none; }
.upqueue { display: flex; flex-direction: column; gap: 8px; }
.uprow { background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.upname { font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upbar { height: 6px; border-radius: 3px; background: var(--line); margin: 6px 0 4px; overflow: hidden; }
.upbar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.uprow.ok .upbar span { background: var(--ok); }
.uprow.err .upbar span { background: var(--danger); }
.uprow.err .upinfo { color: var(--danger); }

/* Mehrbenutzer */
.hangar-switch { display: flex; gap: 6px; overflow-x: auto; margin: -4px 0 12px; padding-bottom: 2px; scrollbar-width: none; }
.hangar-switch::-webkit-scrollbar { display: none; }
.hangar-switch a { flex: none; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; }
.hangar-switch a small { color: var(--muted); font-weight: 500; margin-left: 2px; }
.hangar-switch a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hangar-switch a.on small { color: inherit; opacity: .8; }
.chip.owner { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.foreign-note { background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 9px 14px; margin-bottom: 12px; font-size: .92rem; }
.lead { margin: -6px 0 18px; }
.auth .card h2 { margin-bottom: 12px; }
.register-teaser { text-align: center; }
.register-teaser .btn { margin: 6px 0; }
.userrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.userrow:first-of-type { border-top: 0; }
.userrow .ua { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.userrow .ua input { width: 150px; min-height: 38px; padding: 6px 10px; }
.userrow .ua .btn { min-height: 38px; padding: 0 12px; font-size: .88rem; }
.hint { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: .88rem; }
.hint code { word-break: break-all; }

/* Sender */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.brand-opt { position: relative; }
.brand-opt input { position: absolute; opacity: 0; pointer-events: none; }
.brand-opt span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 6px 10px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font-weight: 700; font-size: .95rem; cursor: pointer; text-align: center; }
.brand-opt input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.brand-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.plane-item .ph.tx { font-weight: 800; font-size: 1.2rem; letter-spacing: .02em; }
.ctl-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.txchip { color: var(--accent); background: var(--accent-soft); border-color: transparent; font-size: .8rem; }
.onboard { text-align: center; margin: 18px 0 20px; }
.onboard h1 { margin-bottom: 8px; }
.onboard-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; align-items: stretch; }
.onboard-actions a.center { display: block; padding: 10px; }

/* Gyro */
.gy-top { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.gy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 6px; }
.gy-grid span { font-size: .78rem; font-weight: 700; color: var(--muted); text-align: center; }
@media (max-width: 420px) { .gy-top { grid-template-columns: 1fr; } }
.grid.gyro td, .grid.gyro thead th { text-align: center; }
.grid.gyro td { font-variant-numeric: tabular-nums; font-weight: 600; }
.grid.gyro tbody th small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; }

/* Akku-Status */
.chip.bstate { border-color: transparent; }
.chip.bstate.full { background: #fde8dd; color: #b8430b; }
.chip.bstate.part { background: #fff1d6; color: #9a6400; }
.chip.bstate.store { background: var(--ok-soft); color: var(--ok); }
.chip.bstate.empty { background: #e8eaf0; color: #4b5563; }
.chip.bstate.deep, .chip.bstate.defect { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.chip.bstate.unk { background: var(--bg); color: var(--muted); }
.chip.bstate.warn { background: var(--danger); color: #fff; }
.chip.big { font-size: 1rem; padding: 6px 14px; }
.plane-item.is-defect { opacity: .6; }
.chargecard.warn { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger) inset; }
.charge-now { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.volt { font-size: 2.4rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.volt small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.volt.full { color: #d2560f; } .volt.part { color: #b07700; } .volt.store { color: var(--ok); } .volt.deep { color: var(--danger); }
.warntext { color: var(--danger); font-weight: 600; font-size: .92rem; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.presets .btn { flex: 1 1 auto; }
.chargeform .btn.block { margin-top: 10px; }
.blog { list-style: none; margin: 0; padding: 0; }
.blog li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 0 8px 10px; border-top: 1px solid var(--line); border-left: 3px solid var(--line); }
.blog li.k-voltage { border-left-color: var(--accent); }
.blog li.k-status { border-left-color: var(--danger); }
.blog li.k-cycles { border-left-color: #b07700; }

/* Anleitung */
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.toc a { padding: 6px 12px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: .85rem; color: var(--text); }
.lead-left { margin: -4px 0 12px; }
.help h3 { margin-top: 1rem; }
.help ol, .help ul { padding-left: 1.3rem; margin: .4rem 0; }
.help li { margin: .35rem 0; }
.help .note { background: var(--bg); border-radius: 10px; padding: 8px 12px; font-size: .88rem; color: var(--muted); }
.helpdl { margin: .5rem 0; }
.helpdl dt { font-weight: 700; margin-top: .7rem; }
.helpdl dd { margin: .15rem 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.helpbtn { margin: 4px 0 14px; }
.tabs a span { white-space: nowrap; }
@media (max-width: 400px) { .tabs a { font-size: .66rem; } }

/* Akku-Nummer & QR-Etiketten */
.bno { display: inline-block; font-weight: 800; color: var(--accent); }
.plane-item .ph.batt { flex-direction: column; line-height: 1.05; }
.plane-item .ph.batt b { font-size: 1.35rem; }
.plane-item .ph.batt small { font-size: .78rem; font-weight: 700; opacity: .8; }
.qrcard { display: flex; gap: 16px; align-items: center; }
.qrcard .qr { width: 104px; height: 104px; flex: none; background: #fff; padding: 6px; border-radius: 8px; }
.qr svg { width: 100%; height: 100%; display: block; }
.labelpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; margin: 6px 0 12px; }
.center-row { justify-content: center; margin: 14px 0 6px; }
.label { display: flex; align-items: center; gap: 2.5mm; background: #fff; color: #000; border: 0.3mm dashed #999; box-sizing: border-box; overflow: hidden; }
.label .qr { flex: none; }
.label .ltext { min-width: 0; font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif; }
.label .lno { font-weight: 800; line-height: 1; }
.label .lname { font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label .lsub { color: #444; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.size-s .label { width: 38mm; height: 19mm; padding: 1.5mm; } .size-s .qr { width: 16mm; height: 16mm; }
.size-s .lno { font-size: 13pt; } .size-s .lname { font-size: 6.5pt; } .size-s .lsub { font-size: 5.5pt; }
.size-m .label { width: 50mm; height: 25mm; padding: 2mm; } .size-m .qr { width: 21mm; height: 21mm; }
.size-m .lno { font-size: 18pt; } .size-m .lname { font-size: 8pt; } .size-m .lsub { font-size: 6.5pt; }
.size-l .label { width: 70mm; height: 35mm; padding: 2.5mm; } .size-l .qr { width: 30mm; height: 30mm; }
.size-l .lno { font-size: 26pt; } .size-l .lname { font-size: 10pt; } .size-l .lsub { font-size: 8pt; }
/* A4-Bogen: auf dem Bildschirm verkleinert mit Schatten, im Druck 1:1 */
.a4wrap { overflow-x: auto; padding: 8px 0 20px; }
.a4page { margin: 0 auto 14px; box-shadow: 0 1px 6px rgba(0,0,0,.18); }
.a4page .label { border: 0.3mm dashed #999; }
.sheetpick { position: relative; width: 100%; max-width: 280px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.sheetgrid { position: absolute; display: grid; }
.sheetpick .cell { display: flex !important; align-items: center; justify-content: center; border: 1px dashed #b5bcc2; border-radius: 2px; cursor: pointer; margin: 0 !important; font-size: 9px !important; font-weight: 700; color: #1b1f22 !important; overflow: hidden; min-width: 0; min-height: 0; }
.sheetpick .cell input { position: absolute; opacity: 0; width: 1px !important; height: 1px !important; }
.sheetpick .cell.filled { background: #d7e9f4; border-style: solid; border-color: #0f5f8a; }
.sheetpick .cell.skip { background: repeating-linear-gradient(45deg, #eee, #eee 3px, #ddd 3px, #ddd 6px); color: #999 !important; }
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff !important; padding: 0 !important; margin: 0 !important; }
  .top, .tabs, .noprint, .flash, #lightbox, .legalfoot, .langsw { display: none !important; }
  .wrap { max-width: none; padding: 0 !important; margin: 0 !important; }
  .a4wrap { overflow: visible; padding: 0; }
  .a4page { margin: 0; box-shadow: none; break-after: page; page-break-after: always; overflow: hidden; }
  .a4page:last-child { break-after: auto; page-break-after: auto; }
  .label { break-inside: avoid; }
}

.splitcard { border-color: var(--accent); background: var(--accent-soft); }
.splitcard p { margin-top: 0; }

/* Sprachumschalter */
.langsw { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; background: var(--card); flex: none; }
.langsw a { padding: 5px 10px; font-size: .78rem; font-weight: 700; text-decoration: none; color: var(--muted); letter-spacing: .03em; }
.langsw a.on { background: var(--accent); color: var(--accent-ink); }
.langsw.in-header { order: 3; margin-left: 10px; }
.langsw.floating { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 16px; z-index: 5; }

/* Mensch-Prüfung & Kontakt */
.hc { border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; margin: 4px 0 12px; background: var(--bg); }
.hc.need { border-color: #c0392b; }
.hc.ok { border-color: #2e8b57; }
.hc-box { display: flex !important; align-items: center; gap: 10px; font-weight: 600; margin: 0 !important; cursor: pointer; }
.hc-box input { width: 22px; height: 22px; margin: 0; flex: none; }
.hc-state { margin-left: auto; font-weight: 700; color: var(--muted); font-size: .9rem; }
.hc.ok .hc-state { color: #2e8b57; font-size: 1.2rem; }
.hc.busy .hc-state::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 6px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: hcspin .8s linear infinite; vertical-align: -2px; }
@keyframes hcspin { to { transform: rotate(360deg); } }
.hc-note { display: block; margin-top: 4px; }
.contactbox { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.contact-out { margin: 10px 0 0; font-weight: 700; word-break: break-all; }
.contact-mail { font-size: 1.05rem; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
@media print { .langsw { display: none !important; } }

/* Rechtliches */
.legalfoot { text-align: center; font-size: .8rem; color: var(--muted); margin: 26px 0 8px; }
.legalfoot a { color: var(--muted); }
.legal h1 { font-size: 1.4rem; margin-bottom: 4px; }
.legal h2 { font-size: 1.02rem; margin: 1.3rem 0 .4rem; }
.legal p, .legal li { line-height: 1.5; }
.legal ul { padding-left: 1.2rem; }
.auth ul.small { text-align: left; padding-left: 1.2rem; line-height: 1.45; }
.form .hc-box { flex-direction: row !important; align-items: center; color: var(--text); font-size: 1rem; text-align: left; }
.form .hc-box input { width: 22px !important; height: 22px; padding: 0; flex: none; }
.hc { text-align: left; }

/* Etiketten: Umschalter Akkus/Flugzeuge, Flugzeugname statt Nummer */
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; background: var(--card); margin: 0 0 12px; }
.segmented a { padding: 7px 16px; font-weight: 700; font-size: .9rem; text-decoration: none; color: var(--muted); }
.segmented a.on { background: var(--accent); color: var(--accent-ink); }
.kind-a .label .lno { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.05; margin-bottom: .6mm; }
.kind-a.size-s .lno { font-size: 8pt; } .kind-a.size-m .lno { font-size: 11pt; } .kind-a.size-l .lno { font-size: 15pt; }
.label .lowner { font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.size-s .lowner { font-size: 5pt; letter-spacing: -.1pt; } .size-m .lowner { font-size: 6.5pt; } .size-l .lowner { font-size: 8pt; }
.optrow { display: flex; flex-direction: column; gap: 2px; }
.label .ltext { overflow: hidden; max-height: 100%; }

/* Statistik */
.statbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.small-seg a { padding: 6px 11px; font-size: .8rem; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile b { display: block; font-size: 1.55rem; font-weight: 800; line-height: 1.1; color: var(--text); }
.tile span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.facts p { margin: 4px 0; }
.mchart { display: flex; align-items: stretch; gap: 4px; height: 150px; padding-top: 16px; }
.mcol { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; position: relative; outline: none; }
.mbar { width: 100%; max-width: 30px; background: var(--accent); border-radius: 4px 4px 0 0; }
.mcol:hover .mbar, .mcol:focus .mbar { filter: brightness(1.15); }
.mval { font-size: .72rem; font-weight: 700; color: var(--text); visibility: hidden; margin-bottom: 2px; }
.mval.peak, .mcol:hover .mval, .mcol:focus .mval { visibility: visible; }
.mlbl { font-size: .68rem; color: var(--muted); margin-top: 4px; text-align: center; line-height: 1.1; min-height: 2.2em; }
.mchart { border-bottom: 0; }
.mcol .mbar { box-shadow: 0 1px 0 var(--line); }
.tscroll { overflow-x: auto; margin: 0 -4px; }
.stable { width: 100%; border-collapse: collapse; font-size: .88rem; }
.stable th { text-align: left; font-size: .74rem; color: var(--muted); font-weight: 700; padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stable td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.stable td a { text-decoration: none; font-weight: 600; }
.stable .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.inbar { display: inline-block; width: 44px; height: 6px; background: var(--bg); border-radius: 3px; margin-right: 6px; vertical-align: middle; overflow: hidden; }
.inbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.slegend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; margin: 6px 0 10px; }
.slegend i, .sbar i { display: inline-block; }
.slegend i { width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.srow { padding: 8px 0; border-top: 1px solid var(--line); }
.sname { font-size: .9rem; margin-bottom: 4px; }
.sbar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; background: var(--bg); }
.sbar i { flex-basis: 0; min-width: 3px; height: 100%; }
.sinfo { margin-top: 4px; }
/* Ladezustände – mit validate_palette.js geprüft (hell + dunkel, farbfehlsichtig) */
.st-full { background: #c9541f; } .st-part { background: #4f6bb8; } .st-store { background: #2e8b57; } .st-empty { background: #9a5fb5; }
.service ul { margin: 4px 0 8px; padding-left: 1.2rem; }
.filterbar { display: flex; gap: 8px; margin-bottom: 12px; }
.filterbar .search { flex: 1; margin: 0; min-width: 0; }
.filterbar .statefilter { width: auto; flex: 0 1 46%; }
@media (max-width: 520px) { .filterbar { flex-direction: column; } .filterbar .statefilter { width: 100%; flex: none; } }
.flash .showwarn { color: inherit; font-weight: 800; margin-left: 6px; white-space: nowrap; }

/* Offline-Betrieb */
.offbar { background: color-mix(in srgb, var(--cg) 11%, var(--card)); border: 1px solid color-mix(in srgb, var(--cg) 30%, transparent); color: var(--text);
  border-radius: 10px; padding: 8px 12px; margin-bottom: 14px; font-size: .88rem; display: grid; gap: 6px; }
.offbar > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.offbar .btn.small { padding: 4px 10px; font-size: .82rem; min-height: 0; }
.offdot { width: 9px; height: 9px; border-radius: 50%; background: var(--cg); flex: none; }
.offtoast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 14px);
  z-index: 60; max-width: min(92vw, 460px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-size: .9rem; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: opacity .6s; }
.offtoast.ok { background: var(--ok); color: #fff; }
.offtoast.err { background: var(--danger); color: #fff; }
.offtoast.gone { opacity: 0; }
.chip.pend { color: var(--cg); border-color: color-mix(in srgb, var(--cg) 35%, transparent); background: color-mix(in srgb, var(--cg) 9%, transparent); }
li.pending-item { opacity: .85; border-left: 3px solid var(--cg); padding-left: 8px; }
ul.pending-item { list-style: none; padding: 0; margin: 10px 0 0; }
.offline-box { margin: 18px 0 6px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius); }
.offline-box .btn { margin-right: 8px; }
.offline-box p { margin: 6px 0 0; }

/* Kopfzeile: Sprache + Hilfe */
.topright { order: 3; display: flex; align-items: center; gap: 8px; margin-left: 10px; flex: none; }
.langsw.in-header { margin-left: 0; }
.helpbtn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .95rem; text-decoration: none; flex: none; }
.helpbtn.on, .helpbtn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media print { .helpbtn { display: none !important; } }

/* Galerie-Übersicht */
.galfilter { align-items: center; flex-wrap: wrap; }
.galfilter select { flex: 1 1 220px; min-width: 0; margin: 0; }
.galfilter .segmented { margin: 0; }
.gallery-all { border-radius: 0; overflow: visible; }
.galhead { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 2px 4px; }
.galhead:first-child { padding-top: 2px; }
.galhead a { color: var(--text); text-decoration: none; }
.galhead a::after { content: ' ›'; color: var(--muted); }
.gallery-all .gitem { border-radius: 6px; }
.lb-title { color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
@media (max-width: 520px) { .galfilter { flex-direction: row; } }

.gitem .gtag { position: absolute; left: 4px; top: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: .68rem; font-weight: 700; padding: 1px 6px; border-radius: 99px; }
.gitem .gcap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; color: #fff; font-size: .74rem; font-weight: 700; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Zustand eines Flugzeugs */
.chip.st-flugtauglich { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.chip.st-jungfernflug { color: #1d5fbf; background: #e3eefc; border-color: transparent; }
.chip.st-im_bau { color: #9a6400; background: #fff1d6; border-color: transparent; }
.chip.st-abgestuerzt { color: #b42318; background: #fde4e1; border-color: transparent; }
@media (prefers-color-scheme: dark) {
  .chip.st-jungfernflug { color: #8ab8ff; background: #1b2a40; }
  .chip.st-im_bau { color: #f0c060; background: #3a2e14; }
  .chip.st-abgestuerzt { color: #ff9b8f; background: #3d1c19; }
}

/* Fertiger Etikettenbogen Avery Zweckform J4773 (63,5 × 33,9 mm) */
.size-j4773 .label { width: 63.5mm; height: 33.9mm; padding: 2.2mm; border-radius: 2mm; } .size-j4773 .qr { width: 28mm; height: 28mm; }
.size-j4773 .lno { font-size: 22pt; } .size-j4773 .lname { font-size: 9pt; } .size-j4773 .lsub { font-size: 7pt; } .size-j4773 .lowner { font-size: 7pt; }
.kind-a.size-j4773 .lno { font-size: 13pt; }
/* Vorgestanzte Etiketten: Schnittlinie nur in der Vorschau, nicht drucken */
@media print { .a4wrap.sheet .label { border-color: transparent; } }

/* Akku-Warnungen: je Meldung ein Block */
fieldset.warnset { border: 1px solid var(--line, #ddd); border-radius: 10px; padding: 10px 12px 4px; margin: 10px 0; min-width: 0; }
fieldset.warnset .grid2 { margin-top: 6px; }
fieldset.warnset .hint { margin: 4px 0 6px; }
