/* Naimex-Dienste (bio, cloud, link, gen, mail): App-Ansicht auf dem Handy und Barrierefreiheit (November 2026).
   Gehört zu js/nx-mobile.js. Wird nach css/styles.css geladen.
   Textgröße folgt Browser und iOS („Größerer Text"), Tab-Leiste unten, sichtbarer Fokus, Kontrast 3:1 für Felder,
   „Kontrast erhöhen", Windows-Kontrastmodus, „Bewegung reduzieren" hält alles an. */
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) {
  :root{font:-apple-system-body}
}
:root{--input-border:#80849F;--focus-ring:#6E5394;--ok:#23704F;--warn:#8A5A00}
[data-theme="dark"]{--input-border:#7E8398;--focus-ring:#C3B0DD;--ok:#5CC98D;--warn:#E8B577}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--input-border:#7E8398;--focus-ring:#C3B0DD}}

:focus-visible{outline:3px solid var(--focus-ring);outline-offset:2px}
.tin:focus-visible,.search-in:focus-visible{outline:2px solid transparent}
.tin,.search-in,.chip-input{border-color:var(--input-border)}
.skip{position:absolute;left:12px;top:0;transform:translateY(calc(-100% - 24px));z-index:300;padding:12px 16px;border-radius:10px;background:var(--surface);color:var(--text);border:2px solid var(--focus-ring);font-weight:700;text-decoration:none}
.skip:focus{transform:none;top:calc(10px + env(safe-area-inset-top))}
.login-wrap h1:focus,.content h2:focus{outline:none}
.form-error:empty{display:none}
.nx-sr{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
h1,h2,h3,.file-name{overflow-wrap:break-word;hyphens:auto}
.view-head h2{flex:0 1 auto;min-width:0}
.btn-mini,.btn-ghost,.btn-primary,.btn-danger{max-width:100%}
.mono,.secret-box,.code-line,.target-line,pre,code{overflow-wrap:anywhere}
pre{white-space:pre-wrap}
.kv{flex-wrap:wrap}
.kv>*{min-width:0;overflow-wrap:anywhere}
.topbar{height:auto;min-height:60px}
.app{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
.brand{flex:0 1 auto;min-width:0}
.brand b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.legal-foot a,.login-foot a,.side-foot a{display:inline-block;padding:5px 2px}
.grid-cards>*,.field-row>*,.panel{min-width:0}
.panel-foot,.view-head,.dlg-foot{flex-wrap:wrap}
.content:focus:not(:focus-visible){outline:none}
.chip button{min-width:24px;min-height:24px}
.code-line{min-height:24px;line-height:24px}
.chips input{min-height:28px}
.avatar{background-image:linear-gradient(135deg,#4E5689,#7C5FA3)}
[data-theme="dark"] .mchip.owner{color:#C5C9E6}

/* Tab-Leiste (nur Handy, und nur wenn der Bildschirm hoch genug ist: bei starkem Zoom bleibt nichts fest stehen) */
.tabbar{display:none}
@media (max-width:42.5em) and (min-height:30em){
  .tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:55;min-height:calc(62px + env(safe-area-inset-bottom));padding:4px max(4px,env(safe-area-inset-left)) env(safe-area-inset-bottom) max(4px,env(safe-area-inset-right));background:var(--surface);border-top:1px solid var(--border);box-shadow:0 -6px 18px rgba(18,22,43,.08)}
  .tabbar .tab{position:relative;flex:1 1 0;min-width:0;min-height:54px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:4px 2px;border:0;border-radius:10px;background:none;color:var(--muted);font-size:min(.72rem,14px);font-weight:600;line-height:1.15;text-align:center}
  .tabbar .tab span{max-width:100%;overflow-wrap:break-word;hyphens:auto}
  .tabbar .tab svg{width:22px;height:22px;flex:none}
  .tabbar .tab.on{color:var(--text)}
  .tabbar .tab.on svg{color:var(--lilac-strong)}
  .tabbar .tab.on::before{content:"";position:absolute;top:0;left:30%;right:30%;height:3px;border-radius:0 0 3px 3px;background:var(--lilac-strong)}
  .tabbar .tab:active{background:var(--hover-bg)}
  .has-tabbar .menu-btn,.has-tabbar .menu-btn.icon-btn{display:none!important}
  .has-tabbar .app .content{padding-bottom:calc(62px + env(safe-area-inset-bottom))}
  .has-tabbar .app .legal-foot{margin-bottom:calc(72px + env(safe-area-inset-bottom))}
  .has-tabbar:has(#view-app:not(.hidden)) .toast{bottom:calc(62px + 16px + env(safe-area-inset-bottom))}
  .has-tabbar:has(#view-app:not(.hidden)) .cookie-banner{bottom:calc(62px + 10px + env(safe-area-inset-bottom))}
  .has-tabbar:has(#view-app:not(.hidden)) .up-panel{bottom:calc(62px + 12px + env(safe-area-inset-bottom))}
  /* Seitenleiste als Blatt über der Tab-Leiste */
  .has-tabbar .app .sidebar{position:fixed;top:auto!important;left:0;right:0;bottom:calc(62px + env(safe-area-inset-bottom));z-index:54;width:auto!important;max-height:min(72vh,calc(100vh - 140px));border-right:0;border:1px solid var(--border);border-bottom:0;border-radius:18px 18px 0 0;padding:10px 12px 14px!important;transform:translateY(calc(100% + 90px));transition:transform .22s ease,visibility 0s linear .22s;box-shadow:none;visibility:hidden}
  .has-tabbar .app.side-open .sidebar{transform:none;visibility:visible;transition:transform .22s ease,visibility 0s;box-shadow:0 0 0 100vmax rgba(15,17,30,.42)}
  .has-tabbar .app .sidebar .folder-btn{min-height:48px}
  /* Tastatur offen: Tab-Leiste weg, damit sie das Feld nicht verdeckt */
  .has-tabbar .app:has(input:not([type=checkbox]):not([type=radio]):not([type=range]):focus,textarea:focus,select:focus) .tabbar{display:none}
}
/* Burger-Menü der Seite (bis 860 px, wenn keine Tab-Leiste da ist): die geschlossene Seitenleiste ist nicht per Tab erreichbar */
@media (max-width:860px){
  .has-tabbar:has(.menu-btn) .app:not(.side-open) .sidebar{visibility:hidden;transition:transform .2s,visibility 0s linear .2s}
}
@media (max-width:42.5em){
  .grid-cards,.field-row{grid-template-columns:minmax(0,1fr)}
  .user-menu{position:fixed;left:auto;right:10px;top:calc(64px + env(safe-area-inset-top));width:min(260px,calc(100vw - 20px))}
}
@media (max-width:22.5em){
  .brand b span{display:none}
  .login-box{padding:28px 20px}
  .login-wrap{padding:16px 12px}
}

/* Finger statt Maus: Ziele mindestens 44 px, Felder mindestens 16 px Schrift (iOS zoomt sonst) */
@media (pointer:coarse){
  .tin,.search-in,select,textarea,input:not([type]),input[type=text],input[type=email],input[type=search],input[type=url],input[type=number],input[type=password]{font-size:max(16px,1rem)}
  .icon-btn{width:44px;height:44px}
  .user-chip{min-height:44px;min-width:44px}
  .btn-primary,.btn-ghost,.btn-danger{min-height:44px}
  .btn-mini{min-height:40px}
  .dlg-x{min-width:44px;min-height:44px}
  .folder-btn,.user-menu button,.user-menu a,.act-menu button{min-height:44px}
  .legal-foot a,.login-foot a,.side-foot a{padding:10px 4px}
  .seg button{min-height:40px}
  .chip-x{min-width:28px;min-height:28px}
  .crumb{min-height:40px}
  input[type=checkbox],input[type=radio]{min-width:22px;min-height:22px}
}

/* Bewegung reduzieren: alles steht still (auch Wellen, Einblendungen, Ladekreis) */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
  .nx-wave i,.topbar::after{animation:none!important}
}

/* Mehr Kontrast (Geräteeinstellung) */
@media (prefers-contrast:more){
  :root{--muted:#3C4163;--border:#9DA1BC;--border-strong:#6B6F8E;--input-border:#4D5170;--focus-ring:#4A2F74;--text-soft:#1B2040}
  [data-theme="dark"]{--muted:#D2D5DA;--border:#6C7178;--border-strong:#9298A0;--input-border:#A9AEB6;--focus-ring:#E2D6F2;--text-soft:#ECEEF0}
  :focus-visible{outline-width:4px}
  .panel,.dlg,.login-box,.tbl-wrap{border-color:var(--border-strong)}
}

/* Kontrastmodus von Windows (erzwungene Farben) */
@media (forced-colors:active){
  :focus-visible{outline:3px solid Highlight}
  .tin,.search-in,.chip-input{border:1px solid CanvasText}
  .btn-primary,.btn-ghost,.btn-danger,.btn-mini,.icon-btn,.seg button,.tab,.folder-btn{border:1px solid ButtonText}
  .folder-btn.active,.tabbar .tab.on,.seg button.on{outline:2px solid Highlight;outline-offset:-2px}
  .tabbar .tab.on::before{background:Highlight}
  .nx-wave{display:none}
  .avatar{border:1px solid CanvasText;background-image:none}
  svg polygon[fill]{fill:CanvasText!important}
  .has-tabbar .app.side-open .sidebar{box-shadow:none!important;border:2px solid CanvasText}
  .scrim{background:Canvas}
  .dlg{border:2px solid CanvasText}
}
