/* Windows 11 Fluent-inspired desktop UI */
:root {
  --accent: #60cdff;
  --accent-deep: #0078d4;
  --mica: rgba(243, 243, 243, 0.72);
  --mica-dark: rgba(32, 32, 32, 0.78);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #f3f3f3;
  --surface-elevated: rgba(255, 255, 255, 0.88);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --text: #1a1a1a;
  --text-secondary: #5c5c5c;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-win: 0 16px 48px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --taskbar-h: 48px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --focus: 0 0 0 2px #fff, 0 0 0 4px var(--accent-deep);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  background: #000;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font-family: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ========== Lock ========== */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.lock-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 20% 20%, rgba(96, 205, 255, 0.35), transparent 60%),
    radial-gradient(900px 500px at 80% 70%, rgba(0, 120, 212, 0.45), transparent 55%),
    linear-gradient(145deg, #0b1b33 0%, #123a5c 40%, #1a4d6e 70%, #0d2438 100%);
  filter: saturate(1.1);
}

.lock-content {
  position: relative;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.lock-time {
  font-size: clamp(64px, 12vw, 96px);
  font-weight: 300;
  letter-spacing: -2px;
  line-height: 1;
}

.lock-date {
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 400;
  margin-top: 8px;
  opacity: 0.95;
}

.lock-hint {
  margin-top: 48px;
  font-size: 14px;
  opacity: 0.75;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.9;
  }
}

/* ========== Login ========== */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  background:
    radial-gradient(800px 400px at 50% 30%, rgba(96, 205, 255, 0.2), transparent),
    linear-gradient(160deg, #0a1628, #0f2a45 50%, #0a1628);
}

.login-card {
  text-align: center;
  color: #fff;
  width: min(320px, 90vw);
}

.login-avatar {
  margin-bottom: 12px;
}

.login-name {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 20px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-form input {
  height: 36px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 0 12px;
  outline: none;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.login-btn {
  height: 36px;
  border-radius: 4px;
  background: var(--accent-deep);
  color: #fff;
  font-weight: 500;
  transition: background 0.15s;
}

.login-btn:hover {
  background: #106ebe;
}

.login-note {
  margin-top: 16px;
  font-size: 12px;
  opacity: 0.65;
}

/* ========== Desktop ========== */
.desktop {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.desktop-wallpaper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(0, 30, 10, 0.94), rgba(0, 8, 2, 0.98)),
    repeating-linear-gradient(0deg, rgba(0, 255, 102, 0.04) 0px, rgba(0, 255, 102, 0.04) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(0, 255, 102, 0.04) 0px, rgba(0, 255, 102, 0.04) 1px, transparent 1px, transparent 3px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.2s ease;
}

.wallpaper-logo {
  font-family: monospace;
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 700;
  color: #00ff66;
  text-shadow: 0 0 8px rgba(0, 255, 102, 0.6), 0 0 20px rgba(0, 255, 102, 0.4), 0 0 40px rgba(0, 255, 102, 0.2);
  letter-spacing: 0.8rem;
  opacity: 0.25;
  user-select: none;
  text-transform: uppercase;
}

.desktop-icons {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  max-height: calc(100% - var(--taskbar-h) - 24px);
  z-index: 2;
}

.desk-icon {
  width: 76px;
  padding: 6px 4px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  border: 1px solid transparent;
}

.desk-icon:hover {
  background: rgba(255, 255, 255, 0.12);
}

.desk-icon.selected {
  background: rgba(0, 120, 212, 0.35);
  border-color: rgba(255, 255, 255, 0.35);
}

.desk-icon .ico {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.desk-icon .label {
  font-size: 12px;
  text-align: center;
  line-height: 1.25;
  max-width: 72px;
  word-break: break-word;
}

/* ========== Windows ========== */
.windows-layer {
  position: absolute;
  inset: 0 0 var(--taskbar-h) 0;
  z-index: 10;
  pointer-events: none;
}

.window {
  position: absolute;
  min-width: 320px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  background: var(--surface-elevated);
  backdrop-filter: blur(40px) saturate(1.4);
  -webkit-backdrop-filter: blur(40px) saturate(1.4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-win);
  overflow: hidden;
  pointer-events: auto;
  z-index: 20;
  animation: win-in 0.16s ease-out;
}

@keyframes win-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.window.maximized {
  inset: 0 !important;
  width: 100vw !important;
  height: calc(100vh - var(--taskbar-h)) !important;
  border-radius: 0;
  border: none;
}

.window.minimized {
  display: none !important;
}

.window.active {
  box-shadow: var(--shadow-win), 0 0 0 1px rgba(0, 120, 212, 0.25);
}

.titlebar {
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 4px 0 12px;
  gap: 8px;
  background: rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid var(--border);
  cursor: default;
  flex-shrink: 0;
}

.titlebar .win-icon {
  font-size: 14px;
}

.titlebar .win-title {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.titlebar-controls {
  display: flex;
  height: 100%;
}

.titlebar-controls button {
  width: 46px;
  height: 100%;
  display: grid;
  place-items: center;
  transition: background 0.12s;
}

.titlebar-controls button:hover {
  background: rgba(0, 0, 0, 0.06);
}

.titlebar-controls .close:hover {
  background: #e81123;
  color: #fff;
}

.window-body {
  flex: 1;
  overflow: auto;
  background: #fff;
  min-height: 0;
}

.window.resizing,
.window.dragging {
  user-select: none;
}

.resize-handle {
  position: absolute;
  z-index: 5;
}

.resize-handle.n {
  top: 0;
  left: 8px;
  right: 8px;
  height: 4px;
  cursor: n-resize;
}
.resize-handle.s {
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 4px;
  cursor: s-resize;
}
.resize-handle.e {
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  cursor: e-resize;
}
.resize-handle.w {
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  cursor: w-resize;
}
.resize-handle.ne {
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  cursor: ne-resize;
}
.resize-handle.nw {
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  cursor: nw-resize;
}
.resize-handle.se {
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  cursor: se-resize;
}
.resize-handle.sw {
  bottom: 0;
  left: 0;
  width: 10px;
  height: 10px;
  cursor: sw-resize;
}

/* App content shared */
.app-pad {
  padding: 16px 20px;
}

.app-hero {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
}

.app-muted {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0 0 16px;
}

/* Mobile nav toggle (hidden by default, shown on mobile) */
.mobile-nav-toggle {
  display: none;
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 11;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.mobile-nav-toggle:hover {
  background: var(--surface-elevated);
}

/* Explorer */
.explorer {
  display: grid;
  grid-template-columns: 200px 1fr;
  height: 100%;
}

.explorer-nav {
  background: #f9f9f9;
  border-right: 1px solid var(--border);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.explorer-nav button {
  text-align: left;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.explorer-nav button:hover,
.explorer-nav button.active {
  background: rgba(0, 0, 0, 0.05);
}

.explorer-nav button.active {
  background: rgba(0, 120, 212, 0.12);
  font-weight: 500;
}

.explorer-main {
  padding: 12px 16px;
  overflow: auto;
}

.explorer-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.explorer-path {
  flex: 1;
  height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 0 10px;
  font-size: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.file-item {
  padding: 10px 6px;
  border-radius: 4px;
  text-align: center;
  font-size: 12px;
  border: 1px solid transparent;
}

.file-item:hover {
  background: rgba(0, 120, 212, 0.08);
}

.file-item .fi {
  font-size: 32px;
  margin-bottom: 4px;
}

/* Settings */
.settings {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100%;
}

.settings-nav {
  background: #f3f3f3;
  padding: 16px 12px;
  border-right: 1px solid var(--border);
}

.settings-nav h2 {
  font-size: 20px;
  margin: 0 0 16px 8px;
  font-weight: 600;
}

.settings-nav button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 2px;
}

.settings-nav button:hover,
.settings-nav button.active {
  background: rgba(0, 0, 0, 0.06);
}

.settings-nav button.active {
  background: rgba(0, 120, 212, 0.12);
  font-weight: 500;
}

.settings-content {
  padding: 24px 28px;
  overflow: auto;
}

.settings-card {
  background: #f9f9f9;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.settings-card .sc-title {
  font-size: 14px;
  font-weight: 500;
}

.settings-card .sc-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.toggle {
  width: 40px;
  height: 20px;
  border-radius: 10px;
  background: #ccc;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s;
}

.toggle.on {
  background: var(--accent-deep);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle.on::after {
  transform: translateX(20px);
}

/* Notepad */
.notepad {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.notepad-menu {
  display: flex;
  gap: 2px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  font-size: 12px;
}

.notepad-menu span {
  padding: 4px 8px;
  border-radius: 4px;
}

.notepad-menu span:hover {
  background: rgba(0, 0, 0, 0.05);
}

.notepad textarea {
  flex: 1;
  border: none;
  resize: none;
  padding: 12px 16px;
  font-family: "Cascadia Code", "Consolas", "Segoe UI", monospace;
  font-size: 14px;
  outline: none;
  line-height: 1.5;
}

/* Browser */
.browser {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.browser-bar {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: #f3f3f3;
  align-items: center;
}

.browser-bar .nav-btns {
  display: flex;
  gap: 2px;
}

.browser-bar .nav-btns button {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-size: 14px;
}

.browser-bar .nav-btns button:hover {
  background: rgba(0, 0, 0, 0.06);
}

.browser-url {
  flex: 1;
  height: 32px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: #fff;
  padding: 0 14px;
  font-size: 13px;
  outline: none;
}

.browser-url:focus {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 1px var(--accent-deep);
}

.browser-page {
  flex: 1;
  overflow: auto;
  padding: 32px;
  background: linear-gradient(180deg, #e8f4ff 0%, #fff 40%);
}

.browser-page h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--accent-deep);
}

.browser-page p {
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.55;
}

.browser-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.browser-links a,
.browser-links button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border-strong);
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.browser-links a:hover,
.browser-links button:hover {
  border-color: var(--accent-deep);
  color: var(--accent-deep);
}

/* Calculator */
.calc {
  max-width: 280px;
  margin: 0 auto;
  padding: 12px;
}

.calc-display {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 16px;
  text-align: right;
  font-size: 32px;
  font-weight: 500;
  margin-bottom: 10px;
  min-height: 64px;
  word-break: break-all;
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.calc-keys button {
  height: 48px;
  border-radius: 6px;
  background: #f3f3f3;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.1s;
}

.calc-keys button:hover {
  background: #e5e5e5;
}

.calc-keys button.op {
  background: #e8f4ff;
  color: var(--accent-deep);
}

.calc-keys button.eq {
  background: var(--accent-deep);
  color: #fff;
}

.calc-keys button.eq:hover {
  background: #106ebe;
}

/* Terminal */
.term {
  background: #0c0c0c;
  color: #cccccc;
  height: 100%;
  padding: 12px 14px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  overflow: auto;
}

.term .prompt {
  color: #16c60c;
}

.term input {
  background: transparent;
  border: none;
  color: #fff;
  outline: none;
  font: inherit;
  width: calc(100% - 2ch);
}

/* ========== Taskbar ========== */
.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--taskbar-h);
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 8px;
  background: rgba(243, 243, 243, 0.78);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.taskbar-left {
  display: flex;
  justify-content: flex-start;
}

.taskbar-center {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

.taskbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.tb-btn {
  height: 40px;
  min-width: 40px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
  position: relative;
}

.tb-btn:hover,
.tb-btn.active {
  background: rgba(255, 255, 255, 0.65);
}

.tb-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.start-btn .win-logo {
  color: var(--accent-deep);
}

.taskbar-apps {
  display: flex;
  gap: 2px;
  align-items: center;
}

.tb-app {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 18px;
  position: relative;
}

.tb-app:hover {
  background: rgba(255, 255, 255, 0.65);
}

.tb-app.open::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--text-secondary);
}

.tb-app.active::after {
  width: 16px;
  background: var(--accent-deep);
}

.sys-tray {
  padding: 0 8px;
  gap: 6px;
}

.tray-icons {
  display: flex;
  gap: 4px;
  font-size: 13px;
}

.clock-btn {
  flex-direction: column;
  align-items: flex-end;
  padding: 0 10px;
  min-width: 70px;
  line-height: 1.15;
  font-size: 12px;
}

.show-desktop {
  width: 6px !important;
  min-width: 6px !important;
  height: 40px;
  border-radius: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  margin-left: 4px;
}

.show-desktop:hover {
  background: rgba(0, 120, 212, 0.25);
}

/* ========== Flyouts / Start ========== */
.start-menu,
.flyout {
  position: absolute;
  z-index: 90;
  background: rgba(243, 243, 243, 0.88);
  backdrop-filter: blur(48px) saturate(1.6);
  -webkit-backdrop-filter: blur(48px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fly-in 0.14s ease-out;
}

@keyframes fly-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.start-menu {
  bottom: calc(var(--taskbar-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - var(--taskbar-h) - 40px));
  padding: 20px 24px 0;
  display: flex;
  flex-direction: column;
}

.start-menu.hidden {
  display: none !important;
}

.start-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  height: 40px;
  padding: 0 14px;
  margin-bottom: 18px;
  color: var(--text-secondary);
}

.start-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
}

.start-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  padding: 0 4px;
}

.start-all-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.04);
}

.start-all-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.start-pinned {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 18px;
}

.start-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: 6px;
  font-size: 12px;
}

.start-app:hover {
  background: rgba(255, 255, 255, 0.7);
}

.start-app .ico {
  font-size: 28px;
}

.start-recommended {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 12px;
  max-height: 140px;
  overflow: auto;
}

.rec-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
}

.rec-item:hover {
  background: rgba(255, 255, 255, 0.7);
}

.rec-item .ico {
  font-size: 20px;
}

.rec-item small {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
}

.start-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.03);
  margin: 0 -24px;
  padding-left: 28px;
  padding-right: 20px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.start-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
}

.start-user:hover,
.start-power:hover {
  background: rgba(0, 0, 0, 0.06);
}

.avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}

.start-power {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: grid;
  place-items: center;
}

/* Search / widgets / qs / calendar */
.search-panel {
  bottom: calc(var(--taskbar-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 24px));
  padding: 16px 20px 20px;
}

.flyout-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.search-panel input {
  width: 100%;
  height: 40px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  padding: 0 16px;
  font-size: 14px;
  outline: none;
  margin-bottom: 12px;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow: auto;
}

.search-hit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
}

.search-hit:hover {
  background: rgba(255, 255, 255, 0.7);
}

.widgets-panel {
  bottom: calc(var(--taskbar-h) + 12px);
  left: 12px;
  width: min(420px, calc(100vw - 24px));
  padding: 16px;
}

.widget-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widget {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  padding: 14px;
  border: 1px solid var(--border);
}

.widget-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.widget-big {
  font-size: 36px;
  font-weight: 300;
}

.widget-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.widget-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
}

.widget-row .up {
  color: #0f7b0f;
}
.widget-row .down {
  color: #c42b1c;
}

.widget.news ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}

.quick-settings {
  bottom: calc(var(--taskbar-h) + 12px);
  right: 12px;
  width: min(360px, calc(100vw - 24px));
  padding: 16px;
}

.qs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.qs-tile {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  min-height: 72px;
}

.qs-tile:hover {
  background: rgba(255, 255, 255, 0.9);
}

.qs-tile.active {
  background: rgba(0, 120, 212, 0.18);
  border-color: rgba(0, 120, 212, 0.35);
  color: var(--accent-deep);
  font-weight: 500;
}

.qs-icon {
  font-size: 18px;
}

.qs-sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qs-sliders label {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
}

.qs-sliders input[type="range"] {
  width: 100%;
  accent-color: var(--accent-deep);
}

.calendar-flyout {
  bottom: calc(var(--taskbar-h) + 12px);
  right: 12px;
  width: min(320px, calc(100vw - 24px));
  padding: 16px;
}

.cal-time {
  font-size: 28px;
  font-weight: 300;
}

.cal-date {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  font-size: 12px;
}

.cal-grid .hd {
  color: var(--text-secondary);
  font-weight: 600;
  padding: 6px 0;
}

.cal-grid .day {
  padding: 8px 0;
  border-radius: 50%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.cal-grid .day.today {
  background: var(--accent-deep);
  color: #fff;
  font-weight: 600;
}

.cal-grid .day.muted {
  opacity: 0.35;
}

/* Context menu */
.context-menu {
  position: fixed;
  z-index: 200;
  min-width: 200px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.context-menu li {
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

.context-menu li:hover {
  background: rgba(0, 0, 0, 0.06);
}

.context-menu li.sep {
  height: 1px;
  padding: 0;
  margin: 4px 8px;
  background: var(--border);
  pointer-events: none;
}

.context-menu li.danger {
  color: #c42b1c;
}

/* Toasts */
.toasts {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  pointer-events: auto;
  animation: fly-in 0.2s ease-out;
}

.toast strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.toast span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 720px) {
  .titlebar {
    height: 44px;
  }
  .titlebar .titlebar-controls button {
    width: 46px;
    height: 36px;
  }
  /* Floating chat widget instead of full-screen sidebar */
  .copilot-sidebar {
    width: min(380px, calc(100vw - 32px));
    height: min(520px, calc(100dvh - 56px - 80px));
    top: auto;
    bottom: 72px;
    left: auto;
    right: 16px;
    border-radius: 14px;
    border-left: 1px solid var(--border-strong);
    box-shadow: 0 8px 40px rgba(0,0,0,0.22), 0 0 0 1px rgba(255,255,255,0.5) inset;
    transform: translateY(16px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s cubic-bezier(0.4,0,0.2,1), opacity 0.22s ease;
  }
  .copilot-sidebar:not(.hidden) {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
  .copilot-input-area {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .copilot-model-select {
    max-width: 110px;
  }
  .start-pinned {
    grid-template-columns: repeat(4, 1fr);
  }
  .start-recommended {
    grid-template-columns: 1fr;
  }
  .explorer,
  .settings {
    grid-template-columns: 1fr;
    position: relative;
  }
  .explorer-nav,
  .settings-nav {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 100%;
    z-index: 10;
    box-shadow: 4px 0 16px rgba(0,0,0,0.15);
  }
  .explorer-nav.open,
  .settings-nav.open {
    display: flex;
  }
  .mobile-nav-toggle {
    display: flex !important;
  }
  .taskbar-left {
    display: none;
  }

  /* Taskbar: bigger touch targets */
  .taskbar {
    height: 56px;
    padding: 0 4px;
  }
  :root {
    --taskbar-h: 56px;
  }
  .tb-btn {
    height: 44px;
    min-width: 44px;
  }
  .start-btn {
    min-width: 48px;
  }
  .copilot-btn {
    display: none;
  }
  .copilot-fab {
    display: flex !important;
    right: auto;
    left: 16px;
  }
  .show-desktop {
    width: 8px !important;
  }
  .clock-btn {
    min-width: auto;
    padding: 0 6px;
  }
  .clock-btn #tb-time,
  .clock-btn #tb-date {
    font-size: 10px;
  }
  .sys-tray .tray-icons span {
    font-size: 12px;
  }

  /* Desktop icons: bigger, easier to tap */
  .desktop-icons {
    top: 8px;
    left: 8px;
    gap: 2px;
    flex-direction: row;
    flex-wrap: wrap;
    max-width: calc(100% - 16px);
    max-height: calc(100% - var(--taskbar-h) - 16px);
  }
  .desk-icon {
    width: 72px;
    padding: 6px 2px;
  }
  .desk-icon .ico {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }
  .desk-icon .label {
    font-size: 10px;
    max-width: 68px;
  }

  /* Windows: fill screen on mobile */
  .window {
    min-width: 0 !important;
    min-height: 0 !important;
    border-radius: 0 !important;
  }
  .window.maximized {
    width: 100vw !important;
    height: calc(100vh - var(--taskbar-h)) !important;
    left: 0 !important;
    top: 0 !important;
  }
  .resize-handle {
    width: 20px !important;
    height: 20px !important;
  }

  /* Start menu */
  .start-menu {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 80px);
    max-height: calc(100vh - 80px);
  }
  .search-panel {
    width: calc(100vw - 16px);
  }
  .widgets-panel {
    width: calc(100vw - 16px);
  }
  .quick-settings {
    width: calc(100vw - 16px);
  }
  .calendar-flyout {
    width: calc(100vw - 16px);
  }
  .install-modal-card {
    width: min(380px, 90vw);
    padding: 24px 20px 20px;
  }
  .context-menu {
    max-width: min(240px, 80vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- RUN DIALOG --- */
.run-dialog {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface-solid);
  height: 100%;
}
.run-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.run-icon {
  font-size: 32px;
}
.run-header p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}
.run-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.run-input-row label {
  font-size: 12px;
}
.run-input-row input {
  flex: 1;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--text);
  padding: 0 8px;
  outline: none;
}
.run-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
}
.run-actions button {
  padding: 6px 18px;
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.1s;
}
.run-actions button:hover {
  background: var(--accent-deep);
  color: #fff;
  border-color: var(--accent-deep);
}

/* --- TASK MANAGER --- */
.taskmgr {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-solid);
}
.taskmgr-tabs {
  display: flex;
  background: var(--border);
  border-bottom: 1px solid var(--border-strong);
  flex-shrink: 0;
}
.taskmgr-tab {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.taskmgr-tab.active {
  border-bottom-color: var(--accent-deep);
  background: var(--surface-elevated);
}
.taskmgr-pane {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.taskmgr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
.taskmgr-table th, .taskmgr-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.taskmgr-table th {
  font-weight: 600;
  background: var(--border);
}
.taskmgr-table tr:hover {
  background: rgba(0, 120, 212, 0.05);
}
.end-task-btn {
  background: #c42b1c;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
}
.end-task-btn:hover {
  background: #a82015;
}
.perf-graph-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.perf-card {
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 12px;
  background: var(--surface-elevated);
}
.perf-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.perf-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-deep);
  margin-bottom: 8px;
}
.perf-bar-bg {
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.perf-bar-fill {
  height: 100%;
  background: var(--accent-deep);
  width: 0%;
  transition: width 1s ease;
}

/* --- MINESWEEPER --- */
.minesweeper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: var(--surface-solid);
  height: 100%;
  user-select: none;
}
.mines-header {
  display: flex;
  justify-content: space-between;
  width: 220px;
  background: var(--border);
  padding: 6px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
  font-family: monospace;
  font-size: 16px;
  font-weight: bold;
}
.mines-smile {
  cursor: pointer;
}
.mines-grid {
  display: grid;
  grid-template-columns: repeat(9, 24px);
  grid-template-rows: repeat(9, 24px);
  gap: 1px;
  background: var(--border-strong);
  border: 2px solid var(--border-strong);
  border-radius: 4px;
}
.mines-cell {
  width: 24px;
  height: 24px;
  background: var(--surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
}
.mines-cell.revealed {
  background: var(--border);
  cursor: default;
}
.mines-cell.bomb {
  background: #ff5f56;
}
.mines-cell.c1 { color: #0078d4; }
.mines-cell.c2 { color: #107c41; }
.mines-cell.c3 { color: #a80000; }
.mines-cell.c4 { color: #002050; }

/* --- PAINT --- */
.paint {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-solid);
}
.paint-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--border);
  border-bottom: 1px solid var(--border-strong);
  flex-shrink: 0;
}
.paint-tool {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid transparent;
}
.paint-tool.active {
  background: var(--surface-elevated);
  border-color: var(--border-strong);
}
.paint-colors {
  display: flex;
  gap: 4px;
}
.paint-color {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.2);
  cursor: pointer;
}
.paint-color.active {
  transform: scale(1.2);
  box-shadow: 0 0 0 2px var(--accent-deep);
}
.paint-canvas-container {
  flex: 1;
  overflow: auto;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-strong);
  min-height: 0;
}
.paint-canvas {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: crosshair;
}

/* --- DARK MODE OVERRIDES --- */
body.dark-mode {
  --mica: rgba(32, 32, 32, 0.72);
  --surface: rgba(45, 45, 45, 0.72);
  --surface-solid: #202020;
  --surface-elevated: rgba(32, 32, 32, 0.88);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --text-secondary: #c3c3c3;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-win: 0 16px 48px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .desktop-wallpaper {
  background:
    radial-gradient(circle at center, rgba(20, 0, 40, 0.95), rgba(8, 0, 15, 0.98)),
    repeating-linear-gradient(0deg, rgba(230, 0, 255, 0.04) 0px, rgba(230, 0, 255, 0.04) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(230, 0, 255, 0.04) 0px, rgba(230, 0, 255, 0.04) 1px, transparent 1px, transparent 3px);
}

body.dark-mode .wallpaper-logo {
  color: #ff00ff;
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.7), 0 0 20px rgba(255, 0, 255, 0.5), 0 0 40px rgba(255, 0, 255, 0.3);
}

body.dark-mode .window-body {
  background: #1f1f1f;
  color: #fff;
}

body.dark-mode .titlebar {
  background: rgba(32, 32, 32, 0.35);
}

body.dark-mode .titlebar-controls button:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .explorer-nav,
body.dark-mode .settings-nav {
  background: rgba(45, 45, 45, 0.4);
}

body.dark-mode .explorer-nav button:hover,
body.dark-mode .settings-nav button:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.dark-mode .explorer-nav button.active,
body.dark-mode .settings-nav button.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
}

body.dark-mode .settings-card {
  background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .settings-card:hover {
  background: rgba(255, 255, 255, 0.07);
}

body.dark-mode .browser-bar {
  background: rgba(32, 32, 32, 0.9);
}

body.dark-mode .browser-url {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .browser-page {
  background: #1e1e1e;
  color: #fff;
}

body.dark-mode .notepad textarea {
  background: #1e1e1e;
  color: #fff;
}

body.dark-mode .notepad-menu {
  background: rgba(32, 32, 32, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .term {
  background: #0c0c0c;
  color: #dfdfdf;
}

body.dark-mode #term-input {
  color: #dfdfdf;
}

body.dark-mode .calc-display {
  background: #2b2b2b;
  color: #fff;
}

body.dark-mode .calc-keys button {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

body.dark-mode .calc-keys button:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .calc-keys button.op {
  background: rgba(255, 255, 255, 0.09);
  color: var(--accent);
}

body.dark-mode .calc-keys button.op:hover {
  background: rgba(255, 255, 255, 0.15);
}

body.dark-mode .calc-keys button.eq {
  background: var(--accent-deep);
  color: #fff;
}

body.dark-mode .calc-keys button.eq:hover {
  background: #106ebe;
}

body.dark-mode .start-menu,
body.dark-mode .flyout {
  background: rgba(32, 32, 32, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .taskbar {
  background: rgba(32, 32, 32, 0.75);
  border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .context-menu {
  background: rgba(45, 45, 45, 0.9);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .context-menu li:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .toast {
  background: rgba(32, 32, 32, 0.95);
  color: #fff;
}

/* ==================== COPILOT SIDEBAR ==================== */

.copilot-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: calc(100vh - var(--taskbar-h));
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
  background: rgba(243, 243, 243, 0.82);
  backdrop-filter: blur(40px) saturate(1.4);
  -webkit-backdrop-filter: blur(40px) saturate(1.4);
  border-left: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15), 0 0 24px rgba(0, 120, 212, 0.08);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: text;
}

.copilot-sidebar:not(.hidden) {
  transform: translateX(0);
}

.copilot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.copilot-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copilot-icon {
  font-size: 20px;
  line-height: 1;
}

.copilot-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.copilot-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.copilot-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.copilot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.copilot-messages::-webkit-scrollbar {
  width: 4px;
}

.copilot-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

.copilot-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 24px 8px 8px;
}

.copilot-avatar {
  font-size: 36px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 120, 212, 0.1), rgba(96, 205, 255, 0.15));
  border-radius: 16px;
  border: 1px solid rgba(0, 120, 212, 0.15);
}

.copilot-welcome-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 280px;
}

.copilot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding-top: 4px;
}

.copilot-chip {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(0, 120, 212, 0.08);
  color: var(--accent-deep);
  border: 1px solid rgba(0, 120, 212, 0.15);
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.copilot-chip:hover {
  background: rgba(0, 120, 212, 0.15);
  transform: translateY(-1px);
}

/* Chat messages */
.copilot-msg {
  display: flex;
  gap: 8px;
  max-width: 100%;
  animation: fly-in 0.16s ease-out;
}

.copilot-msg.user {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.copilot-msg.assistant {
  align-self: flex-start;
}

.copilot-msg-bubble {
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 320px;
  word-break: break-word;
  white-space: pre-wrap;
}

.copilot-msg.user .copilot-msg-bubble {
  background: var(--accent-deep);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.copilot-msg.assistant .copilot-msg-bubble {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.copilot-msg-avatar {
  font-size: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.copilot-msg.user .copilot-msg-avatar {
  display: none;
}

/* Typing indicator */
.copilot-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.copilot-typing span {
  width: 6px;
  height: 6px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typing-bounce 1.2s infinite;
}

.copilot-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.copilot-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* Streaming cursor */
.copilot-cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: var(--accent-deep);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: blink-cursor 0.8s infinite;
}

@keyframes blink-cursor {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Function call badge */
.copilot-fn-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  margin: 4px 0;
  background: rgba(0, 120, 212, 0.08);
  color: var(--accent-deep);
  border-radius: 6px;
  border: 1px solid rgba(0, 120, 212, 0.12);
}

.copilot-fn-badge::before {
  content: "⚡";
  font-size: 10px;
}

/* Input area */
.copilot-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.copilot-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 8px 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.copilot-input-wrap:focus-within {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.15);
}

.copilot-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  resize: none;
  outline: none;
  max-height: 80px;
  line-height: 1.4;
}

.copilot-input::placeholder {
  color: var(--text-secondary);
}

.copilot-send {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-deep);
  color: #fff;
  border-radius: 8px;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

.copilot-send:hover {
  background: #106ebe;
  transform: scale(1.05);
}

.copilot-send:active {
  transform: scale(0.95);
}

/* Taskbar copilot button */
.copilot-btn {
  position: relative;
}

.copilot-btn-icon {
  font-size: 16px;
  line-height: 1;
}

.copilot-btn.active {
  background: rgba(0, 120, 212, 0.12);
}

/* Neon glow pulse on sidebar border */
.copilot-sidebar:not(.hidden)::before {
  content: "";
  position: absolute;
  inset: 0;
  left: -1px;
  border-left: 2px solid transparent;
  background: linear-gradient(180deg, rgba(0, 120, 212, 0.3), rgba(96, 205, 255, 0.15), rgba(0, 120, 212, 0.3)) border-box;
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask-composite: xor;
  pointer-events: none;
  border-radius: 0;
  animation: copilot-glow 3s ease-in-out infinite;
}

@keyframes copilot-glow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ==================== COPILOT STANDALON APP ==================== */

.cxp-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
}

.cxp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cxp-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cxp-icon { font-size: 18px; }

.cxp-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.cxp-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cxp-model-select {
  font-size: 11px;
  padding: 3px 20px 3px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: rgba(255,255,255,0.5);
  color: var(--text);
  cursor: pointer;
}

.cxp-caveman-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.15s;
}

.cxp-caveman-btn:hover { background: rgba(0,0,0,0.06); }
.cxp-caveman-btn.active { background: rgba(0,120,212,0.12); }

.cxp-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.cxp-messages::-webkit-scrollbar { width: 4px; }
.cxp-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }

.cxp-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 20px 8px 8px;
}

.cxp-welcome-avatar {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0,120,212,0.1), rgba(96,205,255,0.15));
  border-radius: 14px;
  border: 1px solid rgba(0,120,212,0.15);
}

.cxp-welcome-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 260px;
}

.cxp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  padding-top: 4px;
}

.cxp-chip {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 16px;
  background: rgba(0,120,212,0.08);
  color: var(--accent-deep);
  border: 1px solid rgba(0,120,212,0.15);
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.cxp-chip:hover { background: rgba(0,120,212,0.15); transform: translateY(-1px); }

.cxp-msg {
  display: flex;
  gap: 8px;
  max-width: 100%;
  animation: fly-in 0.16s ease-out;
}

.cxp-msg.user { flex-direction: row-reverse; align-self: flex-end; }
.cxp-msg.assistant { align-self: flex-start; }

.cxp-msg-bubble {
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 10px;
  max-width: 90%;
  word-break: break-word;
  white-space: pre-wrap;
}

.cxp-msg.user .cxp-msg-bubble {
  background: var(--accent-deep);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.cxp-msg.assistant .cxp-msg-bubble {
  background: rgba(255,255,255,0.7);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.cxp-msg-avatar {
  font-size: 14px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.cxp-msg.user .cxp-msg-avatar { display: none; }

.cxp-typing {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.cxp-typing span {
  width: 5px;
  height: 5px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typing-bounce 1.2s infinite;
}

.cxp-typing span:nth-child(2) { animation-delay: 0.2s; }
.cxp-typing span:nth-child(3) { animation-delay: 0.4s; }

.cxp-fn-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 2px 7px;
  margin: 3px 0;
  background: rgba(0,120,212,0.08);
  color: var(--accent-deep);
  border-radius: 5px;
  border: 1px solid rgba(0,120,212,0.12);
}

.cxp-fn-badge::before { content: "⚡"; font-size: 9px; }

.cxp-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 4px 0;
}

.cxp-status-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0,120,212,0.2);
  border-top-color: var(--accent-deep);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.cxp-input-area {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.cxp-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 7px 9px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cxp-input-wrap:focus-within {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 2px rgba(0,120,212,0.15);
}

.cxp-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 12px;
  color: var(--text);
  resize: none;
  outline: none;
  max-height: 72px;
  line-height: 1.4;
}

.cxp-input::placeholder { color: var(--text-secondary); }

.cxp-send {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-deep);
  color: #fff;
  border-radius: 7px;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

.cxp-send:hover { background: #106ebe; transform: scale(1.05); }
.cxp-send:active { transform: scale(0.95); }

/* Also add progress indicator for sidebar copilot */
.copilot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 4px 0;
}

.copilot-status-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0,120,212,0.2);
  border-top-color: var(--accent-deep);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Responsive */
@media (max-width: 480px) {
  /* Small phone: wider floating widget */
  .copilot-sidebar {
    width: calc(100vw - 16px);
    height: min(480px, calc(100dvh - 56px - 72px));
    bottom: 64px;
    right: 8px;
    border-radius: 12px;
  }
  .copilot-header {
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-left: calc(12px + env(safe-area-inset-left));
    padding-right: calc(12px + env(safe-area-inset-right));
    flex-wrap: nowrap;
    gap: 6px;
  }
  .copilot-header-left {
    min-width: 0;
  }
  .copilot-title {
    font-size: 12px;
    white-space: nowrap;
  }
  .copilot-model-select {
    max-width: 100px;
    font-size: 10px;
    padding: 3px 18px 3px 6px;
  }
  .copilot-caveman-toggle {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }
  .copilot-close {
    width: 26px;
    height: 26px;
  }
  .copilot-messages {
    padding: 12px;
    gap: 10px;
  }
  .copilot-input-area {
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    background: rgba(243, 243, 243, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .start-menu {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 80px);
    max-height: calc(100vh - 80px);
  }
  .search-panel {
    width: calc(100vw - 16px);
  }
  .widgets-panel {
    width: calc(100vw - 16px);
  }
  .quick-settings {
    width: calc(100vw - 16px);
  }
  .calendar-flyout {
    width: calc(100vw - 16px);
  }
}

/* Dark mode */
body.dark-mode .copilot-sidebar {
  background: rgba(30, 30, 30, 0.92);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

body.dark-mode .copilot-input-area {
  background: rgba(30, 30, 30, 0.95);
  border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .copilot-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Stop button mode */
.copilot-send.stop-mode {
  background: #e74c3c;
}
.copilot-send.stop-mode:hover {
  background: #c0392b;
}
.cxp-send.stop-mode {
  background: #e74c3c;
}
.cxp-send.stop-mode:hover {
  background: #c0392b;
}

/* Clear button */
.copilot-clear-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}
.copilot-clear-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}
.cxp-clear-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}
.cxp-clear-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}
body.dark-mode .copilot-clear-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
body.dark-mode .cxp-clear-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Model info */
.copilot-model-info {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  padding: 2px 0;
  opacity: 0.7;
}
.cxp-model-info {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  padding: 2px 0;
  opacity: 0.7;
}

/* Search input */
.copilot-search-input {
  width: 80px;
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: rgba(255,255,255,0.5);
  color: var(--text);
  transition: width 0.2s, border-color 0.2s;
}
.copilot-search-input:focus {
  width: 140px;
  border-color: var(--accent-deep);
  outline: none;
}
body.dark-mode .copilot-search-input {
  background: rgba(40,40,40,0.6);
  border-color: rgba(255,255,255,0.1);
  color: var(--text);
}

/* Desktop icon preview */
.desk-icon-preview {
  position: fixed;
  z-index: 9998;
  width: 200px;
  background: rgba(243,243,243,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 8px;
  pointer-events: none;
  animation: fly-in 0.12s ease-out;
}
.desk-icon-preview-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.desk-icon-preview-frame {
  width: 100%;
  height: 120px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}
.desk-icon-preview-frame iframe {
  width: 300%;
  height: 300%;
  border: none;
  transform: scale(0.333);
  transform-origin: top left;
  pointer-events: none;
}
body.dark-mode .desk-icon-preview {
  background: rgba(30,30,30,0.95);
  border-color: rgba(255,255,255,0.08);
}
body.dark-mode .desk-icon-preview-frame {
  background: #1e1e1e;
  border-color: rgba(255,255,255,0.08);
}

body.dark-mode .copilot-msg.assistant .copilot-msg-bubble {
  background: rgba(45, 45, 45, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .copilot-chip {
  background: rgba(96, 205, 255, 0.1);
  color: var(--accent);
  border-color: rgba(96, 205, 255, 0.2);
}

body.dark-mode .copilot-chip:hover {
  background: rgba(96, 205, 255, 0.18);
}

body.dark-mode .copilot-input-wrap {
  background: rgba(40, 40, 40, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .copilot-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(96, 205, 255, 0.15);
}

body.dark-mode .copilot-typing {
  background: rgba(45, 45, 45, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .copilot-fn-badge {
  background: rgba(96, 205, 255, 0.08);
  color: var(--accent);
  border-color: rgba(96, 205, 255, 0.12);
}

body.dark-mode .copilot-sidebar:not(.hidden)::before {
  background: linear-gradient(180deg, rgba(96, 205, 255, 0.25), rgba(0, 120, 212, 0.1), rgba(96, 205, 255, 0.25)) border-box;
}

body.dark-mode .cxp-msg.assistant .cxp-msg-bubble {
  background: rgba(45, 45, 45, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .cxp-chip {
  background: rgba(96, 205, 255, 0.1);
  color: var(--accent);
  border-color: rgba(96, 205, 255, 0.2);
}

body.dark-mode .cxp-chip:hover {
  background: rgba(96, 205, 255, 0.18);
}

body.dark-mode .cxp-input-wrap {
  background: rgba(40, 40, 40, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .cxp-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(96, 205, 255, 0.15);
}

body.dark-mode .cxp-typing {
  background: rgba(45, 45, 45, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .cxp-fn-badge {
  background: rgba(96, 205, 255, 0.08);
  color: var(--accent);
  border-color: rgba(96, 205, 255, 0.12);
}

body.dark-mode .cxp-model-select {
  background: rgba(40, 40, 40, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

body.dark-mode .cxp-caveman-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .cxp-caveman-btn.active {
  background: rgba(96, 205, 255, 0.15);
}

/* ==================== INSTALL/DELETE MODAL ==================== */

.install-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-fade-in 0.2s ease-out;
}

.install-modal.hidden {
  display: none;
}

.install-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.install-modal-card {
  position: relative;
  width: 380px;
  background: rgba(243, 243, 243, 0.95);
  backdrop-filter: blur(40px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25), 0 0 40px rgba(0, 120, 212, 0.1);
  padding: 32px 28px 24px;
  text-align: center;
  animation: modal-scale-in 0.2s ease-out;
}

.install-modal-icon {
  font-size: 48px;
  margin-bottom: 12px;
  line-height: 1;
}

.install-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.install-modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.install-modal-info {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-bottom: 24px;
}

.install-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.install-modal-btn {
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border-strong);
  min-width: 100px;
}

.install-modal-btn.cancel {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
}

.install-modal-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.8);
}

.install-modal-btn.confirm {
  background: var(--accent-deep);
  color: #fff;
  border-color: var(--accent-deep);
}

.install-modal-btn.confirm:hover {
  background: #106ebe;
  transform: translateY(-1px);
}

.install-modal-btn.confirm.danger {
  background: #c42b1c;
  border-color: #c42b1c;
}

.install-modal-btn.confirm.danger:hover {
  background: #a61b10;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-scale-in {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

body.dark-mode .install-modal-card {
  background: rgba(40, 40, 40, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .install-modal-btn.cancel {
  background: rgba(60, 60, 60, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .install-modal-btn.cancel:hover {
  background: rgba(70, 70, 70, 0.8);
}

/* ==================== COPILOT HEADER CONTROLS ==================== */

.copilot-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.copilot-model-select-wrap {
  position: relative;
}

.copilot-model-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(0, 120, 212, 0.08);
  border: 1px solid rgba(0, 120, 212, 0.15);
  border-radius: 6px;
  padding: 4px 22px 4px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-deep);
  cursor: pointer;
  outline: none;
  font-family: var(--font);
  max-width: 140px;
  transition: all 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%230078d4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

.copilot-model-select:hover {
  background-color: rgba(0, 120, 212, 0.12);
  border-color: rgba(0, 120, 212, 0.25);
}

.copilot-model-select:focus {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.15);
}

.copilot-caveman-toggle {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 14px;
  border: 1px solid transparent;
  transition: all 0.15s;
  position: relative;
}

.copilot-caveman-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
}

.copilot-caveman-toggle.active {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
}

.copilot-caveman-toggle.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 3px;
  background: #8b5cf6;
  border-radius: 2px;
}

body.dark-mode .copilot-model-select {
  background-color: rgba(96, 205, 255, 0.08);
  border-color: rgba(96, 205, 255, 0.15);
  color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2360cdff'/%3E%3C/svg%3E");
}

body.dark-mode .copilot-model-select:hover {
  background-color: rgba(96, 205, 255, 0.12);
  border-color: rgba(96, 205, 255, 0.25);
}

body.dark-mode .copilot-caveman-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .copilot-caveman-toggle.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.35);
}

/* ==================== COPILOT FAB (mobile) ==================== */
.copilot-fab {
  display: none;
  position: fixed;
  bottom: calc(var(--taskbar-h) + 16px);
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-deep);
  color: #fff;
  font-size: 24px;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(0, 120, 212, 0.45), 0 0 0 3px rgba(0, 120, 212, 0.15);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.copilot-fab:active {
  transform: scale(0.9);
  box-shadow: 0 2px 12px rgba(0, 120, 212, 0.4);
}

.copilot-fab.open {
  background: #c42b1c;
}

body.dark-mode .copilot-fab {
  box-shadow: 0 4px 20px rgba(96, 205, 255, 0.3), 0 0 0 3px rgba(96, 205, 255, 0.1);
}
