/* RealDodos OS Mobil – Handy-Oberfläche (nutzt Variablen und Apps aus os.css / apps.js) */
.rdm { --sb: max(env(safe-area-inset-top), 30px); --hb: max(env(safe-area-inset-bottom), 22px); --ic: 62px; }
.rdm body { touch-action: manipulation; overscroll-behavior: none; }
/* Desktop-Bedienelemente ausblenden */
.rdm #boot, .rdm #lock, .rdm #taskbar, .rdm #startMenu, .rdm #calPanel, .rdm #notifPanel, .rdm #icons, .rdm #snapPreview, .rdm .stickies, .rdm .sticky { display: none !important; }
.rdm #desktop { position: fixed; inset: 0; background: transparent !important; pointer-events: none; z-index: 40; display: block !important; }
.rdm #windows { position: absolute; inset: 0; pointer-events: none; }

/* Apps im Vollbild */
.rdm .win { pointer-events: auto; position: fixed !important; left: 0 !important; top: 0 !important; width: 100vw !important; height: 100% !important;
  border-radius: 0 !important; border: 0 !important; box-shadow: none !important; padding-top: var(--sb); padding-bottom: var(--hb); background: var(--win);
  animation: mAppIn .22s cubic-bezier(.2, .8, .2, 1); transition: none; }
.rdm .win.closing { animation: mAppOut .18s ease-in forwards; }
.rdm .win .rz { display: none !important; }
.rdm .win-head { height: 46px; cursor: default; padding: 0 6px 0 12px; }
.rdm .win-head .win-title { font-weight: 600; font-size: 15px; }
.rdm .win-ctl button:not(.x) { display: none; }
.rdm .win-ctl button.x { width: 44px; height: 40px; border-radius: 10px; font-size: 18px; }
.rdm .win-body { height: calc(100% - 46px); }
.rdm .win.inactive { filter: none; }
@keyframes mAppIn { from { opacity: 0; transform: scale(.88) translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes mAppOut { to { opacity: 0; transform: scale(.85) translateY(40px); } }
.rdm .webbar { flex-wrap: nowrap; overflow-x: auto; }
.rdm .toasts { top: calc(var(--sb) + 8px); bottom: auto; left: 10px; right: 10px; align-items: center; z-index: 9800; }
.rdm .toast { width: min(420px, 100%); border-radius: 18px; }
.rdm .ctx { min-width: 230px; border-radius: 14px; }
.rdm .ctx button { padding: 11px 12px; font-size: 15px; }
.rdm .dlg-back { position: fixed !important; z-index: 9700 !important; }

/* Grundgerüst */
/* .m bewusst ohne eigenen Stapelkontext: Apps (#desktop, z 40) liegen über dem Homescreen, Statusleiste/Home-Leiste/Panels darüber */
.m { position: absolute; inset: 0; background: var(--wall, #0b0f1c); background-size: cover; color: #fff; overflow: hidden; }
.m-dim { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 9990; transition: opacity .2s; }
.m :where(button) { border: 0; background: none; color: inherit; font: inherit; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* Statusleiste */
.m-status { position: fixed; top: 0; left: 0; right: 0; height: var(--sb); padding: 0 18px; padding-top: max(env(safe-area-inset-top) - 20px, 0px);
  display: flex; align-items: center; justify-content: space-between; z-index: 9000; font-weight: 600; font-size: 14px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); pointer-events: none; }
.m-status button { pointer-events: auto; height: 100%; display: flex; align-items: center; gap: 6px; min-width: 80px; }
.m-st-r { justify-content: flex-end; }
.rdm.app-open .m-status { color: var(--text); text-shadow: none; background: var(--win); }
.m-island { width: 0; }
.m-bat { position: relative; width: 26px; height: 12px; border: 1.5px solid currentColor; border-radius: 4px; display: inline-block; opacity: .95; }
.m-bat:after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; background: currentColor; border-radius: 0 2px 2px 0; }
.m-bat i { position: absolute; left: 1px; top: 1px; bottom: 1px; width: 70%; background: currentColor; border-radius: 2px; }
.m-bat.low i { background: #ff5a5f; }
.m-bat.charge i { background: #3ddc84; }
.m-bat b { display: none; }
.m-bat.none { display: none; }

/* Homescreen */
.m-home { position: absolute; inset: 0; padding-top: var(--sb); display: flex; flex-direction: column; }
.m-pages { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.m-pages::-webkit-scrollbar { display: none; }
.m-pages { touch-action: pan-x; }
.m-page { flex: 0 0 100%; scroll-snap-align: start; padding: 14px 18px 8px; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: max-content; gap: 18px 8px; align-content: start; }
.m-widget { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 4px; }
.m-w { border-radius: 22px; padding: 14px 16px; background: rgba(255, 255, 255, .14); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); min-height: 128px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); text-align: left; }
.m-w small { opacity: .8; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.m-w .big { font-size: 40px; font-weight: 300; line-height: 1; }
.m-w .t { font-size: 15px; font-weight: 600; line-height: 1.3; }
.m-w.wide { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; gap: 12px; }
.m-ic { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; touch-action: manipulation; }
.m-ic .appicon, .m-ic .m-nat { width: var(--ic); height: var(--ic); border-radius: 17px; font-size: 32px; transition: transform .12s; }
.m-ic:active .appicon, .m-ic:active .m-nat { transform: scale(.9); filter: brightness(.85); }
.m-ic span { font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }
.m-ic .run { position: absolute; }
.m-nat { display: grid; place-items: center; background: #fff; overflow: hidden; box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }
.m-nat img { width: 100%; height: 100%; object-fit: cover; }
.m-dots { display: flex; justify-content: center; gap: 8px; padding: 6px 0 10px; }
.m-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .4); transition: background .2s, width .2s; }
.m-dots i.on { background: #fff; width: 18px; border-radius: 4px; }
.m-dock { margin: 0 12px calc(var(--hb) + 6px); padding: 12px 14px; border-radius: 30px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  background: rgba(255, 255, 255, .16); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); }
.m-dock .m-ic span { display: none; }
.m-libtile { grid-column: span 2; }
.m-folder { border-radius: 22px; padding: 12px; background: rgba(255, 255, 255, .14); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.m-folder b { display: block; font-size: 13px; margin-bottom: 8px; }
.m-folder .g { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.m-folder .g .appicon { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; font-size: 18px; }

/* Panels / Sheets */
.m-sheet { position: fixed; inset: 0; z-index: 9100; padding: calc(var(--sb) + 10px) 16px calc(var(--hb) + 16px); overflow-y: auto; color: #fff;
  background: rgba(10, 14, 24, .55); backdrop-filter: blur(30px) saturate(1.4); -webkit-backdrop-filter: blur(30px) saturate(1.4); animation: mSheetIn .22s ease-out; }
@keyframes mSheetIn { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: none; } }
.m-lib { animation-name: mLibIn; }
@keyframes mLibIn { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
.m-search { flex: 1; width: 100%; padding: 12px 16px; border-radius: 14px; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 16px; outline: none; }
.m-search::placeholder { color: rgba(255, 255, 255, .7); }
.m-lib-head { display: flex; gap: 10px; align-items: center; position: sticky; top: 0; z-index: 2; padding-bottom: 12px; }
.m-txtbtn { color: var(--accent) !important; font-weight: 600 !important; padding: 8px 4px !important; font-size: 15px !important; }
.m-lib-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; opacity: .75; margin: 18px 4px 10px; }
.m-lib-body .m-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 6px; }
.m-row { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 12px; width: 100%; text-align: left; }
.m-row .appicon, .m-row .m-nat { width: 40px; height: 40px; border-radius: 11px; font-size: 21px; }
.m-row small { display: block; opacity: .7; font-size: 12px; }
.m-row:active { background: rgba(255, 255, 255, .1); }
.m-empty { opacity: .75; text-align: center; padding: 30px 10px; }

.m-cc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 520px; margin: 0 auto; }
.m-tile, .m-slider-tile { border-radius: 22px; padding: 14px; background: rgba(255, 255, 255, .14); display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-height: 96px; }
.m-tile span, .m-slider-tile > span { font-size: 24px; margin-bottom: 6px; }
.m-tile b { font-size: 14px; }
.m-tile small, .m-slider-tile small { opacity: .75; font-size: 12px; }
.m-tile.on { background: var(--accent); color: #111; }
.m-slider-tile { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; gap: 12px; }
.m-slider-tile > span { margin: 0; }
.m-slider-tile input { flex: 1; accent-color: var(--accent); height: 30px; }
.m-vol div { display: flex; flex-direction: column; }
.m-grab { height: 40px; margin-top: 18px; position: relative; }
.m-grab:before { content: ""; position: absolute; left: 50%; top: 18px; width: 50px; height: 5px; margin-left: -25px; border-radius: 3px; background: rgba(255, 255, 255, .55); }

.m-nc-time { font-size: 64px; font-weight: 200; text-align: center; line-height: 1.05; margin-top: 10px; }
.m-nc-date { text-align: center; opacity: .85; margin-bottom: 20px; }
.m-nc-head { display: flex; justify-content: space-between; align-items: center; margin: 0 4px 8px; }
.m-note { display: flex; gap: 12px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, .15); margin-bottom: 8px; text-align: left; width: 100%; }
.m-note .i { font-size: 22px; }
.m-note small { display: block; opacity: .8; }
.m-note time { margin-left: auto; font-size: 11px; opacity: .7; white-space: nowrap; }

/* App-Übersicht */
.m-switch { position: fixed; inset: 0; z-index: 9200; background: rgba(0, 0, 0, .55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); display: flex; flex-direction: column; justify-content: center; padding-bottom: var(--hb); }
.m-switch-row { display: flex; gap: 16px; overflow-x: auto; padding: 20px 10vw; scroll-snap-type: x mandatory; scrollbar-width: none; }
.m-card { flex: 0 0 62vw; max-width: 300px; height: 62vh; border-radius: 24px; background: var(--win); color: var(--text); scroll-snap-align: center; position: relative; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; transition: transform .2s, opacity .2s; touch-action: pan-x; }
.m-card .appicon { width: 72px; height: 72px; font-size: 38px; border-radius: 20px; }
.m-card b { font-size: 16px; padding: 0 12px; text-align: center; }
.m-card small { color: var(--muted); padding: 0 18px; text-align: center; }
.m-card .x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: var(--hover); }
.m-switch-x { align-self: center; margin-top: 10px; }

/* Home-Leiste */
.m-homebar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--hb); z-index: 9300; display: flex; justify-content: center; align-items: center; touch-action: none; }
.m-homebar i { width: 134px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .85); box-shadow: 0 0 4px rgba(0, 0, 0, .35); transition: transform .1s; }
.rdm.app-open .m-homebar i { background: var(--text); opacity: .7; }
.m-homebar.drag i { transform: scaleX(1.15); }

/* Sperrbildschirm */
.m-lock { position: fixed; inset: 0; z-index: 9950; background: var(--wall, #0b0f1c); color: #fff; display: flex; flex-direction: column; align-items: center; padding: calc(var(--sb) + 14px) 16px calc(var(--hb) + 10px); touch-action: none; transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .35s; }
.m-lock:before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .25); z-index: -1; }
.m-lock.out { transform: translateY(-100%); opacity: .3; }
.m-lock-top { font-size: 18px; opacity: .9; }
.m-lock-time { font-size: 86px; font-weight: 200; line-height: 1; margin-top: 18px; letter-spacing: -.02em; }
.m-lock-date { font-size: 18px; opacity: .9; margin-top: 4px; }
.m-lock-notifs { width: 100%; max-width: 440px; margin-top: 28px; flex: 1; overflow: hidden; }
.m-lock-hint { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 13px; opacity: .85; animation: mHint 2.2s ease-in-out infinite; }
.m-lock-hint i { width: 134px; height: 5px; border-radius: 3px; background: #fff; }
@keyframes mHint { 50% { transform: translateY(-6px); } }

/* Im Android-Launcher zeigt das System Uhr/Akku und die Gestenleiste selbst */
.rdm-launcher #mTime, .rdm-launcher #mNet, .rdm-launcher #mBat { visibility: hidden; }
.rdm-launcher .m-homebar { pointer-events: none; }
.rdm-launcher .m-homebar i { display: none; }

/* Sparmodus: keine Unschärfe, keine Animationen */
.rdm.m-spar .m *, .rdm.m-spar .win { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; animation: none !important; transition: none !important; }
.rdm.m-spar .m-w, .rdm.m-spar .m-dock, .rdm.m-spar .m-folder { background: rgba(20, 24, 36, .82); }
.rdm.m-spar .m-sheet, .rdm.m-spar .m-switch { background: rgba(10, 14, 24, .96); }

@media (min-width: 700px) { .rdm { --ic: 70px; } .m-page { grid-template-columns: repeat(6, 1fr); } .m-dock { grid-template-columns: repeat(6, 1fr); max-width: 640px; margin-left: auto; margin-right: auto; } .m-lib-body .m-grid { grid-template-columns: repeat(6, 1fr); } }
@media (orientation: landscape) and (max-height: 500px) { .m-page { grid-template-columns: repeat(7, 1fr); gap: 8px; } .m-widget { display: none; } .rdm { --ic: 50px; } }
