/* ==========================================================================
   Jubair OS — macOS Sequoia Liquid Glass system stylesheet
   --------------------------------------------------------------------------
   Static site: React 18 UMD + Babel + Tailwind, no build step.
   This file owns ALL system chrome styling: font stack, glass material,
   menu bar, dock, windows, spotlight, launchpad, control center,
   notification center, boot screen, controls, scrollbars, responsive rules.

   Namespace convention:
     .lg-*    -> Liquid Glass materials
     .jbos-*  -> Jubair OS shell chrome (menu bar, dock, overlays)
     .mac-*   -> macOS window + control primitives
   Dark mode: toggled via `body.dark` class (persisted in localStorage).
   ========================================================================== */

/* ---------- 1. Base / font / desktop ------------------------------------- */

:root {
  --jbos-menubar-h: 30px;
  --jbos-dock-icon: 48px;          /* JS may override via inline style */
  --jbos-accent: #0a84ff;
  --jbos-radius-win: 12px;
  --jbos-shadow-win: 0 20px 60px rgba(0, 0, 0, 0.35);
  --jbos-shadow-win-inactive: 0 8px 28px rgba(0, 0, 0, 0.22);
  --jbos-brightness: 1;            /* 0.4–1, set by shell JS */
  --jbos-font: -apple-system, BlinkMacSystemFont, 'SF Pro', Inter, 'Segoe UI', sans-serif;
}

* { -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', Inter, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: #000 url('../background.webp') center / cover no-repeat fixed;
  color: #111;
  user-select: none;
  -webkit-user-select: none;
}

body.dark { color: #f5f5f7; }

/* Desktop layer (wallpaper + brightness dimmer hook for JS) */
.jbos-desktop {
  position: fixed;
  inset: 0;
  background: transparent center / cover no-repeat;
  overflow: hidden;
}
/* Brightness overlay driven by --jbos-brightness via JS opacity fallback */
.jbos-brightness-dim {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
.jbos-window-layer { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.jbos-window-layer > * { pointer-events: auto; }

/* Allow selectable text inside window bodies, terminal, inputs */
.mac-window-body, .mac-window-body *, input, textarea, [contenteditable] {
  user-select: text;
  -webkit-user-select: text;
}

/* ---------- 2. Liquid Glass material ------------------------------------- */

.lg-glass {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

body.dark .lg-glass {
  background: rgba(30, 30, 32, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Stronger glass for popovers / menus */
.lg-glass-strong {
  background: rgba(246, 246, 248, 0.78);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
body.dark .lg-glass-strong {
  background: rgba(36, 36, 38, 0.78);
  border-color: rgba(255, 255, 255, 0.14);
}

/* Subtle glass for dock / tooltips */
.lg-glass-subtle {
  background: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.35);
}
body.dark .lg-glass-subtle {
  background: rgba(28, 28, 30, 0.55);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ---------- 3. Menu bar (30px fixed top) ---------------------------------- */

.jbos-menubar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--jbos-menubar-h);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 14px;
  font-size: 13px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  color: #111;
}
body.dark .jbos-menubar {
  background: rgba(20, 20, 22, 0.55);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
}
.jbos-menubar-left, .jbos-menubar-right { display: flex; align-items: center; gap: 2px; min-width: 0; }
.jbos-menubar-right { gap: 4px; }

.jbos-logo {
  font-weight: 800;
  font-size: 15px;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  margin-right: 2px;
}
.jbos-osname { font-weight: 700; white-space: nowrap; }
.jbos-appname { font-weight: 600; opacity: 0.9; white-space: nowrap; }

.jbos-menu-item {
  padding: 4px 9px;
  border-radius: 5px;
  cursor: default;
  white-space: nowrap;
  font-size: 13px;
}
.jbos-menu-item:hover, .jbos-menu-item.open { background: rgba(0, 0, 0, 0.08); }
body.dark .jbos-menu-item:hover, body.dark .jbos-menu-item.open { background: rgba(255, 255, 255, 0.14); }
.jbos-menu-item.bold { font-weight: 700; }

.jbos-status-icons { display: flex; align-items: center; gap: 2px; }
.jbos-status-icon {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 24px;
  padding: 0 4px;
  border-radius: 5px;
  font-size: 13px;
  cursor: default;
}
.jbos-status-icon:hover { background: rgba(0, 0, 0, 0.08); }
body.dark .jbos-status-icon:hover { background: rgba(255, 255, 255, 0.14); }
.jbos-status-icon svg { width: 15px; height: 15px; display: block; }
#jbos-clock { font-size: 13px; font-weight: 500; padding: 4px 6px 4px 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.jbos-battery { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
.jbos-battery.offline, .jbos-wifi.offline { opacity: 0.45; }

/* Dropdown menus */
.jbos-dropdown {
  position: fixed;
  top: var(--jbos-menubar-h);
  min-width: 220px;
  max-width: 300px;
  border-radius: 10px;
  padding: 5px;
  z-index: 9500;
  font-size: 13px;
}
.jbos-dropdown-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: default;
  white-space: nowrap;
}
.jbos-dropdown-item:hover:not(.disabled) { background: var(--jbos-accent); color: #fff; }
.jbos-dropdown-item.disabled { opacity: 0.4; }
.jbos-dropdown-sep { height: 1px; margin: 5px 8px; background: rgba(128, 128, 128, 0.35); }
.jbos-dropdown-shortcut { opacity: 0.55; font-size: 12px; }
.jbos-dropdown-item:hover:not(.disabled) .jbos-dropdown-shortcut { opacity: 0.85; }

/* ---------- 4. Dock -------------------------------------------------------- */

.jbos-dock-wrap {
  position: fixed;
  bottom: 10px; left: 0; right: 0;
  display: flex; justify-content: center;
  z-index: 8000;
  pointer-events: none;
}
.jbos-dock {
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 22px; /* rounded-2xl+ */
}
.jbos-dock-icon {
  position: relative;
  width: var(--jbos-dock-icon);
  height: var(--jbos-dock-icon);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--jbos-dock-icon) * 0.62);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease, margin 0.15s ease;
  transform-origin: bottom center;
}
body.dark .jbos-dock-icon { background: rgba(50, 50, 54, 0.6); border-color: rgba(255, 255, 255, 0.12); }
.jbos-dock-icon:hover, .jbos-dock-icon.magnify { transform: scale(1.35) translateY(-6px); }
.jbos-dock-icon.magnify-near { transform: scale(1.15) translateY(-3px); }
.jbos-dock-icon img { width: 78%; height: 78%; object-fit: contain; pointer-events: none; }
.jbos-dock-icon:active { transform: scale(1.05); }

/* Running indicator dot */
.jbos-dock-dot {
  position: absolute;
  bottom: -7px; left: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #333;
  transform: translateX(-50%);
}
body.dark .jbos-dock-dot { background: #e5e5e5; }

/* Tooltip above icon */
.jbos-dock-tooltip {
  position: absolute;
  bottom: calc(100% + 12px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.jbos-dock-icon:hover .jbos-dock-tooltip { opacity: 1; transform: translateX(-50%) translateY(0); }
.jbos-dock-tooltip::after {
  content: '';
  position: absolute; top: 100%; left: 50%;
  border: 5px solid transparent;
  border-top-color: rgba(60, 60, 62, 0.85);
  transform: translateX(-50%);
}

/* Dock separator + Trash */
.jbos-dock-sep { width: 1px; align-self: stretch; margin: 4px 3px; background: rgba(128, 128, 128, 0.4); }
.jbos-dock-trash.bounce { animation: jbos-trash-bounce 0.5s ease; }
@keyframes jbos-trash-bounce { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* Dock right-click context menu */
.jbos-ctxmenu {
  position: fixed;
  z-index: 9600;
  min-width: 180px;
  border-radius: 10px;
  padding: 5px;
  font-size: 13px;
}
.jbos-ctxmenu-item { padding: 5px 10px; border-radius: 6px; cursor: default; display: flex; justify-content: space-between; gap: 12px; }
.jbos-ctxmenu-item:hover:not(.disabled) { background: var(--jbos-accent); color: #fff; }
.jbos-ctxmenu-item.disabled { opacity: 0.4; }

/* ---------- 5. Windows ------------------------------------------------------ */

.mac-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  background: rgba(242, 242, 245, 0.82);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  min-width: 280px;
  min-height: 180px;
  transition: box-shadow 0.15s ease, opacity 0.18s ease, transform 0.18s ease;
}
body.dark .mac-window {
  background: rgba(32, 32, 34, 0.82);
  border-color: rgba(255, 255, 255, 0.12);
}
.mac-window.inactive { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22); }
.mac-window.focused { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); outline: 1px solid rgba(255, 255, 255, 0.15); }
.mac-window.minimizing { opacity: 0; transform: scale(0.6) translateY(120px); pointer-events: none; }
.mac-window.opening { animation: jbos-win-open 0.18s ease; }
@keyframes jbos-win-open { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
.mac-window.maximized { border-radius: 0 !important; border-left: none; border-right: none; }

/* Titlebar */
.mac-titlebar {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  flex: 0 0 40px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  cursor: default;
}
body.dark .mac-titlebar { background: rgba(255, 255, 255, 0.05); border-bottom-color: rgba(255, 255, 255, 0.09); }
.mac-traffic { display: flex; gap: 8px; align-items: center; z-index: 2; }
.mac-light { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.12); padding: 0; cursor: pointer; }
.mac-light.close { background: #FF5F57; }
.mac-light.min { background: #FFBD2E; }
.mac-light.max { background: #28CA42; }
.mac-light:hover { filter: brightness(0.88); }
.mac-title {
  position: absolute; left: 0; right: 0;
  text-align: center;
  font-size: 13px; font-weight: 600;
  pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 90px;
}
.mac-toolbar { margin-left: auto; display: flex; gap: 6px; align-items: center; z-index: 2; }

/* Window body */
.mac-window-body { flex: 1; overflow: auto; font-size: 13px; }

/* Resize handle */
.mac-resize {
  position: absolute;
  right: 0; bottom: 0;
  width: 18px; height: 18px;
  cursor: nwse-resize;
  z-index: 5;
}
.mac-resize::after {
  content: '';
  position: absolute; right: 4px; bottom: 4px;
  width: 9px; height: 9px;
  border-right: 2px solid rgba(128, 128, 128, 0.7);
  border-bottom: 2px solid rgba(128, 128, 128, 0.7);
  border-bottom-right-radius: 6px;
}

/* ---------- 6. Spotlight ----------------------------------------------------- */

.jbos-spotlight-backdrop { position: fixed; inset: 0; z-index: 9400; background: transparent; }
.jbos-spotlight {
  position: fixed;
  top: 20%; left: 50%;
  transform: translateX(-50%);
  width: min(620px, calc(100vw - 32px));
  z-index: 9450;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}
.jbos-spotlight-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.jbos-spotlight-bar svg, .jbos-spotlight-icon { width: 20px; height: 20px; opacity: 0.6; flex: 0 0 20px; }
.jbos-spotlight-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 18px; color: inherit; font-family: inherit;
}
.jbos-spotlight-input::placeholder { opacity: 0.5; }
.jbos-spotlight-results { max-height: 320px; overflow-y: auto; padding: 6px; border-top: 1px solid rgba(128, 128, 128, 0.25); }
.jbos-spotlight-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 8px; cursor: default; font-size: 13px;
}
.jbos-spotlight-row.selected, .jbos-spotlight-row:hover { background: var(--jbos-accent); color: #fff; }
.jbos-spotlight-row .app-icon { font-size: 24px; width: 30px; text-align: center; }
.jbos-spotlight-kind { margin-left: auto; font-size: 11px; opacity: 0.6; }
.jbos-spotlight-empty { padding: 18px; text-align: center; font-size: 13px; opacity: 0.6; }

/* ---------- 7. Launchpad ------------------------------------------------------ */

.jbos-launchpad {
  position: fixed; inset: 0; z-index: 9300;
  display: flex; flex-direction: column; align-items: center;
  padding: 70px 24px 30px;
  background: rgba(20, 20, 24, 0.45);
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
  animation: jbos-fade-in 0.2s ease;
}
@keyframes jbos-fade-in { from { opacity: 0; } to { opacity: 1; } }
.jbos-launchpad-search {
  width: min(320px, 80vw);
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.25);
  color: #fff; font-size: 14px; font-family: inherit;
  outline: none; text-align: center; margin-bottom: 30px;
}
.jbos-launchpad-search::placeholder { color: rgba(255, 255, 255, 0.7); }
.jbos-launchpad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 26px 14px;
  width: min(860px, 100%);
  max-height: 60vh;
  overflow-y: auto;
  justify-items: center;
}
.jbos-lp-app { display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; width: 96px; }
.jbos-lp-icon {
  width: 62px; height: 62px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center; font-size: 32px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease;
}
.jbos-lp-app:hover .jbos-lp-icon { transform: scale(1.08); }
.jbos-lp-name { color: #fff; font-size: 12px; text-shadow: 0 1px 4px rgba(0,0,0,0.6); text-align: center; }
.jbos-lp-dots { display: flex; gap: 8px; margin-top: 22px; }
.jbos-lp-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; }
.jbos-lp-dot.active { background: #fff; }

/* ---------- 8. Control Center -------------------------------------------------- */

.jbos-cc {
  position: fixed;
  top: calc(var(--jbos-menubar-h) + 8px); right: 10px;
  width: 320px; max-width: calc(100vw - 20px);
  z-index: 9460;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  animation: jbos-slide-left 0.18s ease;
}
@keyframes jbos-slide-left { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.jbos-cc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jbos-cc-card { border-radius: 12px; padding: 10px; background: rgba(128, 128, 128, 0.18); }
body.dark .jbos-cc-card { background: rgba(255, 255, 255, 0.07); }
.jbos-cc-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 9px; cursor: pointer; font-size: 12px;
}
.jbos-cc-toggle:hover { background: rgba(128, 128, 128, 0.2); }
.jbos-cc-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; background: rgba(128,128,128,0.4); flex: 0 0 28px; }
.jbos-cc-toggle.on .jbos-cc-dot { background: var(--jbos-accent); color: #fff; }
.jbos-cc-label { font-weight: 600; display: block; }
.jbos-cc-sub { opacity: 0.6; font-size: 11px; display: block; }
.jbos-cc-slider-row { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(128,128,128,0.18); }
.jbos-cc-slider-row label { font-size: 12px; font-weight: 600; display: block; margin-bottom: 6px; }

/* ---------- 9. Notification Center --------------------------------------------- */

.jbos-nc {
  position: fixed;
  top: var(--jbos-menubar-h); right: 0; bottom: 0;
  width: 360px; max-width: calc(100vw - 16px);
  z-index: 9470;
  padding: 16px 12px;
  overflow-y: auto;
  border-radius: 0;
  border-top: none; border-right: none; border-bottom: none;
  animation: jbos-slide-left 0.2s ease;
  font-size: 13px;
}
.jbos-nc-date { font-size: 18px; font-weight: 700; margin: 4px 6px 12px; }
.jbos-nc-widget { border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.jbos-nc-widget h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.6; }
.jbos-nc-item { border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.jbos-nc-item h5 { margin: 0 0 3px; font-size: 13px; }
.jbos-nc-item p { margin: 0; font-size: 12px; opacity: 0.8; }
.jbos-nc-item time { font-size: 11px; opacity: 0.55; }
.jbos-nc-clear { display: block; margin: 4px auto 12px; font-size: 12px; }

/* Toast notifications (bottom-right stack, above dock) */
.jbos-toasts { position: fixed; right: 12px; bottom: 84px; z-index: 9480; display: flex; flex-direction: column; gap: 8px; width: 330px; max-width: calc(100vw - 24px); }
.jbos-toast { border-radius: 14px; padding: 11px 13px; box-shadow: 0 14px 40px rgba(0,0,0,0.3); animation: jbos-slide-left 0.2s ease; cursor: pointer; }
.jbos-toast h5 { margin: 0 0 2px; font-size: 13px; }
.jbos-toast p { margin: 0; font-size: 12px; opacity: 0.85; }
.jbos-toast.out { opacity: 0; transform: translateX(30px); transition: all 0.25s ease; }

/* ---------- 10. Boot screen ----------------------------------------------------- */

.jbos-boot {
  position: fixed; inset: 0; z-index: 9999;
  background: #000; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', Inter, 'Segoe UI', sans-serif;
  transition: opacity 0.5s ease;
}
.jbos-boot.done { opacity: 0; pointer-events: none; }
.jbos-boot-logo {
  width: 84px; height: 84px;
  border-radius: 22px;
  background: #fff; color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 52px; font-weight: 800;
}
.jbos-boot-name { font-size: 22px; font-weight: 600; letter-spacing: 0.01em; }
.jbos-boot-bar { width: 220px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.22); overflow: hidden; }
.jbos-boot-fill { height: 100%; width: 0%; border-radius: 3px; background: #fff; transition: width 0.2s linear; }

/* ---------- 11. macOS controls --------------------------------------------------- */

.mac-btn {
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 7px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: linear-gradient(to bottom, #ffffff, #e9e9ec);
  color: #111;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.mac-btn:hover { filter: brightness(0.97); }
.mac-btn:active { background: linear-gradient(to bottom, #dcdce0, #cfcfd4); }
.mac-btn.primary { background: var(--jbos-accent); border-color: rgba(0,0,0,0.15); color: #fff; }
.mac-btn.primary:active { filter: brightness(0.9); }
.mac-btn.destructive { color: #ff3b30; }
body.dark .mac-btn { background: linear-gradient(to bottom, #4a4a4e, #3a3a3e); color: #f5f5f7; border-color: rgba(255,255,255,0.14); }
body.dark .mac-btn.primary { background: #0a84ff; }

.mac-input, .mac-select, .mac-textarea {
  font-family: inherit;
  font-size: 13px;
  color: inherit;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 7px;
  padding: 6px 9px;
  outline: none;
}
body.dark .mac-input, body.dark .mac-select, body.dark .mac-textarea { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.16); }
.mac-input:focus, .mac-select:focus, .mac-textarea:focus { border-color: var(--jbos-accent); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25); }

/* macOS-like range sliders */
input[type='range'].mac-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
}
input[type='range'].mac-slider::-webkit-slider-runnable-track {
  height: 5px; border-radius: 3px;
  background: rgba(128, 128, 128, 0.45);
}
input[type='range'].mac-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  margin-top: -7.5px;
}
input[type='range'].mac-slider::-moz-range-track { height: 5px; border-radius: 3px; background: rgba(128,128,128,0.45); }
input[type='range'].mac-slider::-moz-range-thumb {
  width: 19px; height: 19px; border-radius: 50%;
  background: #fff; border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* Toggle switch */
.mac-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 42px; }
.mac-switch input { opacity: 0; width: 0; height: 0; }
.mac-switch-track {
  position: absolute; inset: 0; border-radius: 12px;
  background: rgba(128, 128, 128, 0.5);
  transition: background 0.15s ease;
}
.mac-switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  transition: transform 0.15s ease;
}
.mac-switch input:checked + .mac-switch-track { background: #34c759; }
.mac-switch input:checked + .mac-switch-track::after { transform: translateX(18px); }

/* ---------- 12. Scrollbars -------------------------------------------------------- */

.mac-window-body::-webkit-scrollbar,
.jbos-spotlight-results::-webkit-scrollbar,
.jbos-nc::-webkit-scrollbar,
.jbos-launchpad-grid::-webkit-scrollbar { width: 8px; height: 8px; }
.mac-window-body::-webkit-scrollbar-thumb,
.jbos-spotlight-results::-webkit-scrollbar-thumb,
.jbos-nc::-webkit-scrollbar-thumb,
.jbos-launchpad-grid::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.5);
  border-radius: 4px;
}
.mac-window-body::-webkit-scrollbar-track,
.jbos-spotlight-results::-webkit-scrollbar-track,
.jbos-nc::-webkit-scrollbar-track,
.jbos-launchpad-grid::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(128,128,128,0.55) transparent; }

/* ---------- 13. Accessibility: reduced motion -------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .jbos-boot { transition: none; }
  .jbos-dock-icon:hover, .jbos-dock-icon.magnify { transform: none; }
}

/* ---------- 14. Mobile responsive (< 768px) ---------------------------------------- */

@media (max-width: 767px) {
  /* Windows go fullscreen (below menubar) */
  .mac-window {
    top: var(--jbos-menubar-h) !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100dvh - var(--jbos-menubar-h)) !important;
    border-radius: 0 !important;
  }
  .mac-resize { display: none; }
  .mac-title { padding: 0 80px; }

  /* Compact dock: smaller icons, scrollable */
  :root { --jbos-dock-icon: 40px; }
  .jbos-dock {
    max-width: calc(100vw - 16px);
    overflow-x: auto;
    border-radius: 18px;
  }
  .jbos-dock-icon:hover, .jbos-dock-icon.magnify, .jbos-dock-icon.magnify-near { transform: scale(1.1); }

  /* Hide verbose menus, keep clock + key icons */
  .jbos-menubar { font-size: 12px; padding: 0 8px 0 10px; }
  .jbos-menu-item.hide-mobile, .jbos-appname.hide-mobile { display: none; }
  .jbos-status-icon.hide-mobile { display: none; }

  /* Panels become full-width sheets */
  .jbos-cc, .jbos-nc { width: calc(100vw - 16px); right: 8px; }
  .jbos-spotlight { top: 12%; }
  .jbos-toasts { bottom: 76px; }
  .jbos-launchpad { padding-top: 56px; }
}
