/* APRS-Karte (/aprs-map). Das Gerüst (Panel, Karte, Blatt, Suche, Knöpfe)
   kommt aus style.css (xota-*), hier steht nur, was diese Karte allein hat.
   Alle Regeln an eigenen Klassen mit ak-, siehe Designrichtlinie
   „Eigenes Stylesheet einer Seite bleibt bei sich“. */

.ak-app .xota-panel-inhalt { padding-top: 0; }
.ak-app .tabpanel > section { padding: 0.9rem 0 0.8rem; border-bottom: 1px solid var(--border); }
.ak-app .tabpanel > section:last-child { border-bottom: 0; }
.ak-app .tabpanel .field { margin-top: 0.4rem; }

/* Zahlen, solange keine Station gewählt ist */
.ak-zahlen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 0.8rem; margin: 0.2rem 0 0.6rem; }
.ak-zahl { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 0.4rem; min-width: 0; }
.ak-zahl i {
  width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--ak-farbe); align-self: center;
}
.ak-zahl b { font-variant-numeric: tabular-nums; font-size: 1rem; }
.ak-zahl span { grid-column: 1 / -1; color: var(--muted); font-size: 0.78rem; line-height: 1.25; }
.ak-zahl:not(.gross) span { grid-column: 2; }
.ak-gross { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin-bottom: 0.2rem; }
.ak-zahl.gross { grid-template-columns: 1fr; }
.ak-zahl.gross b { font-size: 1.45rem; color: var(--accent); }
.ak-zahl.gross span { grid-column: 1; }

/* Kopf der gewählten Station */
.ak-kopf { display: flex; align-items: center; gap: 0.7rem; }
.ak-app .tabpanel > section.ak-kopf { padding-top: 0.8rem; }
.ak-sym { width: 40px; height: 40px; flex: none; image-rendering: auto; }
.ak-titel { flex: 1 1 auto; min-width: 0; }
#panel h2.ak-name {
  margin: 0; font-size: 1.25rem; letter-spacing: 0.01em; text-transform: none; color: var(--fg);
  font-weight: 700; overflow-wrap: anywhere;
}
.ak-titel p { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.85rem; }
.ak-art { color: var(--ak-farbe); font-weight: 600; }
.ak-zu {
  flex: none; align-self: flex-start; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 1rem; cursor: pointer; padding: 0.2rem 0.3rem; border-radius: 6px;
}
.ak-zu:hover { color: var(--fg); background: var(--card-hover); }

.ak-werte { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 0.8rem; margin: 0; font-size: 0.9rem; }
.ak-werte dt { color: var(--muted); }
.ak-werte dd { margin: 0; overflow-wrap: anywhere; }
.ak-werte .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.ak-wetter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.ak-wetter div {
  background: color-mix(in srgb, #0891b2 12%, transparent);
  border: 1px solid color-mix(in srgb, #0891b2 35%, transparent);
  border-radius: 9px; padding: 0.35rem 0.5rem; min-width: 0;
}
.ak-wetter span { display: block; font-size: 0.72rem; color: var(--muted); }
.ak-wetter b { font-variant-numeric: tabular-nums; font-size: 0.98rem; }

.ak-knoepfe { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
.ak-knoepfe .btn-sm { text-decoration: none; }
.ak-knoepfe [aria-pressed="true"] { border-color: #f59e0b; color: #f59e0b; }

.ak-roh summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.ak-roh ol { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.ak-roh li { display: grid; gap: 0.1rem; }
.ak-roh time { color: var(--muted); font-size: 0.74rem; }
.ak-roh code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.76rem;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 7px;
  padding: 0.3rem 0.45rem; overflow-wrap: anywhere; white-space: pre-wrap;
}

/* Im Bild */
.ak-liste { list-style: none; margin: 0.4rem -0.4rem 0; padding: 0; }
.ak-liste button {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 0.55rem;
  width: 100%; border: 0; background: transparent; color: var(--fg); font: inherit; font-size: 0.9rem;
  text-align: left; padding: 0.3rem 0.4rem; border-radius: 8px; cursor: pointer;
}
.ak-liste button:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ak-liste b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-liste span { color: var(--muted); font-size: 0.8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Arten in der Ansicht, mit ihrer Farbe */
.ak-arten .ankreuz { margin: 0.45rem 0 0; }
.ak-art-wahl i { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--ak-farbe); flex: none; }

.ak-credits {
  border-top: 1px solid var(--border); padding: 0.5rem 1rem 0.6rem; font-size: 0.78rem; color: var(--muted);
}
.ak-credits p { margin: 0.1rem 0; }

/* Meldungen der Seite und Auskunft unter dem Zeiger teilen sich #hoverinfo
   (Lage in style.css). */
.ak-hover { white-space: nowrap; }

/* Telemetrie: Bits als Marken, an = Akzent */
.ak-bits { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.ak-bit {
  font-size: 0.74rem; padding: 0.1rem 0.45rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
}
.ak-bit.an { color: var(--fg); border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* Verlauf: kleine Kurven untereinander, eine Zeitachse */
.ak-verlauf-kopf { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
#panel .ak-verlauf-kopf h2 { margin: 0; }
.ak-pillen { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.ak-pillen button {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.78rem;
  padding: 0.2rem 0.6rem; cursor: pointer; font-variant-numeric: tabular-nums;
}
.ak-pillen button + button { border-left: 1px solid var(--border); }
.ak-pillen button[aria-pressed="true"] { color: var(--fg); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.ak-kurven { display: grid; gap: 0.7rem; margin-top: 0.7rem; }
.ak-kurve { margin: 0; }
.ak-kurve figcaption {
  display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; color: var(--muted);
  margin-bottom: 0.15rem;
}
.ak-kurve figcaption b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ak-kurve svg { display: block; width: 100%; height: 56px; overflow: visible; touch-action: pan-y; cursor: crosshair; }
.ak-kurve .ak-gitter { stroke: var(--border); stroke-width: 1; }
.ak-kurve .ak-linie { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ak-kurve .ak-flaeche { fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: none; }
.ak-kurve .ak-ende, .ak-kurve .ak-punkt { fill: var(--accent); stroke: var(--bg2); stroke-width: 2; }
.ak-kurve .ak-zeiger { stroke: var(--muted); stroke-width: 1; }
.ak-kurve .ak-skala { fill: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.ak-kurven-achse { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); margin: 0.3rem 0 0.6rem; }

/* Gehört von (AFU-170): Empfänger wählen, Chips, Vorschläge, Auskunft */
#ak-empf-feld { position: relative; margin-bottom: 0.5rem; }
.ak-vorschlag {
  position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 0.2rem 0 0; padding: 0.25rem;
  list-style: none; background: var(--card-bg); border: 1px solid var(--border); border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); max-height: 16rem; overflow-y: auto;
}
.ak-vorschlag li { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.3rem 0.5rem;
  border-radius: 6px; cursor: pointer; font-size: 0.88rem; }
.ak-vorschlag li span { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.ak-vorschlag li[aria-selected="true"], .ak-vorschlag li[role=option]:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ak-vorschlag li[aria-disabled="true"] { cursor: default; }
.ak-chip { border-color: color-mix(in srgb, #e11d48 55%, var(--border)); font-variant-numeric: tabular-nums; }
.ak-chip span { color: var(--muted); margin-left: 0.2rem; }
#ak-empf-optionen .ankreuz { margin: 0.35rem 0 0; }
.ak-empf-liste { list-style: none; margin: 0.6rem 0 0; padding: 0; font-size: 0.85rem; }
.ak-empf-liste li { margin: 0 0 0.35rem; }
.ak-empf-liste span { color: var(--muted); }
.ak-empf-link {
  border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--accent);
  cursor: pointer; margin-right: 0.35rem;
}
.ak-empf-link:hover { text-decoration: underline; }
.ak-gehoert span { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.ak-empf-zahlen { margin: 0 0 0.6rem; padding: 0.45rem 0.6rem; border-radius: 8px; font-size: 0.88rem;
  border: 1px solid color-mix(in srgb, #e11d48 45%, var(--border));
  background: color-mix(in srgb, #e11d48 8%, transparent); }
#ak-gehoert .ak-knoepfe { margin-top: 0.6rem; }
#ak-gehoert .ak-knoepfe svg { vertical-align: -2px; }

/* Der Filter steht auch auf der Karte, damit niemand vergisst, dass er gilt. */
.ak-filter-marke {
  position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); bottom: 2.4rem;
  max-width: calc(100% - 7rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid #e11d48; border-radius: 999px; padding: 0.25rem 0.8rem; font: inherit; font-size: 0.82rem;
  background: var(--card-bg); color: var(--fg); cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Dialog Einspeisen */
.ak-einspeisen { width: min(60rem, 94vw); max-height: 90vh; overflow-y: auto; }
.ak-ein-form { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 0.8rem; }
.ak-ein-form h3 { margin: 0 0 0.5rem; }
.ak-ein-felder { display: flex; flex-wrap: wrap; gap: 0.6rem 0.9rem; align-items: flex-start; }
.ak-ein-felder .field { margin: 0; min-width: 0; flex: 1 1 10rem; }
.ak-ein-felder .field.grow { flex: 2 1 14rem; }
.ak-ein-felder .field.eng { flex: 0 1 8rem; }
.ak-ein-felder input, .ak-ein-felder select { width: 100%; }
.ak-ein-tabelle td { vertical-align: middle; }
.ak-ein-knoepfe { white-space: nowrap; text-align: right; }
.ak-ein-knoepfe .btn-sm { margin-left: 0.25rem; }
.ak-passcode code { font-size: 1.1rem; letter-spacing: 0.06em; }
.ak-beispiel { margin: 0.5rem 0; }
.ak-beispiel summary { cursor: pointer; font-weight: 600; }
.ak-beispiel pre { margin: 0.4rem 0 0; padding: 0.6rem 0.8rem; border-radius: 8px; background: var(--bg2);
  border: 1px solid var(--border); overflow-x: auto; font-size: 0.85rem; }

/* Tooltip unter dem Zeiger (AFU-210), Aussehen wie .tl-tip auf /dx. Steht
   oben links im Kartenrahmen und wird per transform neben den Zeiger
   geschoben; der Zeiger geht hindurch. */
.ak-tip {
  position: absolute; left: 0; top: 0; z-index: 13; max-width: 18rem;
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 0.55rem 0.75rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg2);
  box-shadow: var(--shadow); font-size: 0.85rem; line-height: 1.35;
  pointer-events: none;
}
.ak-tip[hidden] { display: none; }
.ak-tip-kopf { display: flex; align-items: center; gap: 0.5rem; }
.ak-tip-kopf img { flex: none; }
.ak-tip-kopf strong { font-size: 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ak-tip-was { font-weight: 600; }
.ak-tip-art { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); }
.ak-tip-art::before {
  content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--ak-farbe); flex: none;
}
.ak-tip-hinweis { color: var(--muted); font-size: 0.78rem; }
@media (hover: none) { .ak-tip { display: none; } }
