/* Seite „Digital" — Ergänzungen zu ui.css */
.tabs { display: flex; gap: 4px; }
.tabs .btn { text-decoration: none; }
/* Die Seite ist genau so hoch wie das Fenster: Kopf, Reiter und Fuß fest, der Hauptteil nimmt den Rest, die Listen
   scrollen innen; die Karte spannt beide Zeilen. Vorher feste Pixelhöhen (Stationen 200, Pakete 420): auf großen
   Fenstern blieb unten Platz leer, danach wuchs die Seite mit der Paketliste über das Fenster hinaus (17.10.). */
body.digi { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body.digi .top, body.digi .bands, body.digi .foot, body.digi .gallery { flex: none; }
body.digi .digi-main { flex: 1 1 auto; height: 0; min-height: 360px; }   /* height 0 + flex: genau der Rest, kleine Fenster scrollen die Seite */
.digi-main { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(360px, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px; padding: 6px 16px 12px; }
.card-stations, .card-packets { display: flex; flex-direction: column; min-height: 0; }
.card-map { grid-row: span 2; padding: 0; overflow: hidden; min-height: 0; }
#map { width: 100%; height: 100%; min-height: 0; background: #000; }
.mk { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.6); box-shadow: 0 0 0 1px rgba(255,255,255,.35); cursor: pointer; }
.mk-home { background: #34d399; width: 13px; height: 13px; box-shadow: 0 0 0 3px rgba(52,211,153,.3); }
.mk-aprs { background: #fbbf24; }
.mk-ft8 { background: #34d399; }
.mk-log { background: #e5e7eb; }
.rw-dirs { display: grid; gap: 6px; margin: 4px 0 10px; }
.rw-dir { display: grid; grid-template-columns: 28px 1fr 70px; align-items: center; gap: 8px; font-size: 12px; }
.rw-dir i { display: block; height: 8px; border-radius: 4px; background: var(--accent, #34d399); min-width: 2px; }
.rw-dir b { text-align: right; font-weight: 500; }
.rw-note { font-size: 11px; line-height: 1.5; }
.maplibregl-popup.tip .maplibregl-popup-content { background: #000; color: #fff; border: 1px solid rgba(255,255,255,.2); font: 11px/1.4 "JetBrains Mono", monospace; padding: 6px 8px; border-radius: 4px; }
.maplibregl-popup.tip .maplibregl-popup-tip { border-top-color: #000; border-bottom-color: #000; }
.maplibregl-ctrl-attrib { font-size: 10px; }
.stations { max-height: max(160px, 24vh); overflow-y: auto; font-size: 11px; }
.st { display: flex; gap: 10px; align-items: baseline; padding: 3px 0; border-bottom: 1px solid var(--line2); }
.st b { min-width: 90px; color: var(--accent); }
.st .dist { margin-left: auto; color: var(--text); }
.packets { flex: 1 1 auto; min-height: 0; overflow-y: auto; font-size: 11px; }
.pk { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; padding: 3px 0; border-bottom: 1px solid var(--line2); }
.pk .t { color: var(--faint); white-space: nowrap; }
.pk b { color: var(--accent); }
.pk .via { color: var(--faint); }
.pk .lvl { color: var(--faint); font-size: 10px; }
.pk .cm { flex-basis: 100%; color: var(--muted); }
.muted { color: var(--muted); }
@media (max-width: 900px) { body.digi { display: block; } body.digi .digi-main { height: auto; min-height: 0; } .digi-main { grid-template-columns: 1fr; grid-template-rows: auto; } .card-map { grid-row: auto; min-height: 300px; } #map { min-height: 300px; } .stations { max-height: 200px; } .packets { max-height: 420px; } }

#gridbtn.active { border-color: var(--accent); color: var(--accent); }

/* SSTV-Galerie */
.gallery { padding: 6px 16px 12px; }
.galgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.galgrid figure { margin: 0; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.galgrid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #000; }
.galgrid figcaption { padding: 5px 8px; font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.galgrid figcaption b { color: var(--accent); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 100; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 92vw; max-height: 82vh; image-rendering: auto; border: 1px solid var(--line); }
.lb-x, .lb-nav { position: absolute; background: rgba(0,0,0,.6); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; font: 700 22px/1 system-ui; cursor: pointer; padding: 8px 12px; }
.lb-x { top: 12px; right: 12px; } .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); } .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-info { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: #ddd; font-size: 12px; background: rgba(0,0,0,.6); padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
body.sstv .digi-main { display: none; }
.lightbox[hidden], .gallery[hidden] { display: none; }

/* APRS: direkt / über Digi */
.card-map { position: relative; }
.seg { position: absolute; left: 10px; top: 10px; z-index: 5; display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--bg); box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.seg button { font: inherit; font-size: 11px; padding: 5px 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-fg, #000); }
body:not(.dec-aprs) .aprsonly { display: none; }
.mk-via { opacity: .45; }
.mk-digi { border-radius: 2px; background: #fbbf24; width: 13px; height: 13px; }
.st .tag, .pk .tag { font-size: 10px; letter-spacing: .04em; padding: 0 5px; border-radius: 3px; border: 1px solid currentColor; }
.tag.dir { color: var(--accent); } .tag.via { color: var(--faint); } .tag.digi { color: #fbbf24; }
.pk.isvia { opacity: .55; }
body:not(.dec-reichweite) .rwonly { display: none; }
/* FT8 auf mehreren Bändern: Legende auf der Karte (Klick blendet ein Band aus), Band-Kürzel in den Listen */
body:not(.dec-ft8) .ft8only { display: none; }
.ft8legend[hidden] { display: none; }
.ft8legend button { display: flex; align-items: center; gap: 5px; color: var(--text); }
.ft8legend button i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.ft8legend button.off { color: var(--faint); text-decoration: line-through; }
.ft8legend button.off i { opacity: .3; }
.btag { display: inline-block; font-size: 9px; line-height: 1; padding: 2px 4px; margin-right: 3px; border-radius: 3px; color: #000; background: var(--bc); font-weight: 600; }

body.dec-nomap .card-map { display: none; }
/* Pager/FreeDV ohne Karte: Rufe (digi.js füllt sie in #stations) links in voller Höhe, RICs (#packets) rechts */
body.dec-nomap .digi-main { grid-template-columns: 1.6fr 1fr; grid-template-rows: minmax(0, 1fr); }
body.dec-nomap .card-stations { grid-column: 1; grid-row: 1; } body.dec-nomap .card-packets { grid-column: 2; grid-row: 1; }
body.dec-nomap .stations { max-height: none; flex: 1 1 auto; }
@media (max-width: 900px) { body.dec-nomap .digi-main { grid-template-columns: 1fr; grid-template-rows: auto; } body.dec-nomap .card-packets, body.dec-nomap .card-stations { grid-column: auto; grid-row: auto; } body.dec-nomap .stations { max-height: 200px; } }
.pk.ric { cursor: pointer; } .pk.ric:hover { background: var(--bg2); } .pk.ric.active { background: var(--bg2); outline: 1px solid var(--accent); border-radius: 4px; padding-left: 4px; }
.pk.ricfilter { background: var(--bg2); border-radius: 4px; padding: 4px 6px; margin-bottom: 4px; } .ricclear { font-size: 11px; padding: 1px 8px; margin-left: auto; }

.pk .ok { color: var(--ok); } .pk .warn { color: var(--warn); }

/* Reiter aus decoder.json: Textkonsole (RTTY, CW, PSK31, NAVTEX) und Karten nur, wo vorhanden */
.tl { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--line2); font-size: 12px; }
.tl .t { color: var(--faint); white-space: nowrap; font-size: 11px; }
.tl .tx, .pk .tx { color: var(--text); white-space: pre-wrap; word-break: break-word; font-family: var(--mono, ui-monospace, monospace); }
.card-stations[hidden], .card-packets[hidden] { display: none; }
body.dec-nomap .digi-main:has(.card-stations[hidden]) .card-packets { grid-column: 1 / -1; }   /* nur Text: volle Breite */
/* Sammelmarker: mehrere Stationen an derselben Stelle (FT8: gleiches Locator-Feld), Zahl = Anzahl */
.mk-n { width: auto; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; font: 700 9px/13px "JetBrains Mono", monospace; color: #000; text-align: center; }
.maplibregl-popup.tip .grp-h { margin-bottom: 4px; }
.maplibregl-popup.tip .grp { max-height: 240px; overflow-y: auto; padding-right: 4px; }
.maplibregl-popup.tip .grp > div { white-space: nowrap; }
.maplibregl-popup.tip .grp .muted { opacity: .7; }
.more { padding: 6px 0; }
.ft8span { top: 44px; }   /* unter der Bänder-Legende */
.ft8legend[hidden] + .ft8span { top: 10px; }   /* nur ein Band: keine Legende, Umschalter nach oben */
