/* =====================================================================
   ShadowOS — "Shadow Mobile" (Android / Material You) theme
   Activated by body.mode-android. Pure UI layer: same apps, same features.
   ===================================================================== */

.android-bar { display: none; }

body.mode-android {
  --taskbar-h: 92px;
  --radius-win: 26px;
  --radius: 20px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --font: "Roboto", "Google Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Roboto Mono", "JetBrains Mono", "Cascadia Code", monospace;

  /* Material 3 baseline (dark) */
  --accent: #d0bcff;
  --accent-2: #a8c7fa;
  --accent-text: #381e72;
  --surface: rgba(28, 27, 31, 0.86);
  --surface-solid: #1c1b1f;
  --surface-2: rgba(49, 48, 51, 0.9);
  --bg-1: #141218;
  --bg-2: #1c1b1f;
  --border: rgba(230, 225, 229, 0.12);
  --border-strong: rgba(230, 225, 229, 0.22);
  --text: #e6e1e5;
  --text-2: #cac4d0;
  --text-3: #938f99;
  --hover: rgba(208, 188, 255, 0.08);
  --active: rgba(208, 188, 255, 0.16);
  --control: rgba(230, 225, 229, 0.08);
  --control-hover: rgba(230, 225, 229, 0.16);
  --blur: blur(24px) saturate(160%);
  --shadow-win: 0 8px 28px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-fly: 0 12px 36px rgba(0, 0, 0, 0.5);
}
body.light.mode-android {
  --accent: #6750a4;
  --accent-2: #7f67be;
  --accent-text: #ffffff;
  --surface: rgba(255, 251, 254, 0.88);
  --surface-solid: #fffbfe;
  --surface-2: rgba(243, 237, 247, 0.92);
  --bg-1: #f7f2fa;
  --bg-2: #fffbfe;
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.16);
  --text: #1d1b20;
  --text-2: #49454f;
  --text-3: #79747e;
  --hover: rgba(103, 80, 164, 0.08);
  --active: rgba(103, 80, 164, 0.14);
  --control: rgba(103, 80, 164, 0.08);
  --control-hover: rgba(103, 80, 164, 0.16);
}

/* ----- status bar ----- */
body.mode-android .android-bar {
  display: flex; align-items: center; position: fixed; top: 0; left: 0; right: 0; height: 32px;
  z-index: 5100; padding: 0 12px; font-size: 13px; color: var(--text);
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
}
body.no-transparency.mode-android .android-bar { background: var(--surface-solid); }
.android-bar .ab-left { display: flex; align-items: center; gap: 8px; }
.android-bar .ab-android { width: 30px; height: 26px; border-radius: 13px; display: grid; place-items: center; color: var(--text); }
.android-bar .ab-android:hover { background: var(--hover); }
.android-bar .ab-app { font-weight: 600; font-size: 13.5px; }
.android-bar .ab-right { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.android-bar .ab-ic { height: 26px; min-width: 28px; padding: 0 6px; border-radius: 13px; display: inline-flex; align-items: center; gap: 4px; color: var(--text); position: relative; }
.android-bar .ab-ic:hover { background: var(--hover); }
.android-bar .ab-clock { font-variant-numeric: tabular-nums; font-size: 12.5px; }
.android-bar .ab-ic .dot { position: absolute; top: 3px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* content sits below the status bar */
body.mode-android .windows { top: 32px; }
body.mode-android .desktop-icons { top: 44px; }
body.mode-android .widgets { bottom: calc(var(--taskbar-h) + 8px); }

/* ----- taskbar -> Material dock + gesture bar ----- */
body.mode-android .taskbar {
  left: 50%; right: auto; transform: translateX(-50%);
  bottom: 20px; height: 72px; width: auto; max-width: calc(100vw - 20px);
  padding: 0 12px; border-radius: 36px;
  border: 1px solid var(--border);
  background: rgba(28, 27, 31, 0.7);
  backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
body.light.mode-android .taskbar { background: rgba(255, 251, 254, 0.72); }
body.no-transparency.mode-android .taskbar { background: var(--surface-solid); }
body.mode-android .taskbar::after {
  content: ""; position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%);
  width: 118px; height: 5px; border-radius: 3px; background: var(--text-3); opacity: .65;
}
body.mode-android .taskbar-left, body.mode-android .taskbar-right { display: none; }
body.mode-android .taskbar-center { justify-content: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
body.mode-android .taskbar-center::-webkit-scrollbar { display: none; }
body.mode-android .tb-btn {
  width: 54px; height: 54px; border-radius: 24%; background: var(--control);
  transition: transform .12s ease, background .12s ease, border-radius .2s ease;
}
body.mode-android .tb-btn:hover { background: var(--control-hover); transform: translateY(-2px); }
body.mode-android .tb-btn:active { transform: scale(.9); border-radius: 50%; }
body.mode-android .tb-start { background: linear-gradient(150deg, #d0bcff, #a8c7fa); color: #381e72; }
body.mode-android .tb-start svg { color: #381e72; }
body.mode-android .tb-btn.active::after,
body.mode-android .tb-btn.running::after { display: none; }
body.mode-android .tb-btn svg { width: 26px; height: 26px; }
body.mode-android .task-list { gap: 8px; margin-left: 0; }
body.mode-android .task-item {
  width: 54px; height: 54px; min-width: 54px; padding: 0; border-radius: 24%;
  justify-content: center; position: relative;
}
body.mode-android .task-item .ti-ico, body.mode-android .task-item .ti-ico svg, body.mode-android .task-item .ti-ico img { width: 32px; height: 32px; }
body.mode-android .task-item .ti-label { display: none; }
body.mode-android .task-item::after { display: none; }
body.mode-android .task-item.active { background: var(--active); box-shadow: inset 0 0 0 1px var(--border-strong); }
body.mode-android .task-item.has-win:not(.active)::before {
  content: ""; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--text-3);
}
body.mode-android .task-item.active::before {
  content: ""; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 4px; border-radius: 2px; background: var(--accent);
}

/* ----- windows: Material surfaces ----- */
body.mode-android .win { border-radius: var(--radius-win); border-color: var(--border); }
body.mode-android .w-titlebar {
  height: 52px; padding-left: 16px; gap: 12px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
body.mode-android .w-ico, body.mode-android .w-ico svg, body.mode-android .w-ico img { width: 22px; height: 22px; }
body.mode-android .w-title { font-size: 14px; font-weight: 600; }
body.mode-android .w-controls { margin-left: auto; align-items: center; gap: 6px; margin-right: 10px; height: auto; }
body.mode-android .w-btn {
  width: 34px; height: 34px; border-radius: 50%; background: transparent; color: var(--text-2);
}
body.mode-android .w-btn:hover { background: var(--hover); color: var(--text); }
body.mode-android .w-btn svg { width: 15px; height: 15px; }
body.mode-android .w-btn.close:hover { background: #ffb4ab; color: #690005; }
body.mode-android .w-maximized .w-titlebar, body.mode-android .win.maximized .w-titlebar { border-radius: 0; }

/* ----- start menu -> Android app drawer ----- */
body.mode-android .start-menu {
  left: 0; right: 0; bottom: 0; top: auto; transform: translateY(24px);
  width: 100%; max-width: none; height: min(78vh, 660px); max-height: 78vh;
  padding: 18px 20px 0; border-radius: 28px 28px 0 0;
  border-left: 0; border-right: 0; border-bottom: 0;
  background: var(--surface-solid);
}
body.light.mode-android .start-menu { background: var(--surface-solid); }
body.mode-android .start-menu:not(.hidden) { transform: translateY(0); }
body.mode-android .start-menu::before {
  content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 42px; height: 4px; border-radius: 2px; background: var(--text-3); opacity: .5;
}
body.mode-android .start-search { border-radius: 28px; padding: 11px 18px; background: var(--control); }
body.mode-android .pinned-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 10px; }
body.mode-android .pin-item { padding: 12px 4px 8px; border-radius: 16px; }
body.mode-android .pin-item:active { background: var(--active); }
body.mode-android .pin-item .i, body.mode-android .pin-item .i svg, body.mode-android .pin-item .i img { width: 54px; height: 54px; }
body.mode-android .pin-item .i { border-radius: 24%; overflow: hidden; }
body.mode-android .pin-item .n { font-size: 12px; }
body.mode-android .start-head { padding: 2px 2px 12px; }
body.mode-android .all-apps .aa-item { border-radius: 16px; }
body.mode-android .start-foot { height: 64px; margin: 0 -20px; padding: 0 30px; border-radius: 0; }
body.mode-android .icon-btn { border-radius: 50%; }
body.mode-android .icon-btn:hover { background: var(--hover); }

/* ----- desktop icons ----- */
body.mode-android .d-icon .i, body.mode-android .d-icon .i svg, body.mode-android .d-icon .i img { width: 50px; height: 50px; }
body.mode-android .d-icon .i { border-radius: 24%; }
body.mode-android .d-icon { border-radius: 16px; }
body.mode-android .d-icon:hover { background: var(--hover); }
body.mode-android .d-icon .n { text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75); }

/* ----- File Explorer (Material list) ----- */
body.mode-android .ex-side { background: transparent; border-right-color: var(--border); }
body.mode-android .ex-crumb, body.mode-android .field { border-radius: 20px; }
body.mode-android .ex-item { border-radius: 20px; padding: 9px 12px; }
body.mode-android .file { border-radius: 16px; }
body.mode-android .file.sel { background: var(--active); border-color: var(--border-strong); }
body.mode-android .ex-item.active { background: var(--active); color: var(--text); }

/* ----- flyouts: quick settings shade + notification sheet ----- */
body.mode-android .flyout { border-radius: 24px; }
body.mode-android .quick-settings {
  right: 8px; left: 8px; bottom: calc(var(--taskbar-h) + 6px); width: auto; padding: 18px 18px 20px;
  border-radius: 28px; background: var(--surface-solid);
}
body.mode-android .qs-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
body.mode-android .qs-tile {
  border-radius: 22px; padding: 14px 12px; flex-direction: row; justify-content: flex-start; gap: 10px;
  background: var(--control); border: 0; color: var(--text);
}
body.mode-android .qs-tile span { font-size: 20px; }
body.mode-android .qs-tile small { font-size: 12px; text-align: left; }
body.mode-android .qs-tile.active { background: var(--accent); color: var(--accent-text); }
body.mode-android .qs-tile.active small { color: var(--accent-text); }
body.mode-android .qs-tile:active { transform: scale(.97); }
body.mode-android .qs-sliders input[type=range]::-webkit-slider-thumb { background: var(--accent); border-color: var(--surface-solid); }

body.mode-android .notif-center {
  right: 8px; left: 8px; bottom: calc(var(--taskbar-h) + 6px); width: auto; max-height: 68vh; padding: 18px;
  border-radius: 28px; background: var(--surface-solid);
}
body.mode-android .notif { border-radius: 20px; background: var(--control); border: 0; }
body.mode-android .tray-flyout { border-radius: 24px; }
body.mode-android .toast { border-radius: 20px; }

/* ----- context menu: Material menu ----- */
body.mode-android .context-menu { border-radius: 16px; padding: 6px; }
body.mode-android .ctx-item { border-radius: 12px; padding: 10px 14px; }

/* ----- buttons, fields, cards ----- */
body.mode-android .btn { border-radius: 20px; padding: 8px 20px; border: 0; background: var(--control); }
body.mode-android .btn.primary { background: var(--accent); color: var(--accent-text); }
body.mode-android .btn.primary:hover { filter: brightness(1.06); }
body.mode-android .field { border-radius: 8px; }
body.mode-android .set-card { border-radius: 20px; background: var(--control); border: 0; }
body.mode-android .sc-item { border-radius: 16px; }
body.mode-android .switch { width: 46px; height: 24px; border-radius: 12px; }
body.mode-android .switch i { width: 18px; height: 18px; top: 3px; left: 3px; }
body.mode-android .switch.on i { left: 25px; }
body.mode-android .widget-card { border-radius: 24px; }
body.mode-android .app-toolbar { padding: 10px 12px; }
body.mode-android .tabs { gap: 6px; }
body.mode-android .tab { border-radius: 18px 18px 0 0; padding: 8px 14px; }
body.mode-android .calc-key { border-radius: 50%; }
body.mode-android .avatar { border-radius: 26px; }

/* =====================================================================
   Mobile fit: every app window fills the screen and each layout stacks so
   nothing overflows on a phone-width viewport.
   ===================================================================== */

/* every window fills the workspace (inline left/top/width/height are overridden) */
body.mode-android .win {
  left: 0 !important; top: 0 !important;
  width: 100% !important; height: 100% !important;
  min-width: 0 !important; min-height: 0 !important;
  border-radius: 0 !important; border-width: 0 !important;
  box-shadow: none; transform: none !important;
}
body.mode-android .win .rz { display: none !important; }
body.mode-android .win.snapping, body.mode-android .win.dragging, body.mode-android .win.resizing { transition: none; }
body.mode-android .win.minimizing { animation: none; opacity: 0; }
body.mode-android .w-titlebar { cursor: default; }

/* toolbars wrap instead of overflowing off-screen */
body.mode-android .app-toolbar { flex-wrap: wrap; row-gap: 6px; min-height: 0; padding: 8px 10px; }
body.mode-android .urlbar { flex: 1 1 200px; min-width: 0; }
body.mode-android .tabs { overflow-x: auto; scrollbar-width: none; }
body.mode-android .tabs::-webkit-scrollbar { display: none; }

/* File Explorer: navigation on top, files below */
body.mode-android .app-body:has(> .ex-side) { flex-direction: column; }
body.mode-android .ex-side {
  width: auto; max-width: none; flex: none; max-height: 36vh;
  border-right: 0; border-bottom: 1px solid var(--border);
}
body.mode-android .ex-search { width: auto; flex: 1; }

/* Settings: sections on top, content below */
body.mode-android .set-body { flex-direction: column; }
body.mode-android .set-side {
  width: auto; max-width: none; flex: none; max-height: 42vh;
  border-right: 0; border-bottom: 1px solid var(--border);
}
body.mode-android .set-nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
body.mode-android .set-nav button { flex: 1 1 auto; }
body.mode-android .set-main { padding: 18px 14px 64px; }
body.mode-android .set-row { gap: 10px; flex-wrap: wrap; }
body.mode-android .set-row > * { min-width: 0; }
body.mode-android .set-row input.field, body.mode-android .set-row select.field { width: auto !important; flex: 1 1 140px; }

/* grids adapt to narrow width */
body.mode-android .br-results { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px 10px; max-width: none; }
body.mode-android .yt-results { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 12px; }
body.mode-android .ex-files.grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }

/* media / photos: stack cover art above the controls */
body.mode-android .mp-cover { flex-direction: column; text-align: center; }
body.mode-android .mp-cover .art { width: min(200px, 58vw); height: min(200px, 58vw); font-size: min(72px, 20vw); }

/* flyouts & cards shouldn't exceed the screen */
body.mode-android .notif-center, body.mode-android .quick-settings { max-width: calc(100vw - 16px); }
body.mode-android .context-menu { max-width: calc(100vw - 16px); }

/* ----- Terminal (Material dark) ----- */
body.mode-android .term-tabs-bar { background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 0 10px; gap: 4px; }
body.mode-android .term-tab { border-radius: 18px; border-bottom: 0; margin: 6px 0; padding: 6px 14px; color: var(--text-2); }
body.mode-android .term-tab.active { background: var(--active); color: var(--text); }
body.mode-android .term-wrap { background: #14121a; padding: 10px 6px 6px 12px; }
body.light.mode-android .term-wrap { background: #14121a; }
body.mode-android .term-wrap .xterm-viewport::-webkit-scrollbar-thumb { background: rgba(208, 188, 255, .35); }
