/* ============================================================
   MOBILE OS SHELL (GoldenMind Mobile PWA & Responsive Mode)
   ============================================================ */
:root {
  --mob-safe-top: env(safe-area-inset-top, 0px);
  --mob-safe-bottom: env(safe-area-inset-bottom, 0px);
  --mob-safe-left: env(safe-area-inset-left, 0px);
  --mob-safe-right: env(safe-area-inset-right, 0px);
  --mob-app-height: 100dvh;
}

html.ios-standalone-full,
html.ios-standalone-full body {
  height: var(--mob-app-height, 100dvh);
  min-height: var(--mob-app-height, 100dvh);
}

html.ios-standalone-full .os-wallpaper,
html.ios-standalone-full .mobile-shell,
html.ios-standalone-full .mob-app-stage,
html.ios-standalone-full .mob-switcher-overlay,
html.ios-standalone-full .boot-screen,
html.ios-standalone-full .lock-screen,
html.ios-standalone-full .login-screen,
html.ios-standalone-full .lockoff-screen {
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  height: var(--mob-app-height, 100dvh);
}

.mobile-shell,
.mobile-shell *,
.os-context-menu,
.os-context-menu *,
.group-folder-card,
.group-folder-card * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.mobile-shell input,
.mobile-shell textarea,
.group-folder-card input,
.group-folder-card textarea,
.mob-sheet-content pre,
.mob-sheet-content code {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.mobile-shell {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  padding-top: 0;
  padding-bottom: 0;
}

@media (max-width: 768px) {
  .desktop-shell {
    display: none !important;
  }
  .mobile-shell:not(.hidden) {
    display: flex;
  }
  .start-menu,
  .taskbar {
    display: none !important;
  }
}

body.force-mobile-mode .desktop-shell {
  display: none !important;
}
body.force-mobile-mode .mobile-shell:not(.hidden) {
  display: flex;
}
body.force-mobile-mode #btnMobDesktopMode {
  display: inline-flex !important;
}

.mobile-statusbar {
  min-height: calc(50px + var(--mob-safe-top));
  height: auto;
  padding: var(--mob-safe-top) calc(14px + var(--mob-safe-right)) 0 calc(14px + var(--mob-safe-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}

body.theme-dark .mobile-statusbar,
body[data-wp-tone="dark"] .mobile-statusbar {
  background: rgba(12, 20, 38, 0.48);
  border-bottom-color: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
}

.mob-status-left,
.mob-status-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mob-logo-mini {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #fff;
  padding: 2px;
}

.mob-time {
  font-size: 14px;
  font-weight: 700;
}

.mob-pill-btn {
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.45);
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.14s ease;
}

.mob-pill-btn:active { transform: scale(0.95); }

body.theme-dark .mob-pill-btn,
body[data-wp-tone="dark"] .mob-pill-btn {
  background: rgba(30, 41, 59, 0.68);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f8fafc;
}

.mob-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(135deg, #15803d, #0f5e2c);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mob-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mob-home-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mob-ptr-indicator {
  height: 0;
  margin-top: -14px;
  overflow: hidden;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  pointer-events: none;
  transition: height 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, margin-top 0.22s ease;
}

.mob-ptr-indicator.is-dragging {
  transition: none;
}

.mob-ptr-indicator.is-refreshing {
  height: 52px;
  margin-top: 0;
  opacity: 1;
}

.mob-ptr-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

body.theme-dark .mob-ptr-pill,
body[data-wp-tone="dark"] .mob-ptr-pill {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}

.mob-ptr-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: transform 0.18s ease;
}

.mob-ptr-indicator.is-ready .mob-ptr-icon {
  transform: rotate(180deg);
}

.mob-ptr-indicator.is-refreshing .mob-ptr-icon {
  animation: mobPtrSpin 0.8s linear infinite;
}

@keyframes mobPtrSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.mob-hero-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--acrylic-bg);
  backdrop-filter: blur(22px);
  border: 1px solid var(--acrylic-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.mob-hero-card > div {
  min-width: 0;
  flex: 1;
}

.mob-greeting { font-size: 15px; font-weight: 700; }
.mob-sub { font-size: 12px; color: var(--text-secondary); }

.mob-install-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mob-search-wrap {
  position: relative;
  height: 48px;
  min-height: 48px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(26px) saturate(185%);
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, background 0.2s ease, border-color 0.2s ease;
  cursor: text;
}

.mob-search-wrap:focus-within {
  transform: translateY(-1.5px);
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14), 0 0 0 3px rgba(0, 103, 192, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.mob-search-ico {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 103, 192, 0.1);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
}

.mob-search-wrap:focus-within .mob-search-ico {
  background: var(--accent);
  color: #ffffff;
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(0, 103, 192, 0.34);
}

.mob-search-wrap svg {
  flex-shrink: 0;
}

.mob-search-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.mob-search-wrap input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.mob-search-wrap input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.mob-search-count {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 103, 192, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.mob-search-clear {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease, color 0.16s ease;
}

.mob-search-clear:active {
  transform: scale(0.9);
  background: rgba(15, 23, 42, 0.16);
}

body.theme-dark .mob-search-wrap {
  background: rgba(15, 23, 42, 0.68);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.theme-dark .mob-search-wrap:focus-within {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(96, 165, 250, 0.85);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(59, 130, 246, 0.28);
}

body.theme-dark .mob-search-ico {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

body.theme-dark .mob-search-count {
  background: rgba(59, 130, 246, 0.22);
  color: #bfdbfe;
}

body.theme-dark .mob-search-clear {
  background: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}

.mob-search-empty {
  grid-column: 1 / -1;
  padding: 22px 16px;
  border-radius: 18px;
  background: var(--acrylic-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--acrylic-border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

@media (min-width: 600px) {
  .mob-search-wrap {
    height: 52px;
    min-height: 52px;
    padding: 0 10px;
  }
  .mob-search-ico {
    width: 36px;
    height: 36px;
  }
}

.mob-edit-banner {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 103, 192, 0.14);
  border: 1px solid rgba(0, 103, 192, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
  flex-shrink: 0;
  font-size: 12px;
}

.mob-edit-banner > span {
  flex: 1 1 150px;
  min-width: 0;
  line-height: 1.35;
}

.mob-done-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mob-apps-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 10px;
  flex-shrink: 0;
}

.mob-apps-grid.is-edit-mode {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mob-app-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 6px 4px;
  border-radius: 16px;
  cursor: pointer;
  min-width: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, opacity 0.15s ease;
}

.mob-apps-grid.is-edit-mode .mob-app-item {
  padding: 10px 6px;
  border-radius: 14px;
  background: var(--acrylic-bg);
  backdrop-filter: blur(18px);
  border: 1px solid var(--acrylic-border);
  touch-action: none;
}

.mob-app-item.is-drag-armed {
  transform: scale(1.04);
  z-index: 5;
}

.mob-app-item.is-selected {
  background: rgba(255, 255, 255, 0.34);
  box-shadow: 0 0 0 2px var(--accent), 0 8px 20px rgba(0, 103, 192, 0.22);
}

body.theme-dark .mob-app-item.is-selected,
body[data-wp-tone="dark"] .mob-app-item.is-selected {
  background: rgba(30, 41, 59, 0.56);
}

.mob-app-item.is-drag-armed .app-icon-box,
.desktop-icon-item.is-drag-armed .app-icon-box,
.group-folder-tile.is-drag-armed .app-icon-box {
  transform: scale(1.08);
  box-shadow: 0 12px 28px rgba(0, 103, 192, 0.35), 0 0 0 3px rgba(76, 194, 255, 0.78);
}

.mob-app-item.is-dragging-source {
  opacity: 0.26;
  transform: scale(0.92);
}

.mob-app-item.is-drop-before::before,
.mob-app-item.is-drop-after::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(0, 103, 192, 0.65);
  z-index: 4;
}
.mob-app-item.is-drop-before::before { left: -5px; }
.mob-app-item.is-drop-after::after { right: -5px; }

.mob-app-item.is-drop-merge {
  transform: scale(1.08);
  background: rgba(0, 103, 192, 0.22);
  box-shadow: 0 0 0 2.5px var(--accent), 0 10px 24px rgba(0, 103, 192, 0.28);
}

.mob-drag-ghost {
  position: fixed;
  z-index: 9950;
  pointer-events: none;
  transform: translate(-50%, -62%) scale(1.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  filter: drop-shadow(0 18px 34px rgba(8, 16, 36, 0.36));
}

.mob-drag-ghost .app-icon-box {
  width: 72px;
  height: 72px;
  border-radius: 19px;
}

.mob-drag-badge {
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

.group-folder-tile {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.group-folder-tile.is-selected {
  background: rgba(0, 103, 192, 0.14);
  box-shadow: 0 0 0 2px var(--accent);
}

.group-folder-tile.is-drop-reorder {
  transform: scale(1.07);
  background: rgba(0, 103, 192, 0.18);
  box-shadow: 0 0 0 2px var(--accent);
}

body.is-mob-dragging,
body.is-mob-dragging * {
  user-select: none !important;
  -webkit-user-select: none !important;
  touch-action: none !important;
}

.mob-app-item:active .app-icon-box,
.mob-dock-btn:active .app-icon-box {
  transform: scale(0.92);
}

.mob-app-item .app-icon-box {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.mob-app-item .app-icon-box svg,
.mob-dock-btn .app-icon-box svg {
  width: 54%;
  height: 54%;
}

body[data-icon-size="small"] .mob-app-item .app-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 15px;
}

body[data-icon-size="large"] .mob-app-item .app-icon-box {
  width: 74px;
  height: 74px;
  border-radius: 20px;
}

.mob-apps-grid.is-edit-mode .mob-app-item .app-icon-box.is-image-icon {
  filter: none;
  -webkit-filter: none;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.16);
}

.mob-app-name {
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  padding-bottom: 2px;
  color: #0b162a;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

body.theme-dark .mob-app-name,
body[data-wp-tone="dark"] .mob-app-name {
  color: #f8fafc;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.88), 0 0 8px rgba(0, 0, 0, 0.55);
}

.mob-edit-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: 100%;
  margin-top: 2px;
}

.mob-mini-btn {
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--card-border);
  background: var(--acrylic-strong);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mob-mini-btn.is-active { color: #f59e0b; border-color: rgba(245, 158, 11, 0.4); }
.mob-mini-btn.is-muted { opacity: 0.65; }

.mob-dock-wrap {
  padding: 6px 14px max(12px, calc(var(--mob-safe-bottom) - 10px));
  flex-shrink: 0;
}

.mob-dock {
  height: 74px;
  padding: 0 12px;
  border-radius: 22px;
  background: var(--acrylic-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--acrylic-border);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 6px;
  overflow: hidden;
  isolation: isolate;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.mob-dock-btn {
  position: relative;
  border: none;
  padding: 0;
  margin: 0;
  outline: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}

.mob-dock-btn .app-icon-box,
.mob-dock-btn .app-icon-box.is-image-icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  filter: none;
  -webkit-filter: none;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.16);
}

.mob-dock-btn.is-open::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  bottom: -7px;
}

/* Mobile App Sheet */
.mob-app-stage {
  position: fixed;
  inset: 0;
  z-index: 6000;
  background: var(--window-bg);
  display: flex;
  flex-direction: column;
}

.mob-sheet {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--window-bg);
  animation: mobSheetIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.mob-sheet.mob-sheet-closing {
  animation: mobSheetOut 0.16s ease-in forwards;
}

.mob-sheet.hidden-sheet {
  display: none;
}

@keyframes mobSheetIn {
  from { opacity: 0; transform: translateY(24px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes mobSheetOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20px) scale(0.98); }
}

.mob-sheet-bar {
  min-height: calc(46px + var(--mob-safe-top));
  height: auto;
  padding: calc(var(--mob-safe-top) + 6px) calc(10px + var(--mob-safe-right)) 6px calc(10px + var(--mob-safe-left));
  background: var(--window-header);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.mob-sheet-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 700;
}

.mob-sheet-title span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mob-sheet-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mob-sheet-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.mob-sheet-btn:active { transform: scale(0.92); }
.mob-sheet-btn.mob-btn-close:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

.mob-sheet-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.mob-sheet.is-system-sheet .mob-sheet-body {
  padding-bottom: max(0px, calc(var(--mob-safe-bottom) - 10px));
}

.mob-sheet-content .win-iframe {
  display: block;
  flex: 1;
  min-height: 0;
}

/* Mobile Multitasking Switcher */
.mob-switcher-overlay {
  position: fixed;
  inset: 0;
  z-index: 6500;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  padding: calc(var(--mob-safe-top) + 16px) calc(16px + var(--mob-safe-right)) calc(var(--mob-safe-bottom) + 16px) calc(16px + var(--mob-safe-left));
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: #fff;
}

.mob-switcher-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 16px;
  flex-shrink: 0;
}

.mob-switcher-header strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mob-switcher-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mob-switcher-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--acrylic-strong);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mob-switcher-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
}

.mob-switcher-close-btn {
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mob-switcher-overlay:not(.hidden) {
  animation: mobFadeScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mobFadeScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================================
   COMPREHENSIVE MOBILE RESPONSIVE RULES (<= 768px & Force Mode)
   ============================================================ */
@media (max-width: 768px) {
  .login-screen {
    overflow-y: auto;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 14px;
    padding: calc(var(--mob-safe-top) + 20px) 14px calc(var(--mob-safe-bottom) + 82px);
  }

  .login-accounts-dock {
    position: static;
    width: 100%;
    max-width: 400px;
    max-height: 210px;
    z-index: 2;
    padding: 10px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    flex-shrink: 0;
  }

  .login-card {
    width: 100%;
    max-width: 400px;
    padding: 22px 18px 20px;
    flex-shrink: 0;
  }

  .login-avatar-ring {
    width: 82px;
    height: 82px;
    font-size: 28px;
    margin-bottom: 10px;
  }

  .login-title { font-size: 20px; }

  .login-bottom-bar {
    position: static;
    margin-top: 4px;
    justify-content: center;
    flex-wrap: wrap;
    flex-shrink: 0;
  }

  .lock-content {
    padding: max(9vh, calc(var(--mob-safe-top) + 20px)) 16px max(24px, var(--mob-safe-bottom));
  }

  .toast-stack {
    top: calc(var(--mob-safe-top) + 10px);
    left: 12px;
    right: 12px;
    max-width: none;
  }

  .os-context-menu {
    min-width: min(260px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: 75dvh;
    overflow-y: auto !important;
  }

  .ctx-item {
    min-height: 40px;
    padding: 9px 10px;
  }

  .ctx-submenu {
    position: static !important;
    min-width: 0;
    margin: 4px 0 4px 12px;
    box-shadow: none;
    background: rgba(100, 116, 139, 0.08);
    border: 1px solid var(--card-border);
  }

  .ctx-submenu::before { display: none; }
  .ctx-item-wrap:hover > .ctx-submenu { display: none; }
  .ctx-item-wrap.is-sub-open > .ctx-submenu { display: flex; }

  .sys-toolbar { padding: 10px 12px; gap: 8px; }
  .sys-toolbar-right { width: 100%; }
  .sys-content { padding: 12px; }
  .sys-card { padding: 12px; }

  .runtime-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }

  .sys-tabs {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .sys-tabs::-webkit-scrollbar { display: none; }
  .sys-tab { white-space: nowrap; flex-shrink: 0; }

  .wp-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sys-modal-backdrop,
  .win11-dialog-backdrop {
    padding: 10px;
  }

  .sys-modal {
    max-height: 92dvh;
    border-radius: 14px;
  }

  /* Responsive User Management Table -> Native Stacked Cards */
  .sys-table thead { display: none; }
  .sys-table,
  .sys-table tbody,
  .sys-table tr,
  .sys-table td {
    display: block;
    width: 100%;
  }

  .sys-table tr {
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: var(--window-bg);
  }

  .sys-table td {
    border-bottom: none;
    padding: 4px 0;
    text-align: left !important;
    white-space: normal !important;
  }

  .sys-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2px;
  }

  .sys-table td.su-actions-cell {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--card-border);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .sys-table td.su-actions-cell::before {
    display: none;
  }
}

/* Mobile Settings Shell (also active under force-mobile-mode on Desktop) */
@media (max-width: 768px) {
  .settings-shell {
    flex-direction: column !important;
  }

  .settings-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--card-border);
    padding: 8px 10px;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
  }

  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav-user { display: none; }

  .settings-nav-list {
    flex-direction: row;
    gap: 6px;
  }

  .settings-nav-btn {
    width: auto;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
  }

  .settings-nav-btn.active::before { display: none; }
  .settings-nav-btn.active { border-color: var(--accent); }

  .settings-main {
    padding: 12px;
  }
}

body.force-mobile-mode .settings-shell {
  flex-direction: column !important;
}
body.force-mobile-mode .settings-nav {
  width: 100%;
  border-right: none;
  border-bottom: 1px solid var(--card-border);
  padding: 8px 10px;
  overflow-x: auto;
}
body.force-mobile-mode .settings-nav-user { display: none; }
body.force-mobile-mode .settings-nav-list { flex-direction: row; gap: 6px; }
body.force-mobile-mode .settings-nav-btn { width: auto; white-space: nowrap; flex-shrink: 0; padding: 7px 12px; border-radius: 999px; }
body.force-mobile-mode .settings-nav-btn.active::before { display: none; }

.mob-group-create-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--window-bg);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 768px) {
  .group-folder-card {
    padding: 16px;
    border-radius: 22px;
  }
  .group-folder-grid {
    gap: 12px 10px;
  }
  .group-folder-tile .app-icon-box {
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }
  .group-tile-label {
    font-size: 12.5px;
  }
}

/* Tablet Mobile Shell (>= 540px inside 768px or force-mobile-mode) */
@media (min-width: 540px) and (max-width: 768px) {
  .mob-home-scroll {
    padding: 18px 24px 28px;
    gap: 18px;
  }
  .mob-apps-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px 16px;
  }
  .mob-app-item .app-icon-box {
    width: 80px;
    height: 80px;
    border-radius: 22px;
  }
  body[data-icon-size="small"] .mob-app-item .app-icon-box {
    width: 68px;
    height: 68px;
    border-radius: 18px;
  }
  body[data-icon-size="large"] .mob-app-item .app-icon-box {
    width: 92px;
    height: 92px;
    border-radius: 24px;
  }
  .mob-app-name {
    font-size: 14px;
    font-weight: 600;
  }
  .mob-dock {
    height: 88px;
    border-radius: 26px;
    padding: 0 18px;
  }
  .mob-dock-btn .app-icon-box,
  .mob-dock-btn .app-icon-box.is-image-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
  }
  .group-folder-card {
    width: min(480px, 100%);
    padding: 20px;
  }
  .group-folder-tile .app-icon-box {
    width: 68px;
    height: 68px;
    border-radius: 18px;
  }
  .group-tile-label {
    font-size: 13.5px;
  }
}

@media (min-width: 540px) {
  body.force-mobile-mode .mob-home-scroll { padding: 18px 24px 28px; gap: 18px; }
  body.force-mobile-mode .mob-apps-grid { gap: 24px 16px; }
  body.force-mobile-mode .mob-app-item .app-icon-box { width: 80px; height: 80px; border-radius: 22px; }
  body.force-mobile-mode[data-icon-size="small"] .mob-app-item .app-icon-box { width: 68px; height: 68px; border-radius: 18px; }
  body.force-mobile-mode[data-icon-size="large"] .mob-app-item .app-icon-box { width: 92px; height: 92px; border-radius: 24px; }
  body.force-mobile-mode .mob-app-name { font-size: 14px; }
  body.force-mobile-mode .mob-dock { height: 88px; border-radius: 26px; padding: 0 18px; }
  body.force-mobile-mode .mob-dock-btn .app-icon-box,
  body.force-mobile-mode .mob-dock-btn .app-icon-box.is-image-icon { width: 62px; height: 62px; border-radius: 18px; }
}

@media (max-width: 420px) {
  body[data-icon-size="large"] .mob-apps-grid:not(.is-edit-mode) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

body.force-mobile-mode .os-context-menu {
  min-width: min(260px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: 75dvh;
  overflow-y: auto !important;
}
body.force-mobile-mode .ctx-item { min-height: 40px; padding: 9px 10px; }
body.force-mobile-mode .ctx-submenu {
  position: static !important;
  min-width: 0;
  margin: 4px 0 4px 12px;
  box-shadow: none;
  background: rgba(100, 116, 139, 0.08);
  border: 1px solid var(--card-border);
}
body.force-mobile-mode .ctx-submenu::before { display: none; }
body.force-mobile-mode .ctx-item-wrap:hover > .ctx-submenu { display: none; }
body.force-mobile-mode .ctx-item-wrap.is-sub-open > .ctx-submenu { display: flex; }
body.force-mobile-mode .wp-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.force-mobile-mode .sys-grid-2,
body.force-mobile-mode .sys-grid-3,
body.force-mobile-mode .about-spec-grid { grid-template-columns: 1fr; }
body.force-mobile-mode .sys-table thead { display: none; }
body.force-mobile-mode .sys-table,
body.force-mobile-mode .sys-table tbody,
body.force-mobile-mode .sys-table tr,
body.force-mobile-mode .sys-table td { display: block; width: 100%; }
body.force-mobile-mode .sys-table tr { padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--card-border); border-radius: 10px; }
body.force-mobile-mode .sys-table td { border-bottom: none; padding: 4px 0; text-align: left !important; white-space: normal !important; }
body.force-mobile-mode .sys-table td.su-actions-cell { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--card-border); margin-top: 6px; padding-top: 8px; }

/* Mobile Notification Center, Bell Badge & Online URL Bar */
.mob-notif-btn {
  position: relative;
  gap: 4px;
}

.mob-notif-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mob-pill-btn.is-on {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

.mob-btn-online-bar.is-bar-visible {
  background: rgba(0, 103, 192, 0.14);
  border-color: var(--accent);
  color: var(--accent);
}

.mob-online-bar {
  padding: 6px 10px;
}

.mob-notif-overlay {
  color: var(--text-primary);
}

.mob-notif-overlay .mob-switcher-header {
  color: #fff;
}

.mob-notif-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #fff;
  flex-shrink: 0;
}

.mob-notif-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  min-width: 0;
}

.mob-notif-title-row strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mob-notif-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.mob-notif-actions::-webkit-scrollbar {
  display: none;
}

.mob-nc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.mob-notif-overlay .nc-unread-pill {
  background: rgba(59, 130, 246, 0.28);
  color: #bfdbfe;
  border: 1px solid rgba(147, 197, 253, 0.35);
}

.mob-notif-overlay .mob-nc-tabs {
  background: rgba(255, 255, 255, 0.16);
}

.mob-notif-overlay .mob-nc-tabs .nc-tab {
  color: rgba(255, 255, 255, 0.85);
}

.mob-notif-overlay .mob-nc-tabs .nc-tab.active {
  background: #fff;
  color: var(--accent);
}

.nc-mob-list .nc-card {
  padding: 11px 30px 11px 11px;
}

.nc-mob-list .nc-card-dismiss {
  opacity: 0.9;
}

.nc-mob-list .nc-card-meta {
  margin-top: 8px;
  gap: 8px 10px;
}

.nc-mob-list .nc-link-app-btn {
  margin-left: auto;
  padding: 5px 12px;
  font-size: 11.5px;
}

@media (max-width: 390px) {
  .mobile-statusbar {
    padding-left: calc(10px + var(--mob-safe-left));
    padding-right: calc(10px + var(--mob-safe-right));
  }
  .mob-status-left,
  .mob-status-right {
    gap: 5px;
  }
  .mob-pill-btn {
    height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }
  .mob-avatar-btn {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }
  .mob-sheet-bar {
    padding: calc(var(--mob-safe-top) + 6px) calc(8px + var(--mob-safe-right)) 6px calc(8px + var(--mob-safe-left));
    gap: 5px;
  }
  .mob-sheet-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
  }
  .mob-notif-overlay .mob-nc-tabs .nc-tab {
    padding: 4px 8px;
    font-size: 11px;
  }
  .mob-nc-toolbar .mob-group-create-btn {
    padding: 5px 9px;
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .mob-app-item .app-icon-box {
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }
  .mob-dock {
    padding: 0 10px;
    gap: 4px;
  }
  .mob-dock-btn .app-icon-box,
  .mob-dock-btn .app-icon-box.is-image-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }
}

@media (max-width: 768px) {
  .perm-card-head {
    flex-wrap: wrap;
    gap: 10px;
  }
  .perm-card-right {
    width: 100%;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid var(--card-border);
  }
  .perm-modal-user {
    gap: 8px;
  }
  .perm-toolbar {
    padding: 10px 12px;
  }
  .perm-modal .sys-modal-foot {
    justify-content: flex-end !important;
  }
  .perm-modal .sys-modal-foot > span {
    width: 100%;
    font-size: 11px !important;
  }
}

body.force-mobile-mode .perm-card-head {
  flex-wrap: wrap;
  gap: 10px;
}
body.force-mobile-mode .perm-card-right {
  width: 100%;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid var(--card-border);
}
body.force-mobile-mode .perm-modal .sys-modal-foot {
  justify-content: flex-end !important;
}
body.force-mobile-mode .perm-modal .sys-modal-foot > span {
  width: 100%;
  font-size: 11px !important;
}
