/* OpenWorldSource – ui-20261125 (25.11.2026): Oberfläche.
   Zusatz zu ui-einfach. Keine Funktion wird entfernt.
   Behebt: Suchtext bei 200 %-Zoom, abgeschnittene Blätter,
   kleinen Intro-Überspringen-Knopf, fehlendes Schließen in „Mehr“,
   unnötigen Leerraum in der Desktop-Ebenenliste.
   Infofenster-Lage bleibt dem bestehenden Paket ows-popup-20261125 überlassen. */

/* 1) Intro: Überspringen lesbar und mindestens 44×44 */
#kintro .ki-skip{
  right:10px !important;
  bottom:calc(10px + env(safe-area-inset-bottom,0px)) !important;
  min-width:44px;
  min-height:44px;
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  padding:12px 14px;
  font:600 14px/1.2 system-ui,sans-serif !important;
  letter-spacing:.04em !important;
  color:rgba(245,242,235,.9) !important;
  text-shadow:0 1px 8px rgba(0,0,0,.8);
  border-radius:999px;
  background:rgba(0,0,0,.28);
}

/* 2) Suche bei schmaler Breite: Auge kleiner, Platzhalter bleibt sichtbar */
@media (max-width:280px){
  body.ows-simple .ows-top{gap:6px}
  body.ows-simple .ows-search-wrap{padding:3px 4px 3px 8px;gap:2px;min-height:44px}
  body.ows-simple .ows-search-wrap #search .mag{margin:0 4px 0 0;width:16px;height:16px;flex-basis:16px}
  body.ows-simple #owsKiBtn.ows-ki{min-width:32px;margin:0}
  body.ows-simple .ows-eye-glass{width:36px;height:26px;border-radius:13px}
  body.ows-simple .ows-acct{width:44px;height:44px}
  body.ows-simple .ows-search-wrap #q{
    min-width:72px !important;
    font-size:14px !important;
  }
}

/* 3) Ebenen-Blatt: mehr Höhe, sichtbarer Hinweis zum Scrollen */
@media (max-width:760px){
  body.ows-simple #panel.sheet-half,
  body.ows-simple #panel.sheet-full,
  body.ows-simple.panel-open #panel,
  body.ows-simple #panel.open{
    max-height:calc(100dvh - var(--ows-top-h,56px) - var(--ows-dock-h,52px) - env(safe-area-inset-top,0px) - 20px) !important;
  }
}
@media (max-width:760px) and (max-height:560px){
  body.ows-simple #panel.sheet-half,
  body.ows-simple #panel.sheet-full,
  body.ows-simple.panel-open #panel,
  body.ows-simple #panel.open{
    max-height:calc(100dvh - var(--ows-top-h,48px) - var(--ows-dock-h,48px) - 12px) !important;
  }
  body.ows-simple #panel .lyr,
  body.ows-simple #panel .chip,
  body.ows-simple #panel .cat{min-height:40px;margin:1px 0;padding-top:4px;padding-bottom:4px}
  body.ows-simple #panel h2{margin:4px 0}
}

/* 4) Mehr-Blatt: nutzt die Höhe, bekommt Schließen-Knopf, Inhalt scrollbar */
#owsMoreSheet.ows-sheet{
  top:max(8px, env(safe-area-inset-top,0px)) !important;
  height:calc(100dvh - var(--ows-dock-h,52px) - env(safe-area-inset-bottom,0px) - 12px) !important;
  max-height:none !important;
}
#owsMoreSheet.ows-sheet .ows-sheet-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  position:sticky;
  top:0;
  z-index:2;
  padding-right:4px;
  background:inherit;
}
#owsMoreSheet .ows-sheet-x{
  flex:0 0 auto;
  width:44px;height:44px;
  margin-left:auto;
  border:0;
  border-radius:50%;
  background:rgba(30,32,38,.86);
  border:1px solid rgba(255,255,255,.18);
  color:#fff;
  font-size:22px;line-height:1;
  cursor:pointer;
}
#owsMoreSheet.ows-sheet::after{
  content:"";
  pointer-events:none;
  position:sticky;
  display:block;
  left:0;right:0;
  bottom:0;
  height:28px;
  margin:0 -12px -8px;
  background:linear-gradient(transparent, rgba(12,13,16,.7));
}
@media (max-height:560px){
  body.ows-simple .ows-counters-mini{gap:4px;margin:0 0 8px}
  body.ows-simple .ows-counters-mini button{min-height:44px;padding:6px 8px;font-size:16px}
  body.ows-simple .ows-more-item{min-height:44px;padding:6px 10px}
  #owsMoreSheet.ows-sheet h2{font-size:18px;margin:0 8px}
}

/* Desktop 200 % (CSS-Höhe oft unter 500px, Breite unter 900px): Blatt nicht abschneiden */
@media (min-width:600px) and (max-height:560px){
  #owsMoreSheet.ows-sheet{
    top:6px !important;
    height:calc(100dvh - var(--ows-dock-h,52px) - 10px) !important;
    left:50% !important;
    right:auto !important;
    width:min(640px,96vw) !important;
    transform:translateX(-50%) !important;
    border-radius:24px !important;
  }
  #owsMoreSheet.ows-sheet.on{transform:translateX(-50%) !important}
  body.ows-simple #panel.sheet-half,
  body.ows-simple #panel.sheet-full,
  body.ows-simple.panel-open #panel,
  body.ows-simple #panel.open,
  body.ows-simple #panel{
    max-height:calc(100dvh - var(--ows-top-h,56px) - var(--ows-dock-h,52px) - 16px) !important;
  }
}

/* 5) Desktop-Ebenen: nicht über die ganze Breite strecken, Zahlen näher am Namen */
@media (min-width:761px){
  body.ows-simple #panel,
  body.ows-simple #panel.open,
  body.ows-simple.panel-open #panel{
    width:min(400px, 92vw) !important;
    max-width:400px !important;
    right:auto !important;
  }
  body.ows-simple .ows-counters-mini{grid-template-columns:1fr 1fr}
}

/* 6) Querformat iPhone: Leisten bleiben am Rand, Blatt lässt der Karte Luft */
@media (max-height:500px) and (orientation:landscape){
  body.ows-simple .ows-top{top:max(4px, env(safe-area-inset-top,0px)) !important}
  body.ows-simple .ows-dock{bottom:max(4px, env(safe-area-inset-bottom,0px)) !important}
  body.ows-simple .ows-dock button span{font-size:11px}
  #owsMoreSheet.ows-sheet{
    top:4px !important;
    left:max(8px, env(safe-area-inset-left,0px)) !important;
    right:max(8px, env(safe-area-inset-right,0px)) !important;
    width:auto !important;
    height:calc(100dvh - 8px) !important;
    transform:none !important;
  }
  #owsMoreSheet.ows-sheet.on{transform:none !important}
}

/* 7) Leisten fest an den visuellen Viewport koppeln (Klasse setzt das JS) */
html.ows-vv body.ows-simple .ows-top{
  top:var(--ows-vv-top, var(--ows-pad-top)) !important;
}
html.ows-vv body.ows-simple .ows-dock{
  bottom:var(--ows-vv-bottom, var(--ows-pad-bottom)) !important;
}
