/* Handy-Ansicht der Demo (Breite bis 600 px). Zusatzdatei, der App-Code bleibt unveraendert. */
@media (max-width: 600px) {
  :root { --demo-band: 60px; --titelleiste-hoehe: 36px; }
  html.ist-demo body { font-size: 14px; overflow: hidden; }
  html.ist-demo, html.ist-demo body { max-width: 100vw; overflow-x: hidden; }
  #demo-band { font-size: 12px; }
  #demo-band { padding: 2px 12px; }
  #demo-band a { display: inline-flex; align-items: center; min-height: 40px; }
  #demo-band .demo-links { gap: 8px; }
  #demo-band .demo-text { line-height: 1.25; }

  /* Navigation: waagerechte Leiste oben, in sich scrollbar */
  html.ist-demo .app, html.ist-demo .app[data-leiste] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
  html.ist-demo .rail, html.ist-demo .app[data-leiste=zu] .rail { visibility: visible; border-right: 0; border-bottom: 1px solid var(--line); overflow: hidden; }
  html.ist-demo .rail-in, html.ist-demo .app:not([data-leiste=voll]) .rail-in { width: 100%; height: auto; flex-direction: row; align-items: center; gap: 4px; padding: 4px 8px; }
  html.ist-demo .brand, html.ist-demo .app:not([data-leiste=voll]) .brand { flex: none; flex-direction: row; padding: 0 4px; gap: 0; }
  html.ist-demo .brand b, html.ist-demo .brand i, html.ist-demo .rail-zu, html.ist-demo .rail-griff, html.ist-demo .rail-spacer,
  html.ist-demo .jev, html.ist-demo .rail-foot .who, html.ist-demo .nav-inv, html.ist-demo .nav-no, html.ist-demo .nav-gap, html.ist-demo .nav-tx { display: none !important; }
  html.ist-demo .nav-wrap { flex: 1 1 0; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  html.ist-demo .nav-wrap::-webkit-scrollbar { display: none; }
  html.ist-demo .nav { flex-direction: row; gap: 2px; width: max-content; }
  html.ist-demo .app:not([data-leiste=voll]) .nav-ic, html.ist-demo .nav-ic { display: block; }
  html.ist-demo .nav-item, html.ist-demo .app:not([data-leiste=voll]) .nav-item { height: 40px; min-width: 40px; justify-content: center; padding: 0 10px; border-radius: 20px; }
  html.ist-demo .nav-item .ic { width: 18px; height: 18px; }
  html.ist-demo .nav-item[aria-current=page] { background: var(--inv-bg); color: var(--inv-fg); }
  html.ist-demo .rail-foot, html.ist-demo .app:not([data-leiste=voll]) .rail-foot { flex: none; border-top: 0; padding: 0; }
  html.ist-demo .invert-btn { height: 40px; min-width: 40px; justify-content: center; padding: 0 10px; border-radius: 20px; }
  html.ist-demo .app[data-leiste=zu] .titelleiste { padding-left: 12px; }

  /* Kopf und Raster */
  html.ist-demo .titelleiste { padding: 0 12px; }
  html.ist-demo .scr-head { padding: 12px 12px 10px; min-height: 0; flex-wrap: wrap; gap: 8px; }
  html.ist-demo .scr-title { font-size: 19px; white-space: normal; }
  html.ist-demo .scr-sub { font-size: 11px; white-space: normal; }
  html.ist-demo .scr-tools { flex-wrap: wrap; }
  html.ist-demo .hinweise, html.ist-demo .banner, html.ist-demo .leer-kompakt { margin-left: 12px; margin-right: 12px; }
  html.ist-demo .leer-kompakt { padding-left: 0; padding-right: 0; }
  html.ist-demo .set { padding: 4px 12px 20px; }
  html.ist-demo .set-r { gap: 10px; padding: 12px 0; }
  html.ist-demo .ph, html.ist-demo .leer { padding: 16px 12px; }

  /* Tippziele */
  html.ist-demo .btn { height: 40px; padding: 0 14px; font-size: 13px; }
  html.ist-demo .seg button, html.ist-demo .seg-inv span { height: 36px; font-size: 13px; }
  html.ist-demo .inp { height: 40px; font-size: 14px; max-width: 100%; }
  html.ist-demo .sw-t { height: 28px; width: 50px; }
  html.ist-demo .sw-t::before { content: ""; position: absolute; inset: -8px -4px; }
  html.ist-demo .sw-t:after { top: 5px; left: 5px; width: 16px; height: 16px; }
  html.ist-demo .sw-t[aria-checked=true]:after { transform: translate(22px); }

  /* Schriftboden 11 px */
  html.ist-demo .label, html.ist-demo .tag, html.ist-demo kbd, html.ist-demo .cc .st, html.ist-demo .cc .el, html.ist-demo .cc .l3,
  html.ist-demo .cc .rl, html.ist-demo .bb-fuss, html.ist-demo .loop-n span, html.ist-demo .loop-ag em, html.ist-demo .marken-gitter .kopf,
  html.ist-demo .marken-gitter .k, html.ist-demo .set-r .wirksam, html.ist-demo .loop-pc { font-size: 11px; }

  /* Breite Inhalte scrollen in sich */
  html.ist-demo .scr-body, html.ist-demo .stage, html.ist-demo .screen { min-width: 0; max-width: 100%; }
  html.ist-demo table { display: block; max-width: 100%; overflow-x: auto; }
  html.ist-demo .marken-gitter { grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1fr); }
  html.ist-demo .loop { grid-template-columns: minmax(0, 1fr) auto 38px; gap: 8px; }
  html.ist-demo .loop .bar { display: none; }

  html.ist-demo :is(h2, h3, legend, small, th, time, footer, .dl, .hl, .heat-foot span, .heat span, .ttl span, .tm, .fs-br span, .fs-recht, .fs-recht i, .fs-zeile-kopf span, .fs-etikett, .fs-feld, .pj-it span, .pj-nr, .pj-ev-art, .pj-status, .loop-bb-fehlt, .tile-h) { font-size: 11px; }
  html.ist-demo svg text, html.ist-demo svg tspan { font-size: max(1em, 11px); }

  /* Tippziele 40 px */
  html.ist-demo .app :is(button, select, input:not([type=checkbox]):not([type=radio]), summary) { min-height: 40px; }
  html.ist-demo .app :is(button.rnd, .btn.icon, .fs-bk-toggle, .pj-link) { min-width: 40px; }
  html.ist-demo .pj-link { display: inline-flex; align-items: center; justify-content: center; }
  html.ist-demo .tile-grip { display: none; }
  html.ist-demo .fs-chip, html.ist-demo .rt-reiter, html.ist-demo .int-waehle { min-height: 40px; }
}

@media (max-width: 600px) { html.ist-demo text.gv-karte { display: none; } }

/* Hinweis nur am Handy: einmal, dezent, wegklickbar */
#demo-hinweis-box { display: none; }
@media (max-width: 600px) {
  #demo-hinweis-box { display: flex; align-items: center; gap: 8px; position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 2147483001; padding: 10px 6px 10px 14px; box-sizing: border-box; border-radius: 12px; background: #1b2530; color: #e6edf5; border: 1px solid #2c3a49; font: 13px/1.4 system-ui, sans-serif; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); animation: demo-hinweis-ein .25s ease-out; }
  #demo-hinweis-box[hidden] { display: none; }
  #demo-hinweis-box p { flex: 1 1 auto; min-width: 0; margin: 0; }
  #demo-hinweis-box .dh-ok { flex: none; min-height: 40px; padding: 0 14px; border: 1px solid #3a4b5e; border-radius: 20px; background: transparent; color: #9cc4ee; font: 600 13px/1 system-ui, sans-serif; cursor: pointer; }
  #demo-hinweis-box .dh-x { flex: none; width: 40px; height: 40px; border: 0; border-radius: 20px; background: transparent; color: #9fb0c2; font: 20px/1 system-ui, sans-serif; cursor: pointer; }
  #demo-hinweis-box button:focus-visible { outline: 2px solid #9cc4ee; outline-offset: 1px; }
}
@keyframes demo-hinweis-ein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #demo-hinweis-box { animation: none !important; } }
