/* AkcjoPilot-Umbau 15.11.2026 - Rahmen: Kopf, Menue, untere Leiste.
   Wird NUR geladen, wenn UMBAU wahr ist (Datei /apps/stockpilot/UMBAU_AUS fehlt).
   Farben/Schrift der Seite werden weiterverwendet (app.css-Variablen). */
/* Farben: umbau_farben.css (Tokens hell/dunkel); --u-text/--u-grau/--u-akz bilden dort auf die Palette ab. */

/* ====================== Handy (<= 820 px, wie die bisherige App-Huelle) ====================== */
@media (max-width: 820px) {
  /* Platz unter dem Inhalt: Leiste 64 px + Sicherheitsrand, damit der Seitenfuss frei bleibt */
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

  /* Kopf: Marke statt Seitentitel; rechts Suche und Menue (je 48 px) */
  .topbar-inner { min-height: 56px; padding: 0 4px 0 14px; }
  .topbar .brand { display: flex; align-items: center; gap: 8px; min-height: 48px; margin-right: auto; color: var(--k-brand); }
  .topbar .brand-name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--k-brand); line-height: 1; }
  .topbar .brand-logo { width: 28px; height: 28px; }
  .topbar .brand-logo path { stroke: var(--k-gold-text); }
  .ap-titel { display: none; }
  .ap-knopf { width: 48px; height: 48px; }
  .ap-knopf:focus-visible, .ap-tab:focus-visible, .topbar .brand:focus-visible { outline: 3px solid var(--u-akz); outline-offset: -3px; }
  .mk-tabs { top: calc(56px + env(safe-area-inset-top, 0px)); }

  /* Untere Leiste: fuenf Ziele, immer mit Text; aktives Ziel = Farbe + fett + Strich oben */
  .ap-tabs-neu { z-index: 150; }
  .ap-tabs-neu .ap-tab { height: 64px; min-width: 48px; gap: 3px; color: var(--u-grau); font-size: 12px; font-weight: 600; }
  .ap-tabs-neu .ap-tab span { display: block; font-size: 12px; line-height: 1.1; font-weight: 600; letter-spacing: 0; }
  .ap-tabs-neu .ap-tab svg { width: 26px; height: 26px; }
  .ap-tabs-neu .ap-tab { flex: 1 1 auto; }
  .ap-tabs-neu .ap-tab span { overflow: visible; text-overflow: clip; padding: 0; }
  .ap-tabs-neu .ap-tab.aktiv { color: var(--u-akz); }
  .ap-tabs-neu .ap-tab.aktiv span { font-weight: 800; }
  .ap-tabs-neu .ap-tab.aktiv::before { top: 0; left: 18%; width: 64%; height: 3px; margin: 0; border-radius: 0 0 3px 3px; background: var(--k-akz); }
  .ap-tabs-neu .ap-tab.aktiv svg { fill-opacity: .14; }

  /* Menue-Schublade: Hauptpunkte gross, Untergruppen erst nach dem Antippen */
  .menu-item > a { min-height: 52px; color: var(--u-text); }
  .menu-item.has-drop > a[aria-expanded="true"] { background: var(--k-weich); }
  .menu-drop .drop-grp + .drop-grp { margin-top: 4px; }
  .menu-drop .drop-head { padding-top: 12px; padding-bottom: 2px; color: var(--u-grau); }
  .menu-drop a { min-height: 44px; display: flex; align-items: center; color: var(--k-t2); }
  .menu-mega { width: auto; }
  .ap-konto a, .ap-konto .linkbtn { min-height: 48px; }
  .menubar { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }   /* letzte Punkte nicht unter der unteren Leiste */

  /* Hinweis auf der Registrierseite (Ziel "Obserwowane" fuer Gaeste) */
  .ap-hinweis { margin: 0 0 12px; }
}

/* ====================== Desktop (>= 821 px): Kopf und Menue in EINER Zeile ====================== */
@media (min-width: 821px) {
  .topbar { display: flex; align-items: stretch; flex-wrap: wrap; column-gap: 6px; padding: 0 16px; }
  .topbar-inner { display: contents; }
  .topbar .brand { order: 1; align-self: center; margin: 0 10px 0 0; padding: 8px 0; }
  .menubar { order: 2; background: transparent; border: 0; display: flex; }
  .menubar-inner { display: flex; flex-wrap: nowrap; padding: 0; align-items: stretch; }
  .menu-item { display: flex; }
  .menu-item > a { display: flex; align-items: center; padding: 0 11px; min-height: 48px; color: #dfe8ef; font-size: 14px; font-weight: 600; white-space: nowrap; }
  .menu-item > a:hover, .menu-item:focus-within > a { color: #fff; background: rgba(255,255,255,.08); box-shadow: inset 0 -3px 0 var(--gold2); }
  .menu-item.has-drop > a::after { color: #9fb3c2; }
  .topbar .quicksearch { order: 3; align-self: center; flex: 1 1 200px; max-width: 300px; margin-left: auto; }
  .topbar .quicksearch input:not(:focus) { border-color: var(--kopf-feld-rand, transparent); }   /* dunkel: sichtbarer Rand (>= 3:1 zum Kopf), hell: wie bisher ohne */
  .topbar .langswitch { order: 4; align-self: center; }
  .topbar .mainnav { order: 5; align-self: center; margin-left: 4px; flex-wrap: nowrap; }
  .ap-schleier { display: none; }
  .topbar .mainnav a[style*="accent"] { color: var(--gold2) !important; }   /* Pilot/Pro-Link: Blau auf Navy war kaum lesbar */
  .menu-drop { top: 100%; border-radius: 0 0 8px 8px; }
  .menu-drop a { min-height: 34px; }
  .menu-item:hover .menu-mega, .menu-item:focus-within .menu-mega { display: grid; }
  .menu-mega { grid-template-columns: repeat(4, minmax(168px, 1fr)); width: 780px; gap: 0 6px; padding: 10px 8px 12px; }
  .menu-mega .drop-head { padding-left: 14px; }
  .menu-mega .drop-grp .drop-head:not(:first-child) { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 12px; }
  /* Startseite: das grosse Suchfeld ist die Hauptaktion, die Kopf-Suche entfaellt dort */
  body.ap-start .topbar .quicksearch { display: none; }
  body.ap-start .topbar .mainnav { margin-left: auto; }
}

/* Fokus sichtbar (Tastatur) */
.menu-item > a:focus-visible, .menu-drop a:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
@media (max-width: 820px) { .menu-item > a:focus-visible, .menu-drop a:focus-visible { outline-color: var(--u-akz); } }

/* Hinweiskasten (Registrierseite) */
.ap-hinweis { background: var(--k-weich); border: 1px solid var(--k-sperre-rand); border-radius: 8px; padding: 12px 14px; color: var(--u-text); }
.ap-hinweis p { margin: 0 0 10px; font-size: 15px; line-height: 1.4; }
.ap-hinweis .ap-hinweis-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.ap-hinweis .btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; flex: 1 1 140px; text-align: center; }

/* ==================== Runde 2 (15.11.2026): Feinschliff Basis ==================== */
/* Bedienung: kein Tipp-Verzoegern, sichtbarer Druckzustand, kein grauer Antippkasten, sanfter aber kurzer Anker-Sprung */
a, button, summary, input, select, label, [role="button"] { touch-action: manipulation; }
html { -webkit-tap-highlight-color: transparent; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; } }
.btn:active, .linkbtn:active, summary:active { opacity: .78; }
.menu-item > a:active, .menu-drop a:active, .ap-konto a:active, .ap-konto .linkbtn:active { background: var(--k-weich-h); }
.ap-knopf:active { background: var(--k-weich-h); }
.teilen-knopf:active, .teilen-nativ:active { background: var(--k-weich-h); border-color: var(--u-akz); }

/* Untere Leiste (Handy): kein "klebendes" Hover nach dem Antippen (Android laesst :hover am zuletzt getippten Ziel stehen,
   dadurch wirkten "Obserwowane"/"Wiecej" heller als die uebrigen). Hover nur bei echter Maus. */
@media (max-width: 820px) {
  .ap-tabs-neu .ap-tab, .ap-tabs-neu .ap-tab:hover { color: var(--u-grau); }
  .ap-tabs-neu .ap-tab.aktiv, .ap-tabs-neu .ap-tab.aktiv:hover { color: var(--u-akz); }
  .ap-tabs-neu .ap-tab:active { background: var(--k-weich-h); }
  .ap-tabs-neu .ap-tab[aria-expanded="true"] { color: var(--u-akz); }
  .ap-tabs-neu .ap-tab { transition: none; }
  .ap-knopf:hover { background: none; color: inherit; }
  .ap-knopf[aria-expanded="true"] { background: var(--k-weich-h); color: var(--u-akz); }
  .ap-knopf:active { background: var(--k-weich-h); }
}
@media (hover: hover) and (min-width: 821px) { .ap-tabs-neu .ap-tab:hover { color: var(--k-t1); } }

/* ---- Teilen: ruhige Zeile am Inhaltsende, mit Seitenrand, umbrechend; Namen sichtbar ---- */
.teilen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 22px 0 12px; padding: 14px 0 0; border-top: 1px solid var(--border); }
.teilen .hint { margin: 0 4px 0 0; font-size: 14px; color: var(--u-grau); }
.teilen .teilen-knopf { height: auto; min-height: 40px; min-width: 40px; padding: 0 12px; gap: 6px; font-size: 14px; font-weight: 600; color: var(--u-text); white-space: nowrap; }
.teilen .teilen-knopf.kopie-knopf { width: auto; margin: 0; opacity: 1; vertical-align: baseline; border: 1px solid var(--border); background: var(--k-f1); }   /* Basisstil .kopie-knopf (17 px, halbtransparent) gilt nur neben WKN/ISIN */
.teilen .teilen-knopf.kopie-knopf.fertig { color: var(--k-plus); background: var(--k-plus-bg); }
.teilen .teilen-knopf.kopie-knopf.misslungen { color: var(--k-minus); background: var(--k-minus-bg); }
.teilen .teilen-knopf[data-name]::after { content: attr(data-name); font-weight: 500; color: var(--u-grau); }
.teilen .teilen-nativ { display: none; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; font: inherit; font-size: 15px; font-weight: 700;
  color: var(--u-akz); background: var(--k-f1); border: 1.5px solid var(--u-akz); border-radius: 24px; cursor: pointer; }
.teilen .teilen-nativ::before { content: ""; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12M7 8l5-5 5 5M5 14v6h14v-6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12M7 8l5-5 5 5M5 14v6h14v-6'/%3E%3C/svg%3E") center/contain no-repeat; }
@media (max-width: 820px) {
  .teilen { margin: 22px 16px 14px; }
  /* Skript (nur Handy + UMBAU): ein Knopf, Liste klappt erst auf */
  .teilen.teilen-kompakt .teilen-nativ { display: inline-flex; width: auto; min-width: max-content; white-space: nowrap; flex: 0 0 auto; }
  .teilen.teilen-kompakt .teilen-label { display: none; }
  .teilen.teilen-kompakt .teilen-liste { display: none !important; }
  .teilen.teilen-kompakt.teilen-offen .teilen-liste { display: flex !important; flex-direction: column; width: 100%; gap: 0; margin-top: 4px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--k-f1); }
  .teilen.teilen-kompakt.teilen-offen .teilen-knopf { justify-content: flex-start; min-height: 48px; width: 100%; border: 0; border-radius: 0; border-bottom: 1px solid var(--k-linie2); padding: 0 16px; background: var(--k-f1); font-size: 16px; }
  .teilen.teilen-kompakt.teilen-offen .teilen-knopf:last-child { border-bottom: 0; }
}
@media (min-width: 821px) { .teilen { max-width: 1100px; } }

/* ---- Nach-oben-Knopf: rechts, >= 48 px, ueber unterer Leiste und Cookie-Leiste (Hoehe setzt das Skript) ---- */
.ap-hoch { position: fixed; right: 12px; bottom: var(--ap-hoch-b, 84px); z-index: 140; width: 48px; height: 48px; padding: 0; display: flex; align-items: center; justify-content: center;
  color: var(--k-haupt-t); background: var(--k-haupt); border: 2px solid var(--k-f1); border-radius: 50%; box-shadow: 0 2px 10px rgba(15,23,40,.3); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .15s, transform .15s, visibility 0s .15s; }
.ap-hoch.sichtbar { opacity: 1; visibility: visible; transform: none; transition: opacity .15s, transform .15s; }
.ap-hoch svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ap-hoch:active { background: var(--k-haupt-h); }
.ap-hoch:focus-visible { outline: 3px solid var(--u-akz); outline-offset: 3px; }
@media (min-width: 821px) { .ap-hoch { right: 24px; } }
body.ap-menue-offen .ap-hoch { display: none; }
/* Runde 3 (Reste): am Handy bringen Samsung Internet & Co. schon einen eigenen Knopf mit - unserer waere doppelt */
@media (max-width: 820px) { .ap-hoch { display: none !important; } }

/* ---- Menue: Zeile "Dein Paket" (alle Angemeldeten) ---- */
.ap-pakiet { margin: 0; padding: 12px 0 10px; border-bottom: 1px solid var(--k-linie2); }
.ap-pakiet-text { display: block; font-size: 14px; line-height: 1.4; color: var(--u-grau); }
.ap-pakiet-text b { color: var(--u-text); }
.ap-konto .ap-pakiet a { display: inline-flex; align-items: center; min-height: 48px; padding: 0; border: 0; width: auto; color: var(--u-akz); font-weight: 700; font-size: 15px; }

/* ---- Feste Hoehen gegen Layoutsprung: Kopf und untere Leiste haben immer dieselbe Hoehe ---- */
@media (max-width: 820px) {
  .topbar-inner { height: 56px; }
  body.ap-suche-offen .topbar-inner { height: auto; min-height: 56px; }
  .ap-tabs-neu { height: calc(64px + env(safe-area-inset-bottom, 0px)); contain: layout; }
}

/* ==================== Runde 4 (16.11.2026): Farbschema, Tippziele, Hover ==================== */
/* Touch-Geraete: kein "haengenbleibendes" Hover aus app.css (Hover gilt nur mit Maus, hier fuer die Regeln der Basis-Stilvorlage) */
@media (hover: none) {
  a:hover { text-decoration: none; }
  .btn:hover { background: var(--k-haupt); }
  .btn-secondary:hover, .btn-ghost:hover, .teilen-knopf:hover { background: var(--k-f1); border-color: var(--k-rand); }
  table.data tr:hover td { background: transparent; }
  .menu-drop a:hover { background: transparent; }
  .mk-range-knoepfe button:hover { background: var(--k-f1); color: var(--k-muted); }
  .mk-range-knoepfe button.aktiv:hover { background: var(--k-text); color: var(--k-auf-text); }
}

/* Aussehen: Automatisch / Hell / Dunkel (Menue am Handy, Fusszeile ueberall) */
.ap-aussehen { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 16px 14px; }
.ap-aussehen-t { font-size: 14px; font-weight: 600; color: var(--k-grau); }
.ap-aussehen-w { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 2px; padding: 3px; border-radius: 12px; background: var(--k-f3); }
.ap-aussehen-w button { min-height: 44px; min-width: 44px; padding: 0 12px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--k-grau); cursor: pointer; }
.ap-aussehen-w button[aria-pressed="true"] { background: var(--k-f1); color: var(--k-t1); box-shadow: 0 1px 3px rgba(15,23,40,.16); }
.ap-aussehen-w button:focus-visible { outline: 3px solid var(--k-fokus); outline-offset: 1px; }
html:not(.js) .ap-aussehen { display: none; }
@media (min-width: 821px) { #ap-menue .ap-aussehen { display: none; } }
.footer-col { min-width: 0; }
.footer .ap-aussehen { padding: 10px 0 0; justify-content: flex-start; }
.footer .ap-aussehen-w button { padding: 0 10px; }
.footer .ap-aussehen-t { color: #b9cbd7; }
.footer .ap-aussehen-w { background: rgba(255,255,255,.1); }
.footer .ap-aussehen-w button { color: #dfe8ef; }
.footer .ap-aussehen-w button[aria-pressed="true"] { background: rgba(255,255,255,.9); color: #0e2a3b; }

/* Fokusring in der Farbe der Palette (hell wie dunkel sichtbar) */
:focus-visible { outline-color: var(--k-fokus); }

/* GROSSBUCHSTABEN-Etiketten: mindestens 12 px (Pruefer Runde 2, Befund 20) */
.mk-pill, .news-kat, .werbung-marke { font-size: 12px !important; }
@media (min-width: 821px) { .mk-label, table.data th, .mk-zahlen span, .mk-zahlen .mk-zahlen-l, .kpi-label { font-size: 12px !important; } }

/* Tippziele am Handy (>= 44 px): Namen-Links in Tabellen/Listen, kleine Knoepfe, Ratgeber-Kurzlinks */
@media (max-width: 820px) {
  table.data td > a:not(.btn), table.data td > strong > a { display: inline-flex; align-items: center; min-height: 44px; }
  .btn.btn-sm { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .mk-ratgeber-liste li a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; justify-content: center; }
  .rv-balken .b-name a, .rv-vertrauen a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .mk-prosa p > a:only-child, .rv-einmal a { display: inline-flex; align-items: center; min-height: 44px; }
  .mk-head h2 a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
  details.us-seite > summary { display: flex; align-items: center; min-height: 44px; }
}

/* Einleitung am Handy: zwei Zeilen + Knopf Wiecej/Mniej (umbau_lead.js). Ohne JavaScript steht der volle Text da. */
@media (max-width: 820px) {
  html .mk-titel .mk-lead.lead-kurz { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .lead-knopf { display: flex; align-items: center; min-height: 44px; margin: -6px 0 -4px; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--k-akz); cursor: pointer; text-align: left; }
  .lead-knopf[hidden] { display: none; }
  .lead-knopf:focus-visible { outline: 3px solid var(--k-fokus); outline-offset: 2px; border-radius: 4px; }
}
@media (min-width: 821px) { .lead-knopf { display: none; } }

/* Fusszeile am Handy: gleicher Zeilenabstand fuer ein- und zweizeilige Links (Tippziel >= 44 px) */
@media (max-width: 820px) {
  .footer-col a { display: flex; align-items: center; min-height: 44px; padding: 10px 0; box-sizing: border-box; }
}

/* ---- Runde 9 (16.11.2026): Tippziele und Mindestschrift am Handy ---- */
@media (max-width: 767px) {
  .kopie-knopf, .teilen .teilen-knopf.kopie-knopf { min-width: 44px; min-height: 44px; }
  .lead-knopf { min-width: 44px; }
  .dp-reiter-a.dp-reiter-plus { min-width: 44px; }
  .mk-tile-name, .mk-label, .kpi-label, .ap-plan, #bd-stand { font-size: 12px; }
}
.btn.kopie-knopf { opacity: 1; }   /* Runde 9: 'Kopiuj link' war halbtransparent (Kontrast) */
