/* ============================================================
   windows 11 WebV — Fluent Design stylesheet
   ============================================================ */

/* ============================================================
   THEME TOKENS — Light (default :root) vs Dark
   Every surface in the shell reads these variables, so flipping
   <html data-theme="dark"> re-skins the whole OS at once.
   ============================================================ */
:root {
  --accent: #0067c0;              /* Windows 11 active blue (light) */
  --accent-hover: #1975c5;
  --accent-active: #005ba8;
  --accent-bright: #4cc2ff;       /* the lighter "glow" accent */
  --accent-text-on: #ffffff;

  --desktop-wash: #0078d4;        /* tint behind the wallpaper */
  --wallpaper-dim: 0;             /* darkens bloom.jpg in dark mode */

  --text-primary: #1f1f1f;
  --text-secondary: #444444;
  --text-muted: #616161;
  --text-disabled: #b0b0b0;

  --surface-window: #f9f9f9;
  --surface-titlebar: #f0f0f0;
  --surface-body: #ffffff;
  --surface-sidebar: #f3f3f3;
  --surface-card: #ffffff;
  --surface-elevated: #ffffff;

  --flyout-bg: rgba(245, 245, 245, 0.85);
  --flyout-border: rgba(255, 255, 255, 0.6);
  --flyout-hover: rgba(0, 0, 0, 0.07);

  --taskbar-bg: rgba(243, 243, 243, 0.85);
  --taskbar-border: rgba(255, 255, 255, 0.5);
  --taskbar-shadow: 0 -1px 4px rgba(0, 0, 0, 0.06);

  --control-bg: rgba(255, 255, 255, 0.55);
  --control-hover: rgba(0, 0, 0, 0.06);
  --control-active: rgba(0, 0, 0, 0.12);

  --stroke-soft: rgba(0, 0, 0, 0.06);
  --stroke: rgba(0, 0, 0, 0.12);
  --stroke-strong: #888888;

  --shadow-window: 0 8px 32px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.2);

  /* Smooth cross-fade between themes. */
  --theme-transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

/* ---------- Windows 11 Dark Theme (Fluent specs) ---------- */
[data-theme="dark"] {
  --accent: #60cdff;              /* Windows 11 dark accent blue */
  --accent-hover: #7bd6ff;
  --accent-active: #4ab8eb;
  --accent-bright: #60cdff;
  --accent-text-on: #0b0b0b;

  --desktop-wash: #0a0a0a;        /* deep acrylic dark behind wallpaper */
  --wallpaper-dim: 0.55;

  --text-primary: #ffffff;
  --text-secondary: #e5e5e5;
  --text-muted: #b9b9b9;
  --text-disabled: #6b6b6b;

  --surface-window: #202020;
  --surface-titlebar: #1c1c1c;
  --surface-body: #202020;
  --surface-sidebar: #2c2c2c;
  --surface-card: #2c2c2c;
  --surface-elevated: #2c2c2c;

  --flyout-bg: rgba(32, 32, 32, 0.85);
  --flyout-border: rgba(255, 255, 255, 0.08);
  --flyout-hover: rgba(255, 255, 255, 0.08);

  --taskbar-bg: rgba(28, 28, 28, 0.85);
  --taskbar-border: rgba(255, 255, 255, 0.08);
  --taskbar-shadow: 0 -1px 4px rgba(0, 0, 0, 0.4);

  --control-bg: rgba(255, 255, 255, 0.06);
  --control-hover: rgba(255, 255, 255, 0.08);
  --control-active: rgba(255, 255, 255, 0.14);

  --stroke-soft: rgba(255, 255, 255, 0.08);
  --stroke: rgba(255, 255, 255, 0.14);
  --stroke-strong: #8a8a8a;

  --shadow-window: 0 8px 32px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}
html,
body {
  height: 100%;
  overflow: hidden;
  background: #000;
}
button {
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

/* Apply the theme cross-fade to the shell chrome (bounded to the big
   surfaces so animations elsewhere are unaffected). */
#desktop,
#taskbar,
.popup,
.window,
.win-titlebar,
.win-body,
.ctx-menu,
.ctx-sub,
.desk-icon span {
  transition: var(--theme-transition);
}

/* ==================== SCREENS ==================== */
.screen {
  position: absolute;
  inset: 0;
  transition:
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s ease,
    filter 0.35s ease;
}
.hidden {
  display: none !important;
}

/* ==================== BOOT FLOW ==================== */
#boot-screen,
#desktop {
  background-color: var(--desktop-wash);
  background-image: url("bloom.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* Dark theme keeps the Bloom wallpaper but dims it into the deep
     acrylic-dark look of Windows 11 Dark mode. */
  filter: brightness(calc(1 - var(--wallpaper-dim) * 0.45));
  transition:
    var(--theme-transition),
    filter 0.35s ease;
}
#boot-screen {
  display: flex;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  transition: opacity 0.65s ease;
}
.boot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}
.boot-logo {
  width: 52px;
  height: 52px;
}
.boot-spinner {
  position: relative;
  width: 40px;
  height: 40px;
}
.boot-spinner span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  margin: -2px;
  border-radius: 50%;
  background: #fff;
  transform: rotate(calc(var(--dot-index) * 45deg)) translateY(-17px);
  animation: bootDot 1.1s linear infinite;
  animation-delay: calc(var(--dot-index) * -0.1375s);
}
.boot-spinner span:nth-child(1) { --dot-index: 0; }
.boot-spinner span:nth-child(2) { --dot-index: 1; }
.boot-spinner span:nth-child(3) { --dot-index: 2; }
.boot-spinner span:nth-child(4) { --dot-index: 3; }
.boot-spinner span:nth-child(5) { --dot-index: 4; }
.boot-spinner span:nth-child(6) { --dot-index: 5; }
.boot-spinner span:nth-child(7) { --dot-index: 6; }
.boot-spinner span:nth-child(8) { --dot-index: 7; }
@keyframes bootDot {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}
.boot-status {
  margin-top: -14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
#boot-screen.away {
  opacity: 0;
  pointer-events: none;
}
#boot-screen.gone {
  display: none;
}

/* ==================== DESKTOP ==================== */
#desktop {
  z-index: 100;
  background-color: var(--desktop-wash);
  background-image: url("bloom.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* brightness is driven by --wallpaper-dim; the inline brightness from the
     Quick Settings slider still wins because it is set on the element. */
}
#desktop.hidden {
  display: none !important;
}
#desktop.reveal {
  animation: deskIn 0.6s ease;
}
@keyframes deskIn {
  from {
    opacity: 0;
    filter: blur(10px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

/* ---------- Desktop icons (vertical columns) ---------- */
#desktop-icons {
  position: absolute;
  top: 12px;
  left: 8px;
  right: 8px;
  bottom: 60px;
}
.desk-icon {
  position: absolute;
  width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px;
  border-radius: 6px;
  cursor: default;
  text-align: center;
  touch-action: none;
  transition: background 0.12s, outline-color 0.12s;
}
.desk-icon.dragging {
  z-index: 20;
  opacity: 0.88;
  cursor: grabbing;
  transition: none;
}
.desk-icon span {
  /* Desktop labels sit on the wallpaper in both themes, so they stay white
     with a dark shadow — exactly like Windows 11. */
  color: #ffffff;
  font-family: 'Segoe UI Variable', sans-serif;
  font-size: 12px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.desk-icon:hover {
  background: rgba(255, 255, 255, 0.18);
  outline: 1px solid rgba(255, 255, 255, 0.25);
}
.desk-icon.selected {
  background: rgba(120, 190, 255, 0.35);
  outline: 1px solid rgba(160, 210, 255, 0.6);
}
.desk-icon-img {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}
.desk-icon-img > svg {
  display: block;
  flex: 0 0 auto;
}
.desk-icon-img img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

/* ==================== TASKBAR (full-width Windows 11 dock) ==================== */
#taskbar {
  width: 100%;
  height: 48px;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 9999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  font-family: "Segoe UI", "Segoe UI Variable", system-ui, sans-serif;
  background: var(--taskbar-bg);
  backdrop-filter: blur(20px) saturate(125%);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
  border-top: 1px solid var(--taskbar-border);
  box-shadow: var(--taskbar-shadow);
  color: var(--text-primary);
}

/* ---------- LEFT: Widgets / Weather ---------- */
.tb-left {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.tb-widgets {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.12s;
}
.tb-widgets:hover {
  background: var(--control-hover);
}
.tb-widgets-temp {
  font-weight: 600;
}
.tb-widgets-desc {
  opacity: 0.8;
}

/* ---------- CENTER: Pinned & running apps ---------- */
.tb-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}
.tb-btn {
  width: 40px;
  height: 38px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transform: translateY(0) scale(1);
  transform-origin: bottom center;
  color: var(--text-primary);
  transition:
    transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
    background 0.12s;
}
.tb-btn:hover {
  z-index: 2;
  transform: translateY(-10px) scale(1.4);
  background: var(--control-hover);
}
.tb-btn:active {
  background: var(--control-active);
}
.tb-btn.running {
  position: relative;
}
.tb-btn.running::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent-bright);
  transition:
    width 0.2s var(--fluent-standard, cubic-bezier(0.1, 0.9, 0.2, 1)),
    background 0.2s linear;
}
/* Focused window → long accent pill. */
.tb-btn.active::after {
  width: 16px;
  background: var(--accent);
}
/* Still running but minimized/behind → short, dimmed pill stays lit, so an
   app that is open never loses its indicator on the centered taskbar. */
.tb-btn.running.minimized::after {
  width: 6px;
  background: var(--accent);
  opacity: 0.45;
}
.tb-btn.running.minimized:hover::after {
  opacity: 1;
}

/* ---------- RIGHT: System tray & clock ---------- */
.tb-right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
  color: var(--text-primary);
}
.tray-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 8px;
  border-radius: 4px;
  color: var(--text-primary);
  transition: background 0.12s;
}
.tray-btn:hover {
  background: var(--control-hover);
}
.tray-clock {
  text-align: right;
  font-size: 0.72rem;
  line-height: 1.3;
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--text-primary);
}
.tray-clock:hover {
  background: var(--control-hover);
}
#tb-time,
#tb-date {
  font-family: "Segoe UI", "Segoe UI Variable", system-ui, sans-serif;
}
#tb-date {
  font-size: 0.72rem;
}
.show-desktop {
  width: 6px;
  height: 44px;
  margin-left: 2px;
  border-radius: 0;
  border-left: 1px solid var(--stroke);
  background: transparent;
}
.show-desktop:hover {
  background: var(--control-hover);
}

/* ==================== POPUPS ==================== */
.popup {
  position: absolute;
  z-index: 10000;
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  background: var(--flyout-bg);
  border: 1px solid var(--flyout-border);
  border-radius: 16px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2),
    opacity 0.18s ease;
}
.popup.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
/* hidden class kept for initial load */
.popup.hidden {
  display: block;
  visibility: hidden;
}
.popup.hidden:not(.open) {
  display: block;
}

/* ---------- Start Menu ---------- */
#start-menu {
  bottom: 54px;
  left: 50%;
  margin-left: -300px;
  width: 600px;
  padding: 24px 28px 0;
  display: flex;
  flex-direction: column;
}
.sm-search input {
  width: 100%;
  padding: 10px 16px;
  border-radius: 20px;
  border: 1px solid var(--stroke);
  background: var(--surface-body);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}
.sm-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.sm-section-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 20px 2px 10px;
  color: var(--text-primary);
}
.sm-pinned {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 1fr;
  gap: 6px;
}
.sm-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border-radius: 8px;
  transition: background 0.12s;
  cursor: pointer;
}
.sm-app:hover {
  background: var(--flyout-hover);
}
.sm-app-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 2rem;
}
.sm-app-icon svg {
  display: block;
  width: 36px;
  height: 36px;
}
.sm-app span {
  font-size: 0.72rem;
  color: var(--text-primary);
  text-align: center;
}
.sm-recommended {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sm-recent {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.12s;
}
.sm-recent:hover {
  background: var(--flyout-hover);
}
.sm-recent-icon {
  font-size: 1.4rem;
}
.sm-recent-name {
  font-size: 0.82rem;
}
.sm-recent-meta {
  font-size: 0.7rem;
  opacity: 0.6;
}
.sm-footer {
  margin: 18px -28px 0;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--control-hover);
  border-top: 1px solid var(--stroke-soft);
  border-radius: 0 0 16px 16px;
}
.sm-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.sm-avatar {
  width: 34px;
  height: 34px;
}
.sm-avatar::after {
  font-size: 17px;
}
.sm-brand {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-right: 12px;
}
.sm-power {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}
.sm-power:hover {
  background: var(--control-hover);
}

/* ---------- Quick Settings ---------- */
#quick-panel {
  bottom: 54px;
  right: 14px;
  width: 360px;
  padding: 18px;
  color: var(--text-primary);
}
.qs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.qs-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 76px;
  padding: 12px 6px;
  border-radius: 8px;
  background: var(--control-bg);
  border: 1px solid var(--stroke-soft);
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: center;
  color: var(--text-primary);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}
.qs-btn:hover {
  background: var(--control-hover);
}
.qs-btn svg {
  flex-shrink: 0;
}
.qs-btn.active {
  background: var(--accent);
  color: var(--accent-text-on);
  border-color: var(--accent-active);
}
.qs-btn.active:hover {
  background: var(--accent-hover);
}
/* The theme toggle card mirrors the Windows 11 "Dark mode" tile:
   a sun in Light mode, a crescent moon in Dark mode. */
.qs-btn.qs-theme .qs-theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.qs-btn.qs-theme .qs-theme-icon svg {
  transition: transform 0.35s cubic-bezier(0.1, 0.9, 0.2, 1);
}
[data-theme="dark"] .qs-btn.qs-theme .qs-theme-icon svg {
  transform: rotate(180deg);
}
/* Sun chrome is visible in Light; the moon path takes over in Dark. */
[data-theme="dark"] .qs-theme-sun,
[data-theme="dark"] .qs-theme-rays {
  display: none;
}
:root:not([data-theme="dark"]) .qs-theme-moon {
  display: none;
}
.qs-theme-hint {
  margin-top: 8px;
  font-size: 0.68rem;
  text-align: center;
  opacity: 0.7;
}
.qs-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.qs-slider .qs-ico {
  width: 20px;
  text-align: center;
  font-size: 0.9rem;
}
.qs-slider input {
  flex: 1;
  accent-color: var(--accent);
}
.qs-slider .qs-val {
  width: 40px;
  text-align: right;
  font-size: 0.7rem;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}
.qs-footer {
  margin-top: 14px;
  font-size: 0.72rem;
  opacity: 0.7;
  text-align: center;
}

/* ---------- Calendar flyout ---------- */
#calendar-panel {
  bottom: 54px;
  right: 14px;
  width: 320px;
  padding: 16px 18px 12px;
  color: var(--text-primary);
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-title {
  font-size: 0.86rem;
  font-weight: 600;
}
.cal-nav {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--text-primary);
}
.cal-nav:hover {
  background: var(--flyout-hover);
}
.cal-dow,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-dow span {
  text-align: center;
  font-size: 0.66rem;
  opacity: 0.6;
  padding-bottom: 6px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}
.cal-day.other {
  opacity: 0.32;
}
.cal-day:hover:not(.other) {
  background: var(--flyout-hover);
}
.cal-day.today {
  background: var(--accent);
  color: var(--accent-text-on);
  font-weight: 600;
}
.cal-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--stroke-soft);
  font-size: 0.74rem;
}
.cal-clock {
  font-weight: 600;
}

/* ---------- Notification centre ---------- */
#notif-panel {
  bottom: 54px;
  right: 14px;
  width: 340px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 16px 18px;
  color: var(--text-primary);
}
.np-head {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.55;
  margin: 4px 0 10px;
}
.np-empty {
  font-size: 0.78rem;
  opacity: 0.6;
  padding: 6px 0 16px;
}
.np-item {
  background: var(--control-bg);
  border: 1px solid var(--stroke-soft);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.np-item-title {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 3px;
}
.np-item-body {
  font-size: 0.74rem;
  opacity: 0.8;
}
.np-item-time {
  font-size: 0.66rem;
  opacity: 0.5;
  margin-top: 5px;
}
.np-agenda {
  font-size: 0.78rem;
  opacity: 0.6;
}

/* ---------- Night light filter ---------- */
#desktop.night-light {
  transition: filter 0.35s ease;
}
#desktop.night-light #window-layer,
#desktop.night-light #taskbar {
  filter: sepia(0.28) saturate(1.15) hue-rotate(-12deg);
}

/* ---------- Desktop refresh pulse ---------- */
@keyframes deskRefresh {
  from {
    opacity: 0.72;
  }
  to {
    opacity: 1;
  }
}
.refreshing {
  animation: deskRefresh 0.32s ease;
}

/* ---------- Toast ---------- */
#shell-toast {
  position: absolute;
  left: 50%;
  bottom: 66px;
  transform: translate(-50%, 14px);
  z-index: 10001;
  padding: 10px 18px;
  border-radius: 8px;
  background: rgba(32, 32, 32, 0.92);
  color: #fff;
  font-size: 0.78rem;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.2s ease,
    transform 0.2s cubic-bezier(0.1, 0.9, 0.2, 1);
}
#shell-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Start menu "no results" ---------- */
.sm-empty {
  grid-column: 1 / -1;
  padding: 18px 4px;
  font-size: 0.78rem;
  opacity: 0.6;
}

/* ---------- Power menu ---------- */
#power-menu {
  bottom: 54px;
  right: 60px;
  width: 180px;
  padding: 6px;
  color: var(--text-primary);
}
.pm-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
}
.pm-item:hover {
  background: var(--control-hover);
}

/* ==================== WINDOWS ==================== */
/* Fluent easing — Windows 11 uses these two curves everywhere. */
:root {
  --fluent-standard: cubic-bezier(0.1, 0.9, 0.2, 1);
  --fluent-decel: cubic-bezier(0, 0, 0, 1);
  --win-open-dur: 0.25s;
  --win-close-dur: 0.2s;
}

.window {
  position: absolute;
  min-width: 320px;
  min-height: 200px;
  background: var(--surface-window);
  color: var(--text-primary);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-window);
  display: flex;
  flex-direction: column;
  /* Continuous transition on the geometry properties is what makes
     maximize / restore / snap glide instead of jump. `transform` and
     `opacity` are here for open + close. */
  transition:
    width 0.25s cubic-bezier(0.1, 0.9, 0.2, 1),
    height 0.25s cubic-bezier(0.1, 0.9, 0.2, 1),
    top 0.25s cubic-bezier(0.1, 0.9, 0.2, 1),
    left 0.25s cubic-bezier(0.1, 0.9, 0.2, 1),
    transform 0.2s ease,
    opacity 0.2s ease;
  animation: windowOpen var(--win-open-dur) cubic-bezier(0, 0, 0, 1) both;
}

/* Open: fade in while scaling 95% → 100%, drifting up 10px. */
@keyframes windowOpen {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
/* Kept for backwards compatibility with the old class name. */
@keyframes winOpen {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Close: fade out while scaling down to 95%. */
.window.closing {
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.2s cubic-bezier(0, 0, 0, 1);
  pointer-events: none;
}

.window.minimized {
  display: none;
}

/* Maximize / restore: geometry is animated by the base `transition`
   above, but the open keyframes must be released first, otherwise the
   animation's `transform` wins and the window snaps. */
.window.maximized {
  animation: none;
  will-change: width, height, top, left;
}
.window.restoring {
  animation: none;
}
/* Snapped windows glide into their region and drop the open keyframes. */
.window.snapped {
  animation: none;
  will-change: width, height, top, left;
}

.win-titlebar {
  height: 36px;
  display: flex;
  align-items: center;
  padding-left: 14px;
  background: var(--surface-titlebar);
  cursor: default;
  flex-shrink: 0;
}
.win-title {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-primary);
}
.win-controls {
  display: flex;
  height: 100%;
}
.win-controls button {
  width: 46px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}
.win-controls button:hover {
  background: var(--control-hover);
}
.win-controls button.close:hover {
  background: #c42b1c;
  color: #fff;
}
.win-controls svg {
  width: 11px;
  height: 11px;
}

.win-body {
  flex: 1;
  overflow: auto;
  background: var(--surface-body);
  color: var(--text-primary);
}
.win-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 5;
}

/* ---------- File Explorer (Windows 11 Fluent) ---------- */
.app-explorer {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-window);
  font-size: 0.82rem;
  color: var(--text-primary);
  overflow: hidden;
}
.exp-cmdbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--stroke-soft);
  background: var(--surface-sidebar);
}
.exp-cmd {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: none;
  background: transparent;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
}
.exp-cmd:hover { background: var(--control-hover); }
.exp-cmd:active { background: var(--control-active); }
.exp-cmd-sep {
  width: 1px;
  height: 18px;
  background: var(--stroke);
  margin: 0 4px;
}
.exp-addrbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--surface-sidebar);
  border-bottom: 1px solid var(--stroke-soft);
}
.exp-crumbs {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-body);
  border: 1px solid var(--stroke-soft);
  border-radius: 4px;
  padding: 4px 8px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.exp-crumb {
  padding: 1px 5px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.78rem;
}
.exp-crumb:hover { background: var(--control-hover); }
.exp-crumb.current { color: var(--text-secondary); }
.exp-crumb-sep { color: var(--text-muted); font-size: 0.75rem; }
.exp-search {
  width: 160px;
  padding: 4px 10px;
  border: 1px solid var(--stroke-soft);
  border-radius: 4px;
  font-size: 0.78rem;
  outline: none;
  background: var(--surface-body);
  color: var(--text-primary);
}
.exp-search:focus { border-color: var(--accent); }
.exp-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.exp-nav-btn:hover:not(:disabled) { background: var(--control-hover); }
.exp-nav-btn:disabled { color: var(--text-disabled); cursor: default; }
.exp-cols { flex: 1; min-height: 0; display: flex; }
.exp-cols-main { flex: 1; display: flex; min-width: 0; }
.exp-side {
  width: 178px;
  flex-shrink: 0;
  background: var(--surface-sidebar);
  padding: 8px 6px;
  overflow-y: auto;
  border-right: 1px solid var(--stroke-soft);
}
.exp-side-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 10px 4px;
}
.exp-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}
.exp-nav-item:hover { background: var(--control-hover); }
.exp-nav-item.active { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.exp-nav-item svg { flex-shrink: 0; }
.exp-main {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  overflow-y: auto;
}
.exp-section-title {
  font-weight: 600;
  font-size: 0.8rem;
  margin: 4px 0 10px;
}
.exp-folder-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.exp-item {
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px;
  border-radius: 5px;
  cursor: pointer;
  text-align: center;
  user-select: none;
}
.exp-item:hover { background: var(--control-hover); }
.exp-item.selected { background: color-mix(in srgb, var(--accent) 16%, transparent); outline: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.exp-item span {
  font-size: 0.74rem;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exp-rename-input {
  width: 100%;
  min-width: 0;
  padding: 3px 4px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--surface-body);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.72rem;
  text-align: center;
  outline: none;
}
.exp-item svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15)); }
.exp-drive-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 5px;
  cursor: pointer;
  max-width: 420px;
}
.exp-drive-row:hover { background: var(--control-hover); }
.exp-drive-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  font-size: 0.78rem;
}
.exp-drive-bar {
  height: 12px;
  width: 220px;
  max-width: 100%;
  background: var(--control-active);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--stroke-soft);
}
.exp-drive-bar div {
  height: 100%;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
}
.exp-drive-free { font-size: 0.7rem; color: var(--text-muted); }
.exp-statusbar {
  padding: 4px 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--stroke-soft);
  background: var(--surface-sidebar);
}
.app-terminal {
  background: #0c0c0c;
  color: #ccc;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.85rem;
  padding: 10px;
  height: 100%;
  cursor: text;
}
.app-terminal pre {
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  font-family: inherit;
  user-select: text;
  -webkit-user-select: text;
}
.app-notepad textarea {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  padding: 12px;
  font-size: 0.9rem;
  font-family: inherit;
  background: transparent;
  color: var(--text-primary);
  user-select: text;
  -webkit-user-select: text;
}
/* ---------- Google Chrome browser (Fluent + Google home) ---------- */
.app-chrome {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
}
.chrome-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: #f1f1f1;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.chrome-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 50%;
  color: #5f6368;
  cursor: pointer;
  flex-shrink: 0;
}
.chrome-nav:hover:not(:disabled) { background: rgba(0, 0, 0, 0.07); }
.chrome-nav:disabled { color: #b5b5b5; cursor: default; }
.chrome-urlbar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 5px 14px;
  min-width: 0;
}
.chrome-urlbar span {
  font-size: 0.78rem;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chrome-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
}

/* Google-style page */
.chrome-page {
  min-height: 100%;
  box-sizing: border-box;
}
.chrome-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12%;
}
.chrome-logo { margin-bottom: 26px; }
.google-wordmark {
  display: inline-flex;
  font-family: Arial, sans-serif;
  font-size: 4rem;
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 1;
}
.google-wordmark span:nth-child(1),
.google-wordmark span:nth-child(4) { color: #4285f4; }
.google-wordmark span:nth-child(2),
.google-wordmark span:nth-child(6) { color: #ea4335; }
.google-wordmark span:nth-child(3) { color: #fbbc05; }
.google-wordmark span:nth-child(5) { color: #34a853; }
.chrome-searchwrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(560px, 86%);
  padding: 0 18px;
  height: 46px;
  border: 1px solid #dfe1e5;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.12);
}
.chrome-searchwrap:focus-within { box-shadow: 0 1px 10px rgba(32, 33, 36, 0.2); }
.chrome-searchwrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: #202124;
  background: transparent;
  min-width: 0;
}
.chrome-btnrow {
  position: relative;
  z-index: 21;
  display: flex;
  gap: 12px;
  margin-top: 28px;
}
.chrome-btnrow button {
  padding: 9px 18px;
  border: 1px solid #f1f3f4;
  border-radius: 4px;
  background: #f8f9fa;
  color: #3c4043;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
}
.chrome-btnrow button:hover {
  border-color: #dadce0;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2);
}

.chrome-search-results {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #fff;
}
.chrome-search-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8f9fa;
  color: #3c4043;
  font-size: 0.8rem;
}
.chrome-search-results-head strong {
  color: #3c4043;
  font-weight: 600;
  white-space: nowrap;
}
.chrome-search-results-head span {
  min-width: 0;
  overflow: hidden;
  color: #5f6368;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chrome-search-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}
.chrome-search-frame.video-search-frame {
  background: #111;
}
.chrome-embed-note {
  padding: 9px 14px;
  background: #f8f9fa;
  color: #5f6368;
  font-size: 0.75rem;
}
.app-settings {
  /* Settings now follows the global theme tokens, so it re-skins the
     moment <html data-theme> flips — no per-window .dark class needed. */
  --settings-bg: var(--surface-sidebar);
  --settings-surface: var(--surface-body);
  --settings-text: var(--text-primary);
  --settings-muted: var(--text-muted);
  --settings-accent: var(--accent);
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  overflow: hidden;
  background: var(--settings-bg);
  color: var(--settings-text);
  font: 14px "Segoe UI Variable", "Segoe UI", sans-serif;
  transition: var(--theme-transition);
}
.settings-sidebar {
  width: 270px;
  min-width: 230px;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  overflow: auto;
  background: var(--settings-bg);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.settings-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px 17px;
}
.settings-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d9e8f6;
  font-size: 24px;
}
.settings-profile strong, .settings-profile span {
  display: block;
}
.settings-profile strong { font-size: 15px; font-weight: 600; }
.settings-profile span { margin-top: 3px; color: var(--settings-muted); font-size: 12px; }
.settings-search {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 1px solid #888;
  border-radius: 4px;
  background: var(--settings-surface);
}
.settings-search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.settings-search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.settings-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 15px;
}
.settings-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background 120ms ease;
}
.settings-nav-item:hover { background: var(--control-hover); }
.settings-nav-item.active { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.settings-nav-item.active::before {
  position: absolute;
  left: 0;
  width: 3px;
  height: 22px;
  border-radius: 3px;
  background: var(--settings-accent);
  content: "";
}
.settings-nav-item svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.settings-main {
  flex: 1;
  min-width: 0;
  overflow: auto;
  background: var(--settings-surface);
}
.settings-page {
  width: min(100%, 950px);
  margin: 0 auto;
  padding: 28px clamp(22px, 4vw, 54px) 44px;
}
.settings-hero {
  min-height: 150px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 26px 30px;
  border: 1px solid var(--stroke-soft);
  border-radius: 8px;
  background: linear-gradient(115deg, #eaf4fd, #f4f8fc 63%, #e8f2fa);
}
[data-theme="dark"] .settings-hero {
  background: linear-gradient(115deg, #263744, #30383f);
}
.settings-device-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d5eafa;
  color: #0067b8;
}
.settings-device-mark svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.settings-device-copy { flex: 1; }
.settings-device-copy h1 { margin: 0; font-size: 26px; font-weight: 600; }
.settings-device-copy p { margin: 6px 0 0; color: var(--settings-muted); font-size: 13px; }
.settings-update-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid #c7e4d0;
  border-radius: 18px;
  background: #f2fbf4;
  color: #246b36;
  font-size: 12px;
  white-space: nowrap;
}
.settings-update-badge span { width: 8px; height: 8px; border-radius: 50%; background: #2aa34a; }
.settings-section-heading { margin: 28px 0 14px; font-size: 21px; font-weight: 600; }
.settings-page > h1 { margin: 4px 0 4px; font-size: 28px; font-weight: 600; }
.settings-page-description { margin: 0 0 20px; color: var(--settings-muted); }
.settings-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.settings-card {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--stroke-soft);
  border-radius: 8px;
  background: var(--settings-surface);
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background 130ms ease, border-color 130ms ease, box-shadow 130ms ease;
}
.settings-card:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--settings-surface));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}
.settings-card-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.settings-card-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.settings-card-copy { flex: 1; min-width: 0; }
.settings-card-copy strong, .settings-card-copy > span { display: block; }
.settings-card-copy strong { margin-bottom: 4px; font-size: 15px; font-weight: 600; }
.settings-card-copy > span { color: var(--settings-muted); font-size: 12px; line-height: 1.35; }
.settings-card-arrow { color: var(--text-muted); font-size: 24px; }
.settings-empty { grid-column: 1 / -1; padding: 12px 0; color: var(--settings-muted); }
.settings-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 22px;
  padding: 6px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--settings-accent);
  font: inherit;
  cursor: pointer;
}
.settings-back:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.settings-back:first-letter { font-size: 22px; }
.settings-detail-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.settings-detail-heading > svg { width: 42px; height: 42px; fill: none; stroke: var(--settings-accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.settings-detail-heading h1 { margin: 0; font-size: 26px; font-weight: 600; }
.settings-detail-heading p { margin: 4px 0 0; color: var(--settings-muted); }
.settings-detail-panel { max-width: 680px; padding: 20px 22px; border: 1px solid var(--stroke-soft); border-radius: 8px; }
.settings-detail-panel h2 { margin: 0 0 14px; font-size: 17px; font-weight: 600; }
.settings-detail-panel p { color: var(--settings-muted); }
.settings-detail-panel select { min-width: 210px; padding: 8px 10px; border: 1px solid var(--stroke-strong); border-radius: 4px; background: var(--settings-surface); color: inherit; font: inherit; }

/* ---------- Personalization: theme picker cards ---------- */
.theme-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  max-width: 560px;
  margin: 4px 0 18px;
}
.theme-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--settings-surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: var(--theme-transition), transform 0.12s ease;
}
.theme-card:hover { transform: translateY(-1px); }
.theme-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.theme-card-preview {
  height: 84px;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}
.theme-card-preview::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 34%;
}
.theme-card-preview::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18%;
}
.theme-card-preview.light {
  background: linear-gradient(135deg, #6cc5ff, #0b6bbd 60%, #0a4f8a);
}
.theme-card-preview.light::before { background: #ffffff; }
.theme-card-preview.light::after { background: rgba(243, 243, 243, 0.92); }
.theme-card-preview.dark {
  background: linear-gradient(135deg, #2b2b2b, #101010 60%, #050505);
}
.theme-card-preview.dark::before { background: #202020; }
.theme-card-preview.dark::after { background: rgba(28, 28, 28, 0.92); }
.theme-card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.theme-card-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--stroke-strong);
  color: transparent;
  font-size: 11px;
}
.theme-card.selected .theme-card-check {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text-on);
}
.settings-control-row, .settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 0;
  border-top: 1px solid var(--stroke-soft);
}
.settings-control-row input[type="range"] { width: min(48%, 280px); accent-color: var(--accent); }
.settings-toggle-row span strong, .settings-toggle-row span small { display: block; }
.settings-toggle-row span small { margin-top: 4px; color: var(--settings-muted); }
.settings-toggle-row input { width: 38px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.settings-storage-meter { height: 9px; overflow: hidden; border-radius: 8px; background: var(--control-active); }
.settings-storage-meter span { display: block; width: 34%; height: 100%; border-radius: inherit; background: var(--accent); }
.settings-action { padding: 8px 14px; border: 0; border-radius: 4px; background: var(--accent); color: var(--accent-text-on); font: inherit; cursor: pointer; }
.settings-action:hover { background: var(--accent-hover); }

/* ---------- Personalization › Themes / Colors: sun-moon theme toggle ---------- */
.theme-glyph {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
}
.theme-current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--settings-muted);
}
.theme-state-value {
  color: var(--settings-text);
  font-weight: 600;
}
/* ==================== WINDOWS 10 CONTROL PANEL ==================== */
.control-panel {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-body);
  color: var(--text-primary);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  transition: var(--theme-transition);
}
.cp-toolbar {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 14px;
  border-bottom: 1px solid var(--stroke-soft);
  background: var(--surface-sidebar);
}
.cp-nav { display: flex; gap: 3px; }
.cp-nav button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text-secondary);
  font: 22px/1 "Segoe UI", sans-serif;
  cursor: pointer;
}
.cp-nav button:hover:not(:disabled) { background: var(--control-hover); }
.cp-nav button:disabled { color: var(--text-disabled); cursor: default; }
.cp-breadcrumb {
  flex: 1;
  min-width: 90px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  color: var(--text-secondary);
}
.cp-breadcrumb span:last-child { overflow: hidden; text-overflow: ellipsis; }
.cp-crumb-sep { color: var(--text-muted); }
.cp-search-wrap {
  width: 225px;
  max-width: 35%;
  display: flex;
  align-items: center;
  border: 1px solid var(--stroke-strong);
  background: var(--surface-body);
}
.cp-search-wrap:focus-within { border-color: var(--accent); }
.cp-search-wrap input {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border: 0;
  outline: 0;
  font: inherit;
  background: transparent;
  color: var(--text-primary);
}
.cp-search-wrap span { padding: 0 8px; color: var(--text-muted); font-size: 18px; }
.cp-options {
  min-height: 36px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  background: var(--surface-body);
}
.cp-options select {
  min-width: 112px;
  padding: 3px 5px;
  border: 1px solid var(--stroke-strong);
  background: var(--surface-card);
  color: var(--text-primary);
  font: inherit;
}
.cp-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 26px 24px;
}
.cp-categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  column-gap: 48px;
  row-gap: 28px;
  max-width: 900px;
}
.cp-category { min-width: 0; }
.cp-category-title {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 0 0 7px;
  border: 0;
  border-bottom: 1px solid var(--stroke);
  background: transparent;
  color: var(--accent);
  text-align: left;
  font: 20px "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}
.cp-category-title:hover span, .cp-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
.cp-category-title svg { flex: 0 0 auto; }
.cp-category-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 9px 0 0 49px;
}
.cp-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  text-align: left;
  font: inherit;
  line-height: 1.35;
  cursor: pointer;
}
.cp-link svg { flex: 0 0 auto; }
.cp-category-page h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--text-primary);
  font-size: 23px;
  font-weight: 400;
}
.cp-category-page .cp-category-links { padding-left: 54px; gap: 12px; }
.cp-no-results { grid-column: 1 / -1; color: var(--text-muted); }
.cp-applets {
  display: grid;
  align-content: start;
  justify-content: start;
}
.cp-applets.large {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 7px 16px;
}
.cp-applets.small {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 2px 12px;
}
.cp-applet {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--accent);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.cp-applet:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.cp-applet svg { flex: 0 0 auto; }
.cp-applets.small .cp-applet { gap: 7px; padding: 4px 6px; }
.cp-detail {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  max-width: 700px;
  padding: 15px 10px;
}
.cp-detail-icon { flex: 0 0 auto; }
.cp-detail h1, .cp-programs h1 {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 23px;
  font-weight: 400;
}
.cp-detail p, .cp-programs > p { color: var(--text-muted); line-height: 1.5; }
.cp-programs { max-width: 840px; }
.cp-programs > p { margin: 0 0 16px; }
.cp-program-toolbar {
  display: flex;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--stroke);
  border-bottom: 0;
  background: var(--surface-sidebar);
}
.cp-program-toolbar button {
  padding: 5px 12px;
  border: 1px solid var(--stroke-strong);
  border-radius: 2px;
  background: var(--control-bg);
  color: var(--text-primary);
  font: inherit;
}
.cp-program-toolbar button:disabled { color: var(--text-disabled); }
.cp-program-table { border: 1px solid var(--stroke); }
.cp-program-row {
  display: grid;
  grid-template-columns: 1.6fr 1.2fr 0.5fr;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--stroke-soft);
  background: var(--surface-body);
  color: var(--text-primary);
  text-align: left;
  font: inherit;
}
button.cp-program-row { cursor: pointer; }
button.cp-program-row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
button.cp-program-row.selected {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  outline: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
}
.cp-program-heading { background: var(--surface-sidebar); font-weight: 600; }
@media (max-width: 700px) {
  .cp-toolbar { gap: 6px; padding-inline: 8px; }
  .cp-search-wrap { width: 165px; }
  .cp-content { padding: 14px; }
  .cp-categories { grid-template-columns: 1fr; }
  .cp-category-title { font-size: 18px; }
}
.app-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
}
.ph-icon {
  font-size: 3rem;
}
.ph-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.ph-sub {
  font-size: 0.78rem;
  opacity: 0.65;
}

/* ==================== MINECRAFT APP ==================== */

/* ---------- Grass block icon (desktop + start menu + titlebar) ---------- */
.mc-block {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  position: relative;
  background: linear-gradient(180deg, #6faa3c 0 28%, #7c4a2a 28% 100%);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.25),
    inset 0 -8px 12px rgba(0, 0, 0, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.35);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
  image-rendering: pixelated;
}
/* grass overhang strip */
.mc-block::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 24%;
  height: 8%;
  background: #5e9030;
}
/* dirt speckles */
.mc-block::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 28%;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 30%, #8f5a35 0 12%, transparent 14%),
    radial-gradient(circle at 65% 55%, #63381e 0 12%, transparent 14%),
    radial-gradient(circle at 40% 75%, #8f5a35 0 12%, transparent 14%),
    radial-gradient(circle at 82% 82%, #63381e 0 10%, transparent 12%);
}
.sm-app-icon .mc-block {
  width: 36px;
  height: 36px;
}
.win-title .mc-block {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.desk-icon-img .mc-block {
  width: 46px;
  height: 46px;
}

/* ---------- Dark Fluent window frame ----------
   `.window.dark` is an explicit per-app request (e.g. Minecraft) to stay
   dark regardless of the system theme. */
.window.dark {
  background: #202020;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.window.dark .win-titlebar {
  background: #1c1c1c;
  color: #fff;
}
.window.dark .win-title {
  color: #fff;
}
.window.dark .win-controls button {
  color: #fff;
}
.window.dark .win-controls button:hover {
  background: rgba(255, 255, 255, 0.08);
}
.window.dark .win-controls button.close:hover {
  background: #c42b1c;
  color: #fff;
}
.window.dark .win-body {
  background: #101010;
}

/* ---------- Explicit LIGHT theme overrides ----------
   When the system theme is Light these pin the surfaces back to light
   values, overriding the .window.dark rules above for a window that opts
   in with `.window.force-light` (kept for completeness / future apps). */
[data-theme="light"] .window.force-light {
  background: #f9f9f9;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ---------- Minecraft window body ---------- */
.app-minecraft {
  position: relative;
  height: 100%;
  background: #101010;
  overflow: hidden;
}
.mc-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #101010;
}
/* ---------- Minecraft dark loader overlay ---------- */
.mc-loader {
  position: absolute;
  inset: 0;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: auto;
}
.mc-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}
.mc-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  user-select: none;
}
.mc-loader-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mc-logo-text {
  font-family: 'Segoe UI Black', Impact, sans-serif;
  font-size: 2.4rem;
  letter-spacing: 0.22em;
  font-weight: 900;
  color: #f1f1f1;
  text-shadow: 3px 3px 0 #2b2b2b, -2px -2px 0 #111;
  text-transform: uppercase;
}

/* Windows 11 style smooth indeterminate dot spinner */
.win11-spinner {
  position: relative;
  width: 44px;
  height: 44px;
}
.win11-spinner-dot {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: win11Spin 3.5s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}
.win11-spinner-dot::after {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #60cdff;
  box-shadow: 0 0 6px rgba(96, 205, 255, 0.6);
}
.win11-spinner-dot:nth-child(1) { animation-delay: 0.12s; }
.win11-spinner-dot:nth-child(2) { animation-delay: 0.24s; }
.win11-spinner-dot:nth-child(3) { animation-delay: 0.36s; }
.win11-spinner-dot:nth-child(4) { animation-delay: 0.48s; }
.win11-spinner-dot:nth-child(5) { animation-delay: 0.60s; }
.win11-spinner-dot:nth-child(6) { animation-delay: 0.72s; }

@keyframes win11Spin {
  0% {
    transform: rotate(0deg);
    opacity: 1;
  }
  70% {
    transform: rotate(720deg);
    opacity: 1;
  }
  75% {
    opacity: 0;
  }
  100% {
    transform: rotate(720deg);
    opacity: 0;
  }
}

/* ---------- In-window fullscreen (F11 / title-bar button) ---------- */
.window.win-fullscreen {
  position: fixed;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  top: 0 !important;
  z-index: 9998;
  border-radius: 0;
  border: none;
  animation: none;
}
.window.win-fullscreen .win-titlebar {
  height: 32px;
}

/* ============================================================
   WINDOWS 11 CONTEXT MENU
   ============================================================ */
.ctx-menu {
  position: fixed;
  z-index: 10002;
  min-width: 220px;
  padding: 5px;
  border-radius: 8px;
  background: var(--flyout-bg);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--flyout-border);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
  font-size: 0.79rem;
  /* Fluent entrance: scale up from the corner plus a slight rise. */
  transform-origin: top left;
  animation: ctxIn 0.14s cubic-bezier(0.1, 0.9, 0.2, 1);
}
.jump-list {
  position: fixed;
  z-index: 10005;
  min-width: 190px;
  padding: 5px;
  border: 1px solid var(--flyout-border);
  border-radius: 9px;
  background: var(--flyout-bg);
  color: var(--text-primary);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  animation: ctxIn 0.14s cubic-bezier(0.1, 0.9, 0.2, 1);
}
.jump-list.hidden { display: none; }
.jump-list-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border-radius: 5px;
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  white-space: nowrap;
}
.jump-list-item:hover:not(:disabled) { background: var(--flyout-hover); }
.jump-list-item:disabled { opacity: 0.4; cursor: default; }
.ctx-menu.hidden {
  display: none;
}
@keyframes ctxIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 10px 0 8px;
  border-radius: 5px;
  cursor: default;
  white-space: nowrap;
}
.ctx-item:hover {
  background: var(--flyout-hover);
}
.ctx-item.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.ctx-ico {
  width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.72rem;
}
.ctx-arrow {
  margin-left: auto;
  opacity: 0.55;
  font-size: 0.9rem;
  line-height: 1;
}
.ctx-sep {
  height: 1px;
  margin: 5px 8px;
  background: var(--stroke);
}
/* Cascading submenu (View / Sort by / New) */
.ctx-sub {
  position: absolute;
  z-index: 10003;
  min-width: 190px;
  padding: 5px;
  border-radius: 8px;
  background: var(--flyout-bg);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--flyout-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  display: none;
}
/* Opened by the JS mouseover handler. JS owns this state (rather than a
   pure :hover rule) so the cascade stays open while the pointer travels
   from the parent row into the submenu. */
.ctx-menu.sub-open .ctx-sub {
  display: block;
}

/* ============================================================
   EXPLORER — file grid, glyphs, empty state
   ============================================================ */
.exp-folder-grid.size-small .exp-item {
  width: 96px;
  font-size: 0.72rem;
}
.exp-folder-grid.size-large .exp-item {
  width: 130px;
  font-size: 0.82rem;
}
.exp-file-glyph {
  line-height: 1;
  display: block;
}
.exp-item.selected {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  outline: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.exp-empty {
  padding: 40px 8px;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.55;
}

/* ============================================================
   CHROME — omnibox address bar + result pages
   ============================================================ */
.chrome-urlbar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  background: #f1f3f4;
  min-width: 0;
}
.chrome-urlbar:focus-within {
  background: #fff;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.22);
}
.chrome-urlbar input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.78rem;
  color: #202124;
  font-family: inherit;
}
.chrome-urlbar input.is-home {
  color: #5f6368;
}
.chrome-lock {
  flex-shrink: 0;
}

/* ---------- SERP: Google results header (logo + search + tabs) ---------- */
.chrome-serp {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #fff;
  color: #202124;
  font-family: Arial, "Segoe UI", sans-serif;
}
.serp-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px 0;
  background: #fff;
  border-bottom: 1px solid #ebebeb;
}
.serp-toprow {
  display: flex;
  align-items: center;
  gap: 22px;
}
.serp-logo {
  flex: 0 0 auto;
  font-size: 1.7rem;
}
.serp-searchbox {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 690px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid #dfe1e5;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.1);
}
.serp-searchbox:focus-within {
  box-shadow: 0 1px 10px rgba(32, 33, 36, 0.2);
}
.serp-searchbox input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.92rem;
  color: #202124;
  font-family: inherit;
}
.serp-searchbox svg { flex: 0 0 auto; }
.serp-user {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  flex: 0 0 auto;
}
.serp-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}
.serp-tab {
  position: relative;
  padding: 9px 12px 12px;
  border: 0;
  background: transparent;
  color: #5f6368;
  font: inherit;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
}
.serp-tab:hover { color: #202124; }
.serp-tab.active {
  color: #1a73e8;
  font-weight: 600;
}
.serp-tab.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #1a73e8;
}

/* ---------- SERP body / layout ---------- */
.serp-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 26px;
  padding: 16px 24px 40px;
}
.serp-results {
  flex: 1;
  min-width: 0;
  max-width: 660px;
}
.serp-side {
  width: 300px;
  flex: 0 0 auto;
}
@media (max-width: 900px) {
  .serp-side { display: none; }
}
.serp-stats {
  margin-bottom: 12px;
  color: #70757a;
  font-size: 0.75rem;
}

/* Highlighted "direct site match" card */
.serp-direct {
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid #dadce0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.1);
}
.serp-direct-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.serp-direct-favicon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f1f3f4;
  font-size: 15px;
  flex: 0 0 auto;
}
.serp-direct-titles { min-width: 0; }
.serp-direct-titles strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #202124;
}
.serp-direct-titles span {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: #5f6368;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.serp-direct-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.serp-action {
  padding: 8px 16px;
  border: 1px solid #dadce0;
  border-radius: 18px;
  background: #fff;
  color: #1a73e8;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.serp-action:hover {
  border-color: #c6dafc;
  background: #f8fbff;
}
.serp-action.primary {
  border-color: #1a73e8;
  background: #1a73e8;
  color: #fff;
}
.serp-action.primary:hover { background: #1669d1; }
.serp-video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.serp-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Organic results */
.serp-result {
  margin-bottom: 26px;
  max-width: 620px;
}
.serp-result-cite {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.75rem;
  color: #5f6368;
  line-height: 1.3;
}
.serp-result-cite .serp-favicon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f1f3f4;
  font-size: 11px;
  flex: 0 0 auto;
}
.serp-result-cite .serp-cite-lines { min-width: 0; }
.serp-result-cite .serp-cite-host {
  display: block;
  color: #202124;
  font-size: 0.78rem;
}
.serp-result-cite .serp-cite-url {
  display: block;
  color: #4d5156;
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.serp-result-title {
  display: inline-block;
  margin-bottom: 4px;
  color: #1a0dab;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}
.serp-result-title:hover { text-decoration: underline; }
.serp-result-snippet {
  margin: 0;
  color: #4d5156;
  font-size: 0.82rem;
  line-height: 1.58;
}
.serp-result-snippet em {
  color: #202124;
  font-style: normal;
  font-weight: 600;
}
.serp-sitelinks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 8px;
}
.serp-sitelink {
  padding: 0;
  border: 0;
  background: transparent;
  color: #1a0dab;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.serp-sitelink:hover { text-decoration: underline; }

/* Video carousel (Images/Videos tabs + inline section) */
.serp-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 26px 0 12px;
  color: #202124;
  font-size: 1rem;
  font-weight: 600;
}
.serp-section-head::before {
  content: "▶";
  color: #ea4335;
  font-size: 0.8rem;
}
.serp-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 160px;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 10px;
  overflow-x: auto;
}
.serp-video-card { cursor: pointer; }
.serp-video-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #3c4043, #202124);
}
.serp-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.serp-video-thumb .serp-video-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.serp-video-thumb .serp-video-play span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 13px;
  padding-left: 3px;
}
.serp-video-meta {
  margin-top: 7px;
  font-size: 0.74rem;
  color: #5f6368;
  line-height: 1.4;
}
.serp-video-meta strong {
  display: block;
  color: #202124;
  font-weight: 500;
  font-size: 0.78rem;
  margin-bottom: 2px;
}
.serp-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.serp-image-card {
  border-radius: 8px;
  overflow: hidden;
  background: #f1f3f4;
  cursor: pointer;
}
.serp-image-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.serp-image-card span {
  display: block;
  padding: 6px 8px;
  font-size: 0.72rem;
  color: #3c4043;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Right rail: knowledge panel + live web fallback */
.serp-panel {
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #dadce0;
  border-radius: 12px;
  background: #fff;
}
.serp-panel h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #202124;
}
.serp-panel p {
  margin: 0 0 10px;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #4d5156;
}
.serp-panel-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 0.76rem;
}
.serp-panel-facts dt { color: #5f6368; }
.serp-panel-facts dd { margin: 0; color: #202124; }

/* Live web iframe (DuckDuckGo html fallback) */
.serp-live { margin-bottom: 24px; }
.serp-live-frame {
  width: 100%;
  height: 420px;
  border: 1px solid #dadce0;
  border-radius: 10px;
  background: #fff;
}
.serp-live-note {
  margin-top: 8px;
  font-size: 0.74rem;
  color: #70757a;
}

/* Related searches + pagination */
.serp-related {
  max-width: 620px;
  margin: 30px 0 10px;
}
.serp-related h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
}
.serp-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.serp-related-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #dadce0;
  border-radius: 20px;
  background: #fff;
  color: #202124;
  font: inherit;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}
.serp-related-chip:hover { background: #f8f9fa; }
.serp-related-chip::after { content: "🔍"; font-size: 0.75rem; }
.serp-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 26px 0 4px;
  font-size: 1.1rem;
  color: #1a73e8;
  user-select: none;
}
.serp-pagination .serp-page {
  color: #1a73e8;
  cursor: pointer;
}
.serp-pagination .serp-page.current {
  color: #202124;
  font-weight: 700;
  cursor: default;
}
.serp-noresult {
  padding: 26px 4px;
  font-size: 0.86rem;
  color: #4d5156;
}

/* Dark theme: Google keeps its own colours, so only the shell adapts. */
[data-theme="dark"] .chrome-serp {
  background: #202124;
  color: #e8eaed;
}
[data-theme="dark"] .serp-header {
  background: #202124;
  border-bottom-color: #3c4043;
}
[data-theme="dark"] .serp-searchbox {
  background: #303134;
  border-color: #5f6368;
  box-shadow: none;
}
[data-theme="dark"] .serp-searchbox input { color: #e8eaed; }
[data-theme="dark"] .serp-tab { color: #9aa0a6; }
[data-theme="dark"] .serp-tab:hover { color: #e8eaed; }
[data-theme="dark"] .serp-tab.active { color: #8ab4f8; }
[data-theme="dark"] .serp-tab.active::after { background: #8ab4f8; }
[data-theme="dark"] .serp-stats,
[data-theme="dark"] .serp-video-meta { color: #9aa0a6; }
[data-theme="dark"] .serp-result-cite .serp-favicon,
[data-theme="dark"] .serp-direct-favicon,
[data-theme="dark"] .serp-image-card { background: #303134; }
[data-theme="dark"] .serp-result-cite .serp-cite-host { color: #bdc1c6; }
[data-theme="dark"] .serp-result-cite .serp-cite-url { color: #9aa0a6; }
[data-theme="dark"] .serp-result-title,
[data-theme="dark"] .serp-sitelink { color: #8ab4f8; }
[data-theme="dark"] .serp-result-snippet { color: #bdc1c6; }
[data-theme="dark"] .serp-result-snippet em { color: #e8eaed; }
[data-theme="dark"] .serp-direct,
[data-theme="dark"] .serp-panel {
  background: #303134;
  border-color: #5f6368;
}
[data-theme="dark"] .serp-direct-titles strong,
[data-theme="dark"] .serp-related-chip,
[data-theme="dark"] .serp-panel h3,
[data-theme="dark"] .serp-section-head,
[data-theme="dark"] .serp-related h3 { color: #e8eaed; }
[data-theme="dark"] .serp-direct-titles span,
[data-theme="dark"] .serp-panel p,
[data-theme="dark"] .serp-panel-facts dd { color: #bdc1c6; }
[data-theme="dark"] .serp-action {
  background: #303134;
  border-color: #5f6368;
  color: #8ab4f8;
}
[data-theme="dark"] .serp-action:hover { background: #3c4043; }
[data-theme="dark"] .serp-action.primary {
  background: #8ab4f8;
  border-color: #8ab4f8;
  color: #202124;
}
[data-theme="dark"] .serp-related-chip { background: #303134; border-color: #5f6368; }
[data-theme="dark"] .serp-live-frame { border-color: #5f6368; background: #303134; }
[data-theme="dark"] .serp-image-card span { color: #bdc1c6; }

.chrome-site {
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.chrome-site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 14px;
  background: #f1f3f4;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.72rem;
}
.chrome-site-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.chrome-site-url {
  color: #5f6368;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chrome-save-link {
  color: #3c4043;
  font: inherit;
  white-space: nowrap;
}
.chrome-save-link:hover { color: #1a73e8; text-decoration: underline; }
.chrome-open {
  color: #1a73e8;
  text-decoration: none;
  flex-shrink: 0;
}
.chrome-open:hover {
  text-decoration: underline;
}
.chrome-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

/* ---------- Calculator ---------- */
.app-calculator {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  padding: 18px;
  color: var(--text-primary);
  background: var(--surface-window);
}
.calculator-display {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 88px;
  padding: 8px 4px 16px;
  overflow: hidden;
  font-size: clamp(2rem, 9vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  white-space: nowrap;
}
.calculator-display.calculator-error {
  font-size: 1.8rem;
}
.calculator-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(48px, 1fr));
  gap: 8px;
}
.calc-key {
  border: 1px solid var(--stroke-soft);
  border-radius: 7px;
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 1.15rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: background 0.12s ease, transform 0.08s ease;
}
.calc-key:hover {
  background: var(--control-hover);
}
.calc-key:active {
  transform: scale(0.96);
  background: var(--control-active);
}
.calc-key.utility {
  background: var(--surface-sidebar);
}
.calc-key.operator {
  color: var(--accent);
  font-size: 1.3rem;
}
.calc-key.equals {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text-on);
  font-weight: 600;
}
.calc-key.equals:hover {
  background: var(--accent-hover);
}

/* ---------- Camera ---------- */
.app-camera {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #101010;
}
.camera-preview {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #080808;
}
.camera-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.camera-status {
  position: absolute;
  bottom: 14px;
  left: 50%;
  max-width: calc(100% - 24px);
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.78rem;
  text-align: center;
  transform: translateX(-50%);
}
.camera-controls {
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  padding: 12px;
  background: #171717;
}
.camera-shutter {
  min-width: 148px;
  padding: 9px 20px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 22px;
  background: #f8f8f8;
  color: #1a1a1a;
  font-size: 0.88rem;
  font-weight: 600;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.camera-shutter:not(:disabled):hover {
  transform: scale(1.04);
}
.camera-shutter:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

/* ---------- Photos ---------- */
.app-photos {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background: var(--surface-window);
  color: var(--text-primary);
}
.photos-heading,
.media-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.photos-heading strong,
.media-heading strong { font-size: 1.08rem; }
.photos-count,
.media-heading > span { color: var(--text-secondary); font-size: 0.78rem; }
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
}
.photos-thumbnail {
  min-width: 0;
  padding: 6px;
  overflow: hidden;
  border: 1px solid var(--stroke-soft);
  border-radius: 8px;
  background: var(--surface-sidebar);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.photos-thumbnail:hover {
  z-index: 1;
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.14);
}
.photos-thumbnail img {
  display: block;
  width: 100%;
  height: 98px;
  border-radius: 5px;
  background: var(--surface-body);
  object-fit: cover;
}
.photos-thumbnail span {
  display: block;
  overflow: hidden;
  padding: 7px 3px 2px;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photos-empty,
.media-empty { padding: 28px; color: var(--text-secondary); text-align: center; }
.photo-viewer {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 58px 56px;
  background: rgba(0, 0, 0, 0.94);
}
.photo-viewer.hidden { display: none; }
.photo-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.photo-viewer-close,
.photo-viewer-nav {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(40, 40, 40, 0.78);
  color: white;
  cursor: pointer;
}
.photo-viewer-close {
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
}
.photo-viewer-nav { top: 50%; width: 40px; height: 40px; font-size: 1.8rem; transform: translateY(-50%); }
.photo-viewer-nav.previous { left: 12px; }
.photo-viewer-nav.next { right: 12px; }
.photo-viewer-caption {
  position: absolute;
  right: 12px;
  bottom: 14px;
  left: 12px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  text-align: center;
}

/* ---------- Media Player ---------- */
.app-media-player {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
  background: var(--surface-window);
  color: var(--text-primary);
}
.media-heading { flex: 0 0 auto; margin-bottom: 12px; }
.media-playback {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 145px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--stroke-soft);
  border-radius: 10px;
  background: #11151e;
}
.media-audio-view {
  display: flex;
  width: min(400px, 90%);
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.media-album-art {
  display: grid;
  width: 116px;
  height: 116px;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, #2463eb, #9b4de0);
  color: white;
  font-size: 3.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.media-audio-view audio { width: 100%; }
.media-video-view {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 145px;
  flex-direction: column;
  background: #000;
}
.media-video-view.hidden,
.media-audio-view.hidden { display: none; }
.media-video-canvas { width: 100%; min-height: 0; flex: 1 1 auto; object-fit: contain; }
.media-video-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: #171717;
  color: white;
}
.media-video-controls button {
  width: 28px;
  height: 26px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: white;
  cursor: pointer;
}
.media-video-controls button:hover { background: rgba(255, 255, 255, 0.14); }
.media-video-controls input { flex: 1; accent-color: #60a5fa; }
.media-video-controls span { min-width: 76px; font-size: 0.68rem; text-align: right; }
.media-status {
  position: absolute;
  bottom: 8px;
  left: 10px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.68rem;
  pointer-events: none;
}
.media-track-list {
  display: flex;
  flex: 0 0 auto;
  max-height: 112px;
  flex-direction: column;
  gap: 3px;
  margin-top: 10px;
  overflow: auto;
}
.media-track {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  padding: 5px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.media-track:hover,
.media-track.active { background: var(--control-hover); }
.media-track-icon { width: 20px; color: var(--accent); text-align: center; }
.media-track small { margin-left: auto; color: var(--text-secondary); }
.exp-cmd:disabled { cursor: default; opacity: 0.42; }

/* ============================================================
   NOTEPAD — toolbar + save/download
   ============================================================ */
.app-notepad-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-window);
}
.np-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--surface-titlebar);
  border-bottom: 1px solid var(--stroke-soft);
  flex-shrink: 0;
}
.np-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.74rem;
  color: var(--text-primary);
}
.np-btn:hover {
  background: var(--control-hover);
}
.np-name {
  flex: 1;
  min-width: 0;
  margin-left: auto;
  max-width: 190px;
  padding: 5px 9px;
  border: 1px solid var(--stroke);
  border-radius: 5px;
  font-size: 0.74rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface-body);
  outline: none;
}
.np-name:focus {
  border-color: var(--accent);
}
.app-notepad {
  flex: 1;
  width: 100%;
  resize: none;
  border: none;
  outline: none;
  padding: 14px 16px;
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--surface-window);
}

/* ============================================================
   DESKTOP VIEW DENSITY (context menu > View)
   ============================================================ */
#desktop-icons[data-view="small"] .desk-icon {
  width: 74px;
  font-size: 0.66rem;
}
#desktop-icons[data-view="small"] .desk-icon-img svg {
  width: 32px;
  height: 32px;
}
#desktop-icons[data-view="large"] .desk-icon {
  width: 104px;
  font-size: 0.78rem;
}
#desktop-icons[data-view="large"] .desk-icon-img svg {
  width: 60px;
  height: 60px;
}
/* ============================================================
   WINDOWS 11 SNAP LAYOUTS
   A translucent flyout that appears when the pointer rests on a
   window's Maximize button. It offers a 50/50 split, a 2/3 split
   and a 2×2 quadrant grid; hovering a zone previews it and
   clicking snaps the active window into that region.
   ============================================================ */
.snap-layouts {
  position: fixed;
  z-index: 20000;
  padding: 8px;
  border-radius: 10px;
  background: var(--flyout-bg);
  border: 1px solid var(--flyout-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top center;
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: none;
}
.snap-layouts.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.snap-grid {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.snap-option {
  display: grid;
  gap: 4px;
  width: 104px;
  height: 66px;
  padding: 4px;
  border-radius: 7px;
  background: rgba(127, 127, 127, 0.14);
  transition: background 0.12s ease;
}
.snap-option:hover {
  background: rgba(127, 127, 127, 0.22);
}
/* Layout templates for each preset. */
.snap-option[data-layout="two-columns"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}
.snap-option[data-layout="two-thirds"] {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr;
}
.snap-option[data-layout="quadrants"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.snap-zone {
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: background 0.1s ease, box-shadow 0.1s ease;
}
[data-theme="dark"] .snap-zone {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.12);
}
.snap-zone:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 10px rgba(0, 103, 192, 0.55);
}

/* ============================================================
   TASK MANAGER
   ============================================================ */
.app-taskmanager {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-body);
  color: var(--text-primary);
  font-size: 0.82rem;
}
.tm-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--stroke-soft);
  background: var(--surface-titlebar);
}
.tm-toolbar strong {
  font-weight: 600;
  font-size: 0.85rem;
}
.tm-toolbar .tm-spacer {
  flex: 1;
}
.tm-endtask {
  padding: 6px 14px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-text-on);
  font-weight: 600;
  transition: background 0.12s ease, opacity 0.12s ease;
}
.tm-endtask:hover {
  background: var(--accent-hover);
}
.tm-endtask:disabled {
  opacity: 0.45;
  cursor: default;
  background: var(--stroke-strong);
}
.tm-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 14px;
}
.tm-metric {
  background: var(--surface-card);
  border: 1px solid var(--stroke-soft);
  border-radius: 8px;
  padding: 10px 12px;
}
.tm-metric-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tm-metric-title {
  font-weight: 600;
}
.tm-metric-value {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
}
.tm-meter {
  height: 6px;
  border-radius: 3px;
  background: var(--stroke-soft);
  overflow: hidden;
}
.tm-meter > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.4s ease;
}
.tm-meter.cpu > span { background: #4cc2ff; }
.tm-meter.mem > span { background: #a56eff; }
.tm-meter.disk > span { background: #ffb02e; }
.tm-sub {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.tm-list-head {
  display: grid;
  grid-template-columns: 2.4fr 0.9fr 1fr 1fr;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid var(--stroke-soft);
  border-bottom: 1px solid var(--stroke-soft);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tm-list {
  flex: 1;
  overflow: auto;
}
.tm-row {
  display: grid;
  grid-template-columns: 2.4fr 0.9fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 9px 16px;
  cursor: default;
  border-bottom: 1px solid var(--stroke-soft);
}
.tm-row:hover {
  background: var(--control-hover);
}
.tm-row.selected {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}
.tm-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.tm-name-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.tm-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tm-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
.tm-empty {
  padding: 26px 16px;
  text-align: center;
  color: var(--text-muted);
}/* ============================================================
   PERSONALIZATION: WALLPAPER PICKER
   A responsive grid of built-in Windows 11 wallpapers shown on
   Settings › Personalization and on the Background detail page.
   ============================================================ */
.wallpaper-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 8px 0 20px;
}
.wallpaper-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--surface-card);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.wallpaper-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.wallpaper-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.wallpaper-thumb {
  height: 88px;
  border-radius: 5px;
  background-size: cover;
  background-position: center;
  background-color: var(--stroke-soft);
}
.wallpaper-card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-primary);
}
.wallpaper-card-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--stroke-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: transparent;
  flex-shrink: 0;
}
.wallpaper-card.selected .wallpaper-card-check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text-on);
}

/* Recommended: show a friendly empty state when there is no history. */
.sm-recent-empty {
  padding: 10px 12px;
  font-size: 0.76rem;
  color: var(--text-muted);
}
.sm-recent {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  font: inherit;
}/* ============================================================
   DRAG-TO-SNAP EDGE PREVIEW
   A translucent overlay that appears when a dragged window nears
   the left/right screen edge, previewing the half-screen target.
   ============================================================ */
.snap-preview {
  position: fixed;
  z-index: 15000;
  pointer-events: none;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: inset 0 0 40px color-mix(in srgb, var(--accent) 22%, transparent);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity 0.12s ease;
  opacity: 0;
}
.snap-preview.show {
  opacity: 1;
}

/* ============================================================
   FILE EXPLORER: UPLOAD FILE
   ============================================================ */
.fs-upload-input {
  display: none;
}
.exp-cmd.accent {
  color: var(--accent);
}

/* ============================================================
   MICROSOFT STORE
   ============================================================ */
.app-store {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-body);
  color: var(--text-primary);
}
.store-hero {
  padding: 20px 22px 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #7b2ff7 130%);
  color: #fff;
}
.store-hero h1 {
  margin: 0 0 4px;
  font-size: 1.3rem;
}
.store-hero p {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.9;
}
.store-grid {
  flex: 1;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  padding: 18px 22px;
}
.store-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--stroke-soft);
  border-radius: 10px;
  background: var(--surface-card);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.store-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}
.store-card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  border-radius: 12px;
  background: var(--control-hover);
}
.store-card-title {
  font-weight: 600;
  font-size: 0.9rem;
}
.store-card-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  flex: 1;
}
.store-btn {
  align-self: flex-start;
  padding: 6px 18px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-text-on);
  font-weight: 600;
  font-size: 0.78rem;
  transition: background 0.12s ease;
}
.store-btn:hover {
  background: var(--accent-hover);
}
.store-btn.installed {
  background: var(--stroke-soft);
  color: var(--text-secondary);
}
.store-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--stroke-soft);
  overflow: hidden;
}
.store-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s linear;
}

/* ============================================================
   WIDGETS BOARD (sliding acrylic left panel)
   ============================================================ */
.widgets-scrim {
  position: absolute;
  inset: 0;
  z-index: 8998;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.widgets-scrim.show {
  opacity: 1;
}
.widgets-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: var(--taskbar-h);
  width: 360px;
  max-width: 88vw;
  z-index: 8999;
  display: flex;
  flex-direction: column;
  background: var(--flyout-bg);
  border-right: 1px solid var(--flyout-border);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  color: var(--text-primary);
  transform: translateX(-105%);
  transition: transform 0.28s cubic-bezier(0.1, 0.9, 0.2, 1);
}
.widgets-panel.open {
  transform: translateX(0);
}
.wg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  font-size: 1.05rem;
}
.wg-close {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 18px;
  color: var(--text-primary);
}
.wg-close:hover {
  background: var(--control-hover);
}
.wg-body {
  flex: 1;
  overflow: auto;
  padding: 0 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wg-card {
  background: var(--surface-card);
  border: 1px solid var(--stroke-soft);
  border-radius: 12px;
  padding: 14px;
}
.wg-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 10px;
}
.wg-clock {
  font-size: 2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.wg-clock-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.wg-clock-tz {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.wg-todo-add {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.wg-todo-add input {
  flex: 1;
  min-width: 0;
  padding: 6px 9px;
  border-radius: 5px;
  border: 1px solid var(--stroke);
  background: var(--surface-body);
  color: var(--text-primary);
  font-size: 0.8rem;
}
.wg-todo-add button {
  padding: 6px 12px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--accent-text-on);
  font-weight: 600;
  font-size: 0.78rem;
}
.wg-todo-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wg-todo-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 6px;
  border-radius: 6px;
  font-size: 0.82rem;
}
.wg-todo-item:hover {
  background: var(--control-hover);
}
.wg-todo-item input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.wg-todo-item span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wg-todo-item.done span {
  text-decoration: line-through;
  opacity: 0.55;
}
.wg-todo-del {
  color: var(--text-muted);
  font-size: 15px;
  padding: 0 4px;
  opacity: 0;
}
.wg-todo-item:hover .wg-todo-del {
  opacity: 1;
}
.wg-notes {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.5;
  outline: none;
}
.wg-empty {
  font-size: 0.76rem;
  color: var(--text-muted);
  padding: 4px 6px;
}

/* Store-installed app icons inherit the app icon markup. */
.desk-icon-img .installed-glyph {
  font-size: 40px;
  line-height: 1;
}/* Native <video> used by Media Player for real imported video files. */
.media-video-el {
  width: 100%;
  max-height: 320px;
  border-radius: 8px;
  background: #000;
  display: block;
}
.media-video-el.hidden {
  display: none !important;
}/* ============================================================
   STORE MINI-APPS (installed web apps)
   ============================================================ */
.store-mini-app {
  height: 100%;
  padding: 18px;
  overflow: auto;
  background: var(--surface-body);
  color: var(--text-primary);
}
.weather-now {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #4cc2ff 130%);
  color: #fff;
  margin-bottom: 14px;
}
.weather-big {
  font-size: 48px;
}
.weather-now strong {
  font-size: 1.8rem;
}
.weather-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.weather-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-card);
  border: 1px solid var(--stroke-soft);
  font-size: 0.85rem;
}
.game-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
}
.game-app canvas {
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  max-width: 100%;
  outline: none;
}
.game-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}
.todo-app .todo-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}
.paint-app {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.paint-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.paint-tools input[type="color"] {
  width: 34px;
  height: 30px;
  border: 1px solid var(--stroke);
  border-radius: 5px;
  background: transparent;
}
.paint-tools button {
  padding: 6px 12px;
  border-radius: 5px;
  border: 1px solid var(--stroke);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 0.78rem;
}
.paint-tools button:hover {
  background: var(--control-hover);
}
.paint-canvas {
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: #fff;
  cursor: crosshair;
  max-width: 100%;
}
.clock-app .world-clock-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* The widget timezone select. */
.wg-clock-tz select {
  margin-left: 6px;
  padding: 4px 6px;
  border-radius: 5px;
  border: 1px solid var(--stroke);
  background: var(--surface-body);
  color: var(--text-primary);
  font-size: 0.76rem;
}/* ============================================================
   PAINT APP — full canvas editor
   ============================================================ */
.paint-app {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 12px;
  background: var(--surface-body);
}
.paint-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.paint-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--stroke);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.paint-tool:hover {
  background: var(--control-hover);
}
.paint-tool.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text-on);
}
.paint-tool svg {
  width: 15px;
  height: 15px;
}
.paint-swatches {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.paint-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px var(--stroke);
  cursor: pointer;
  padding: 0;
}
.paint-swatch.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--accent);
}
.paint-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-secondary);
}
.paint-field input[type="range"] {
  width: 110px;
  accent-color: var(--accent);
}
.paint-field input[type="color"] {
  width: 34px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--stroke);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.paint-spacer {
  flex: 1;
}
.paint-canvas-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-conic-gradient(#e8e8e8 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  overflow: auto;
}
.paint-canvas {
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  max-width: 100%;
}

/* ============================================================
   MINESWEEPER
   ============================================================ */
.minesweeper {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-body);
  color: var(--text-primary);
}
.ms-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface-titlebar);
  border-bottom: 1px solid var(--stroke-soft);
}
.ms-stat {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 7px;
  background: var(--surface-card);
  border: 1px solid var(--stroke-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.9rem;
}
.ms-stat .ms-ico {
  font-size: 0.95rem;
}
.ms-spacer {
  flex: 1;
}
.ms-face {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: var(--surface-card);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.ms-face:hover {
  background: var(--control-hover);
}
.ms-levels {
  display: flex;
  gap: 6px;
}
.ms-level {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--stroke);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 0.74rem;
  cursor: pointer;
}
.ms-level.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text-on);
}
.ms-board-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 18px;
}
.ms-board {
  display: grid;
  gap: 2px;
  background: var(--stroke);
  padding: 4px;
  border-radius: 8px;
  touch-action: manipulation;
}
.ms-cell {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: none;
  background: linear-gradient(160deg, #c9d6e2 0%, #aab9c9 100%);
  color: #1a2b3c;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  padding: 0;
  transition: background 0.08s ease;
}
[data-theme="dark"] .ms-cell {
  background: linear-gradient(160deg, #3a4757 0%, #2b3542 100%);
  color: #eaeaea;
}
.ms-cell:hover:not(.revealed) {
  background: linear-gradient(160deg, #dbe6f0 0%, #bccadb 100%);
}
.ms-cell.revealed {
  background: var(--surface-card);
  cursor: default;
}
.ms-cell.mine {
  background: #c42b1c;
  color: #fff;
}
.ms-cell.flag {
  background: linear-gradient(160deg, #ffd76a 0%, #f0b400 100%);
}
.ms-cell.wrong {
  background: #7a2020;
  color: #fff;
}
.ms-n1 { color: #1976d2; }
.ms-n2 { color: #388e3c; }
.ms-n3 { color: #d32f2f; }
.ms-n4 { color: #7b1fa2; }
.ms-n5 { color: #e65100; }
.ms-n6 { color: #0097a7; }
.ms-n7 { color: #455a64; }
.ms-n8 { color: #000000; }
.ms-banner {
  padding: 10px 16px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}
.ms-banner.win { background: #2e7d32; color: #fff; }
.ms-banner.lose { background: #c42b1c; color: #fff; }

/* ============================================================
   STICKY NOTES (desktop cards)
   ============================================================ */
#sticky-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.sticky-note {
  position: absolute;
  width: 200px;
  height: 180px;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  overflow: hidden;
  color: #1f1f1f;
}
.sticky-note.yellow { background: #fff275; }
.sticky-note.blue   { background: #a5d8ff; }
.sticky-note.green  { background: #b2f2bb; }
.sticky-note.pink   { background: #ffc9de; }
.sticky-note.dragging {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  transform: scale(1.03);
}
.sticky-head {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 6px;
  background: rgba(0, 0, 0, 0.07);
  cursor: grab;
  touch-action: none;
  flex-shrink: 0;
}
.sticky-head:active {
  cursor: grabbing;
}
.sticky-grip {
  flex: 1;
  font-size: 11px;
  letter-spacing: 2px;
  opacity: 0.45;
  user-select: none;
}
.sticky-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 0;
  cursor: pointer;
}
.sticky-dot.yellow { background: #fff275; }
.sticky-dot.blue   { background: #a5d8ff; }
.sticky-dot.green  { background: #b2f2bb; }
.sticky-dot.pink   { background: #ffc9de; }
.sticky-del {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  color: #333;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.sticky-del:hover {
  background: rgba(0, 0, 0, 0.14);
}
.sticky-body {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: #1f1f1f;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 8px 10px;
}

/* Sticky Notes app window (list of notes + colour picker) */
.sticky-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-body);
  color: var(--text-primary);
}
.sticky-app-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke-soft);
  background: var(--surface-titlebar);
}
.sticky-app-bar strong {
  font-size: 0.85rem;
}
.sticky-app-spacer {
  flex: 1;
}
.sticky-add {
  padding: 6px 14px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--accent-text-on);
  font-weight: 600;
  font-size: 0.78rem;
}
.sticky-add:hover {
  background: var(--accent-hover);
}
.sticky-colors {
  display: flex;
  gap: 6px;
}
.sticky-hint {
  padding: 10px 16px;
  font-size: 0.76rem;
  color: var(--text-muted);
}
.sticky-list {
  flex: 1;
  overflow: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sticky-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--stroke-soft);
  background: var(--surface-card);
  font-size: 0.8rem;
}
.sticky-row-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.sticky-row-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}
.sticky-row button {
  font-size: 0.74rem;
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 5px;
}
.sticky-row button:hover {
  background: var(--control-hover);
}
.sticky-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ============================================================
   TOUCH / TABLET SUPPORT
   Disable the tap-highlight flash and make interactive chrome
   usable with a finger. Drag handles opt into touch-action:none.
   ============================================================ */
#desktop, #taskbar, .window, .desk-icon, .sticky-note,
.tb-btn, .app-launch, .tray-btn, .ms-cell, .paint-tool,
.paint-swatch, .sticky-dot, .sticky-del, .qs-btn {
  -webkit-tap-highlight-color: transparent;
}
.win-titlebar {
  touch-action: none; /* the titlebar is the window drag handle */
}
.desk-icon {
  touch-action: none; /* desktop icons are draggable by finger */
}
/* Comfortable finger targets on small screens. */
@media (max-width: 820px) {
  .tb-btn, .app-launch, .tray-btn {
    min-width: 40px;
  }
  .win-controls button {
    width: 44px;
  }
  .ms-cell {
    width: 26px;
    height: 26px;
  }
  .sticky-note {
    width: 170px;
    height: 160px;
  }
}
/* Taskbar compaction so it never overflows a narrow viewport. */
@media (max-width: 640px) {
  .tb-widgets-temp,
  .tb-widgets-desc {
    display: none;
  }
  #tb-date {
    display: none;
  }
}

/* ============================================================
   RECYCLE BIN
   ============================================================ */
.recycle-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--surface-body);
  color: var(--text-primary);
}
.rb-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--surface-body) 84%, transparent);
}
.rb-btn {
  border: 1px solid var(--stroke);
  border-radius: 7px;
  padding: 8px 12px;
  background: var(--control-bg);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
}
.rb-btn:hover:not(:disabled) { background: var(--control-hover); }
.rb-btn:disabled { opacity: .45; cursor: default; }
.rb-btn.danger { color: #c43b31; }
.rb-spacer { flex: 1; }
.rb-note { min-height: 18px; padding: 10px 16px 0; color: var(--text-muted); font-size: .74rem; }
.rb-list { overflow: auto; flex: 1; padding: 10px 14px 16px; }
.rb-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.rb-row:hover { background: var(--flyout-hover); }
.rb-row.selected { background: color-mix(in srgb, var(--accent) 18%, transparent); outline: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.rb-row-ico { font-size: 1.45rem; text-align: center; }
.rb-row-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rb-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.rb-row-origin, .rb-row-date { color: var(--text-muted); font-size: .68rem; }
.rb-row-date { white-space: nowrap; }
.rb-empty { display: grid; place-items: center; min-height: 220px; color: var(--text-muted); font-size: .9rem; }

/* ============================================================
   LIVE SYSTEM TOASTS — above the taskbar's right tray
   ============================================================ */
.toast-host {
  position: fixed;
  z-index: 30000;
  right: 16px;
  bottom: calc(var(--taskbar-h) + 14px);
  width: min(360px, calc(100vw - 32px));
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 12px 14px 14px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 12px;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-window) 78%, rgba(255,255,255,.35));
  box-shadow: 0 14px 35px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.25);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(28px) scale(.97);
  transition: opacity .22s ease, transform .28s cubic-bezier(.2,.8,.2,1);
  cursor: pointer;
}
.toast.show { opacity: 1; transform: translateX(0) scale(1); }
.toast.hide { opacity: 0; transform: translateX(28px) scale(.97); }
.toast-ico { flex: 0 0 27px; font-size: 1.35rem; line-height: 1.1; text-align: center; }
.toast-text { min-width: 0; flex: 1; }
.toast-title { font-size: .8rem; font-weight: 650; margin-bottom: 3px; }
.toast-body { font-size: .74rem; line-height: 1.35; color: var(--text-secondary); }
.toast-close { border: 0; background: transparent; color: var(--text-muted); font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.toast-close:hover { color: var(--text-primary); }

/* ============================================================
   ACRYLIC LOCK SCREEN AND POWER OVERLAY
   ============================================================ */
.lock-screen, .power-overlay {
  position: fixed;
  inset: 0;
  z-index: 25000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  background: rgba(10, 18, 34, .6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .42s ease;
}
.lock-screen.shown, .power-overlay.shown { opacity: 1; pointer-events: auto; }
.lock-bg {
  position: absolute;
  inset: -30px;
  background: inherit;
  background-image: var(--wallpaper-image, url("bloom.jpg"));
  background-position: center;
  background-size: cover;
  filter: blur(22px) brightness(.7) saturate(1.2);
  transform: scale(1.08);
}
.lock-bg::after { content: ""; position: absolute; inset: 0; background: rgba(13, 24, 48, .46); }
.lock-sheet, .power-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
}
.lock-time { font-size: clamp(4.6rem, 13vw, 9rem); font-weight: 300; letter-spacing: -.05em; line-height: .95; }
.lock-date { margin-top: 14px; font-size: clamp(1rem, 2vw, 1.45rem); }
.lock-hint { position: fixed; bottom: 8vh; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.lock-user { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.lock-avatar { width: 34px; height: 34px; border: 2px solid rgba(255,255,255,.8); }
.lock-swipe { display: flex; flex-direction: column; align-items: center; gap: 7px; color: rgba(255,255,255,.8); font-size: .78rem; cursor: pointer; animation: lockFloat 1.8s ease-in-out infinite; }
.lock-swipe:focus-visible { outline: 2px solid #fff; outline-offset: 6px; border-radius: 6px; }
@keyframes lockFloat { 50% { transform: translateY(-7px); color: #fff; } }
.power-overlay { background: rgba(8, 12, 20, .88); backdrop-filter: blur(26px) saturate(120%); -webkit-backdrop-filter: blur(26px) saturate(120%); }
.power-spinner { position: relative; width: 46px; height: 46px; margin-bottom: 24px; }
.power-spinner span { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: #fff; transform: rotate(calc(var(--power-i) * 45deg)) translateY(-19px); animation: powerDot 1.1s linear infinite; animation-delay: calc(var(--power-i) * -.1375s); }
.power-spinner span:nth-child(1) { --power-i: 0; } .power-spinner span:nth-child(2) { --power-i: 1; } .power-spinner span:nth-child(3) { --power-i: 2; } .power-spinner span:nth-child(4) { --power-i: 3; } .power-spinner span:nth-child(5) { --power-i: 4; } .power-spinner span:nth-child(6) { --power-i: 5; } .power-spinner span:nth-child(7) { --power-i: 6; } .power-spinner span:nth-child(8) { --power-i: 7; }
@keyframes powerDot { 0%,100% { opacity: .18; } 50% { opacity: 1; } }
.power-status { font-size: 1.05rem; letter-spacing: .02em; }

@media (max-width: 640px) {
  .rb-toolbar { flex-wrap: wrap; }
  .rb-row { grid-template-columns: 32px minmax(0, 1fr); }
  .rb-row-date { display: none; }
  .toast-host { right: 10px; bottom: calc(var(--taskbar-h) + 10px); width: min(360px, calc(100vw - 20px)); }
}


/* ============================================================
   DESKTOP GRID / START MENU ALIGNMENT OVERRIDES
   ============================================================ */
#desktop-icons {
  position: absolute;
  inset: 0 0 48px 0;
  display: grid;
  grid-template-rows: repeat(auto-fill, 90px);
  grid-auto-flow: column;
  grid-auto-columns: 85px;
  gap: 10px;
  padding: 10px;
  height: calc(100vh - 48px);
  box-sizing: border-box;
  align-content: start;
  justify-content: start;
}
#desktop-icons .desk-icon {
  position: relative;
  left: auto !important;
  top: auto !important;
  width: 80px;
  height: 85px;
  min-width: 80px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 2px;
}
#desktop-icons .desk-icon > span {
  display: block;
  width: 75px;
  max-width: 75px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 2px rgba(0, 0, 0, .8);
}

/* Six evenly sized columns and compact, consistent pinned tiles. */
#start-menu .sm-pinned {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: start;
}
#start-menu .sm-app {
  min-width: 0;
  padding: 8px 2px;
  gap: 0;
}
#start-menu .sm-app-icon {
  width: 32px;
  height: 32px;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#start-menu .sm-app-icon svg {
  width: 32px;
  height: 32px;
}
#start-menu .sm-app > span {
  display: block;
  width: 100%;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#start-menu .sm-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  margin: 18px -28px 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
#start-menu .sm-user {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}
#start-menu .sm-brand {
  margin: 0 auto;
}
#start-menu .sm-power {
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The power popup is now positioned relative to the Start menu footer,
   immediately above the power button rather than against the viewport. */
#start-menu #power-menu {
  position: absolute;
  bottom: 55px;
  right: 15px;
  left: auto;
  top: auto;
  width: 180px;
  z-index: 10001;
}

/* Preserve finger/mouse dragging without disturbing the resting grid flow. */
#desktop-icons .desk-icon.dragging {
  position: absolute !important;
  z-index: 20;
}
