/* ========== CSS Variables & Theme ========== */
/* Default = dark mode (night XP) */
:root {
  --xp-blue: #3b82f6;
  --xp-blue-dark: #1d4ed8;
  --xp-green: #22c55e;
  --xp-taskbar: linear-gradient(to bottom, #243b55 0%, #1a2740 8%, #141b2d 100%);
  --xp-start: linear-gradient(to bottom, #166534 0%, #14532d 40%, #0f3d24 100%);
  --xp-window-bg: #1e1e24;
  --xp-title: linear-gradient(to right, #0f172a 0%, #1e3a5f 55%, #2563eb 100%);
  --xp-title-inactive: linear-gradient(to right, #1e293b 0%, #334155 100%);
  --xp-window-border: #3b82f6;
  --xp-button-face: #2a2a32;
  --xp-button-highlight: #3f3f4a;
  --xp-button-shadow: #0a0a0c;
  --desktop-bg: #0f172a;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --card-bg: #252530;
  --border: #334155;
  --shadow: rgba(0, 0, 0, 0.55);
  --iphone-bg: #000;
  --iphone-screen: #0a0a0a;
  --mobile-card: #1c1c1e;
  --mobile-text: #f5f5f7;
  --mobile-muted: #8e8e93;
  --accent: #3b82f6;
  --start-menu-bg: #1e293b;
  --icon-label: #e2e8f0;
  --taskbar-btn: rgba(255, 255, 255, 0.08);
}

/* Light mode — classic Windows XP Luna (blue) */
body.light {
  /* Accent blues (Luna) */
  --xp-blue: #245edb;
  --xp-blue-dark: #1941a5;
  /* Start button green */
  --xp-green: #3c8a2e;
  /* Taskbar: glossy XP blue */
  --xp-taskbar: linear-gradient(
    to bottom,
    #3b74d6 0%,
    #4990e7 3%,
    #2a5bc7 6%,
    #245edc 12%,
    #245edc 100%
  );
  /* Start button */
  --xp-start: linear-gradient(
    to bottom,
    #5eb33d 0%,
    #3c8a2e 8%,
    #2d6b22 100%
  );
  /* Window chrome */
  --xp-window-bg: #ece9d8;
  --xp-title: linear-gradient(to right, #0a246a 0%, #0a246a 2%, #a6caf0 100%);
  /* Desktop (Bliss-inspired sky blue-green base; wallpaper layers paint on top) */
  --desktop-bg: #3a6ea5;
  --text: #000000;
  --text-muted: #555555;
  --card-bg: #ffffff;
  --border: #919b9c;
  --shadow: rgba(0, 0, 0, 0.4);
  --iphone-screen: #f2f2f7;
  --mobile-card: #ffffff;
  --mobile-text: #1c1c1e;
  --mobile-muted: #6e6e73;
  --accent: #245edb;
  /* Start menu classic beige */
  --start-menu-bg: #ece9d8;
  --icon-label: #ffffff;
  --taskbar-btn: rgba(255, 255, 255, 0.18);
  /* Extra tokens used by chrome */
  --xp-title-inactive: linear-gradient(to right, #7a96df 0%, #adbbdf 100%);
  --xp-window-border: #0831d9;
  --xp-button-face: #ece9d8;
  --xp-button-highlight: #ffffff;
  --xp-button-shadow: #716f64;
}

/* Classic XP chrome polish (light / Luna) */
body.light .window {
  border: 2px solid #0831d9;
  border-radius: 8px 8px 0 0;
  box-shadow:
    1px 1px 0 #fff inset,
    -1px -1px 0 rgba(0, 0, 0, 0.15) inset,
    2px 3px 8px var(--shadow);
}
body.light .window:not(.active) .title-bar {
  background: var(--xp-title-inactive, linear-gradient(to right, #7a96df, #adbbdf));
}
body.light .title-bar {
  border-bottom: 1px solid #0831d9;
}
body.light .window-body {
  background: var(--xp-window-bg);
  color: var(--text);
}
body.light .taskbar {
  border-top: 1px solid #0831d9;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.35) inset;
}
body.light .start-btn {
  border: 1px solid #2d6b22;
  box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35) inset;
}
body.light .desktop-icons .icon span {
  text-shadow: 1px 1px 1px #000, 0 0 2px #000;
}
body.light .start-menu {
  background: var(--start-menu-bg);
  border: 2px solid #0831d9;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.35);
}


/* Dark mode chrome polish */
body:not(.light) .window {
  border: 1px solid #3b82f6;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}
body:not(.light) .window:not(.active) .title-bar {
  background: var(--xp-title-inactive);
  opacity: 0.92;
}
body:not(.light) .title-bar {
  border-bottom: 1px solid #1e3a5f;
}
body:not(.light) .window-body {
  background: var(--xp-window-bg);
  color: var(--text);
}
body:not(.light) .taskbar {
  border-top: 1px solid #3b82f6;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.06) inset;
}
body:not(.light) .start-btn {
  border: 1px solid #14532d;
  box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.12) inset;
}
body:not(.light) .desktop-icons .icon span {
  text-shadow: 1px 1px 2px #000, 0 0 4px #000;
}
body:not(.light) .start-menu {
  background: var(--start-menu-bg);
  border: 1px solid #3b82f6;
  box-shadow: 4px 6px 20px rgba(0, 0, 0, 0.55);
}
body:not(.light) .clock-gadget {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.88), rgba(30, 58, 95, 0.9));
  border-color: rgba(59, 130, 246, 0.35);
}



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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: Tahoma, "Segoe UI", sans-serif;
  background: #111;
}

/* Immersive OS mode (after boot / fullscreen) */
html.os-fullscreen,
html.os-fullscreen body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: #000;
}
html.os-fullscreen .desktop,
html.os-fullscreen .mobile {
  width: 100vw;
  height: 100vh;
  max-width: none;
}

/* ========== Boot screen ========== */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Tahoma, "Segoe UI", sans-serif;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.boot-screen.boot-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.boot-inner {
  text-align: center;
  max-width: 360px;
  padding: 24px;
}
.boot-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #f60 0 50%, transparent 50%),
    linear-gradient(225deg, #4c0 0 50%, transparent 50%),
    linear-gradient(315deg, #06f 0 50%, transparent 50%),
    linear-gradient(45deg, #fc0 0 50%, transparent 50%);
  background-size: 50% 50%;
  background-position: top left, top right, bottom right, bottom left;
  background-repeat: no-repeat;
  background-color: #000;
  box-shadow: 0 0 24px rgba(100, 160, 255, 0.25);
}
.boot-title {
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 0.5px;
  margin: 0 0 4px;
}
.boot-sub {
  font-size: 14px;
  color: #aaa;
  margin: 0 0 28px;
}
.boot-bar {
  height: 16px;
  border: 1px solid #333;
  border-radius: 2px;
  background: #111;
  overflow: hidden;
  margin-bottom: 14px;
}
.boot-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #245edb, #5a9aef, #245edb);
  background-size: 200% 100%;
  animation: bootShine 1.2s linear infinite;
  transition: width 0.3s ease;
}
@keyframes bootShine {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
.boot-status {
  font-size: 12px;
  color: #8af;
  min-height: 1.4em;
  margin: 0 0 16px;
}
.boot-start-btn {
  display: inline-block;
  padding: 10px 22px;
  font-family: Tahoma, sans-serif;
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(to bottom, #3c8a2e, #2d6b22);
  border: 1px solid #1a4a12;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.boot-start-btn:hover {
  filter: brightness(1.12);
}
.boot-hint {
  margin-top: 14px;
  font-size: 11px;
  color: #666;
}
.desktop.boot-hidden,
.mobile.boot-hidden {
  visibility: hidden;
}
@media (max-width: 899px) {
  .boot-title { font-size: 18px; }
}

/* ========== DESKTOP (Windows XP) ========== */
.desktop {
  display: none;
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--desktop-bg);
}

@media (min-width: 900px) {
  .desktop { display: block; }
  .mobile { display: none !important; }
}

.wallpaper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.15) 0%, transparent 50%),
    linear-gradient(160deg, #3a6ea5 0%, #2a5080 40%, #1e3a5f 100%);
  background-size: cover;
  z-index: 0;
}

body.light .wallpaper {
  background:
    radial-gradient(ellipse at 70% 10%, rgba(255,255,255,0.4) 0%, transparent 45%),
    linear-gradient(160deg, #7eb8e8 0%, #5b9bd5 50%, #3a7ab8 100%);
}

/* ========== Desktop sticky notes ========== */
/* Effects explored:
   - soft multi-layer drop shadow (lift off desk)
   - paper grain via layered gradients
   - ruled lines (subtle)
   - translucent tape strip
   - folded / dog-eared corner (clip-path + pseudo)
   - hover: lift + uncurl rotation
   - pin-hole / curl highlight
*/
.sticky-notes {
  /* Under the top-right clock gadget (time + ms + eth date) */
  position: absolute;
  top: 210px;
  right: 16px;
  left: auto;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 20px;
  pointer-events: none;
  max-width: min(240px, 26vw);
}

.sticky-note {
  position: relative;
  padding: 26px 18px 22px;
  font-family: "Segoe Print", "Comic Sans MS", "Chalkboard SE", "Bradley Hand", cursive, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #3d3a28;
  transform: rotate(2.8deg);
  transform-origin: 50% 0%;
  pointer-events: auto;
  user-select: none;
  cursor: default;
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    filter 0.28s ease;
  /* Lift + contact shadow */
  box-shadow:
    1px 1px 0 rgba(255, 255, 255, 0.45) inset,
    -1px -1px 0 rgba(0, 0, 0, 0.06) inset,
    0 1px 2px rgba(0, 0, 0, 0.12),
    3px 6px 10px rgba(0, 0, 0, 0.18),
    8px 14px 28px rgba(0, 0, 0, 0.12);
  /* Dog-ear: hide bottom-right triangle so peel can show */
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 22px),
    calc(100% - 22px) 100%,
    0 100%
  );
}

.sticky-note:hover {
  transform: rotate(0.4deg) translateY(-4px) scale(1.02);
  box-shadow:
    1px 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 2px 4px rgba(0, 0, 0, 0.14),
    6px 12px 18px rgba(0, 0, 0, 0.2),
    12px 24px 40px rgba(0, 0, 0, 0.14);
  filter: brightness(1.03);
  z-index: 16;
}

.sticky-note p {
  margin: 0;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* Yellow pad + paper grain + ruled lines */
.sticky-yellow {
  background-color: #ffe566;
  background-image:
    /* fine grain */
    repeating-linear-gradient(
      105deg,
      transparent 0,
      transparent 2px,
      rgba(255, 255, 255, 0.04) 2px,
      rgba(255, 255, 255, 0.04) 3px
    ),
    repeating-linear-gradient(
      -20deg,
      transparent 0,
      transparent 3px,
      rgba(0, 0, 0, 0.015) 3px,
      rgba(0, 0, 0, 0.015) 4px
    ),
    /* soft ruled lines */
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 21px,
      rgba(180, 140, 40, 0.12) 21px,
      rgba(180, 140, 40, 0.12) 22px
    ),
    /* vertical margin line */
    linear-gradient(
      to right,
      transparent 0,
      transparent 14px,
      rgba(220, 80, 80, 0.28) 14px,
      rgba(220, 80, 80, 0.28) 15px,
      transparent 15px
    ),
    /* top-to-bottom paper wash */
    linear-gradient(180deg, #fff9b0 0%, #ffe566 45%, #f5c842 100%);
  border: 1px solid #e0b800;
}

/* Folded corner (peel) */
.sticky-note::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22px;
  height: 22px;
  background: linear-gradient(
    225deg,
    #e8c94a 0%,
    #d4b020 45%,
    #c9a010 100%
  );
  /* Triangle pointing to bottom-right of the note */
  clip-path: polygon(0 0, 100% 0, 0 100%);
  box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.12);
  z-index: 2;
  /* place the fold so it sits in the clipped gap */
  transform: translate(0, 0);
}

/* Soft highlight under the fold for depth */
.sticky-note::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 28px;
  height: 28px;
  background: radial-gradient(
    circle at 100% 100%,
    rgba(0, 0, 0, 0.12) 0%,
    transparent 70%
  );
  z-index: 0;
  pointer-events: none;
}

/* Translucent tape strip */
.sticky-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 64px;
  height: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 250, 220, 0.35) 40%,
    rgba(230, 220, 180, 0.25) 100%
  );
  border: 1px solid rgba(200, 180, 100, 0.35);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border-radius: 1px;
  z-index: 3;
  /* slight frosted look */
  backdrop-filter: blur(0.5px);
}

/* Shine streak across tape */
.sticky-tape::after {
  content: "";
  position: absolute;
  inset: 2px 8px;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 45%,
    transparent 70%
  );
  border-radius: 1px;
  pointer-events: none;
}

body:not(.light) .sticky-note {
  color: #2c2a1c;
  box-shadow:
    1px 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 1px 2px rgba(0, 0, 0, 0.25),
    4px 8px 14px rgba(0, 0, 0, 0.35),
    10px 18px 32px rgba(0, 0, 0, 0.25);
}

body:not(.light) .sticky-note:hover {
  box-shadow:
    1px 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 2px 4px rgba(0, 0, 0, 0.3),
    8px 14px 22px rgba(0, 0, 0, 0.4),
    14px 26px 44px rgba(0, 0, 0, 0.3);
}

/* Hide sticky notes on mobile shell */
@media (max-width: 899px) {
  .sticky-notes { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .sticky-note,
  .sticky-note:hover {
    transition: none;
  }
}

/* Desktop Icons — XP-style: fill top-to-bottom, then next column (no scroll) */
.desktop-icons {
  position: absolute;
  top: 12px;
  left: 8px;
  bottom: 48px;
  display: flex;
  flex-flow: column wrap;
  align-content: flex-start;
  gap: var(--icon-gap-y, 4px) var(--icon-gap-x, 6px);
  z-index: 10;
  overflow: hidden;
  max-width: calc(100vw - 20px);
  pointer-events: none;
}
.desktop-icons .icon {
  pointer-events: auto;
}

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 78px;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  font-size: 11px;
  font-family: Tahoma, sans-serif;
  padding: 4px;
  border-radius: 3px;
}

.icon:hover, .icon:focus {
  background: rgba(0, 80, 200, 0.35);
  outline: 1px dotted rgba(255,255,255,0.6);
}

.icon-img {
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  border-radius: 4px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.about-icon { background: linear-gradient(135deg, #4fc3f7, #0288d1); }
.edu-icon { background: linear-gradient(135deg, #81c784, #388e3c); }
.exp-icon { background: linear-gradient(135deg, #4db6ac, #00796b); }
.cert-icon { background: linear-gradient(135deg, #ffd54f, #f9a825); }
.projects-icon { background: linear-gradient(135deg, #ffb74d, #f57c00); }
.skills-icon { background: linear-gradient(135deg, #ba68c8, #7b1fa2); }
.contact-icon { background: linear-gradient(135deg, #e57373, #c62828); }
.resume-icon { background: linear-gradient(135deg, #90a4ae, #455a64); }

.icon-img::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M24 8c-4 0-8 3-8 8s4 8 8 8 8-3 8-8-4-8-8-8zm0 20c-8 0-16 4-16 8v4h32v-4c0-4-8-8-16-8z'/%3E%3C/svg%3E") center/60% no-repeat;
  opacity: 0.9;
}

.edu-icon::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M24 6L4 16l20 10 20-10L24 6zm-16 14v8l16 8 16-8v-8L24 30 8 20z'/%3E%3C/svg%3E"); }
.exp-icon::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M14 12V8c0-2.2 1.8-4 4-4h12c2.2 0 4 1.8 4 4v4h6c2.2 0 4 1.8 4 4v20c0 2.2-1.8 4-4 4H8c-2.2 0-4-1.8-4-4V16c0-2.2 1.8-4 4-4h6zm4 0h12V8H18v4z'/%3E%3C/svg%3E"); }
.cert-icon::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23333' d='M24 4l4 8h9l-7 6 3 9-9-5-9 5 3-9-7-6h9l4-8zm0 22c-6 0-12 3-12 6v4h24v-4c0-3-6-6-12-6z'/%3E%3C/svg%3E"); }
.projects-icon::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M8 8h32v4H8V8zm0 8h32v24H8V16zm4 4v16h24V20H12z'/%3E%3C/svg%3E"); }
.skills-icon::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M24 6l4 12h12l-10 8 4 12-10-8-10 8 4-12-10-8h12z'/%3E%3C/svg%3E"); }
.contact-icon::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M8 10h32v4H8v-4zm0 8h32v20H8V18zm4 4v12h24V22H12z'/%3E%3C/svg%3E"); }
.resume-icon::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M12 6h18l6 6v30H12V6zm16 2v6h6l-6-6zM16 20h16v2H16v-2zm0 6h16v2H16v-2zm0 6h12v2H16v-2z'/%3E%3C/svg%3E"); }

/* Windows */
#windows-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

.window {
  position: absolute;
  min-width: 280px;
  min-height: 180px;
  width: 440px;
  height: 360px;
  max-width: min(90vw, 640px);
  max-height: min(calc(100vh - 80px), 520px);
  background: var(--xp-window-bg);
  border: 1px solid #0831d9;
  border-radius: 8px 8px 0 0;
  box-shadow: 2px 2px 12px var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.3);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  overflow: hidden;
  font-family: Tahoma, sans-serif;
}

.window.active {
  /* z-index is managed in JS (focusWindow) — do not force a fixed value */
  box-shadow: 3px 3px 16px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.4);
}
.window:not(.active) {
  filter: none;
}
.window:not(.active) .window-body {
  opacity: 0.92;
}

.title-bar {
  height: 28px;
  background: var(--xp-title);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 0 6px;
  cursor: move;
  user-select: none;
  border-radius: 7px 7px 0 0;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.window:not(.active) .title-bar {
  background: linear-gradient(to right, #7a96df, #b0c4f0);
}

.title-bar-text {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}

.win-icon {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #4fc3f7, #0288d1);
}

.title-bar-controls {
  display: flex;
  gap: 2px;
}

.title-bar-controls button {
  width: 21px;
  height: 21px;
  border: 1px solid rgba(0,0,0,0.3);
  border-radius: 3px;
  background: linear-gradient(to bottom, #fff 0%, #cce0ff 50%, #99bfff 100%);
  color: #000;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Tahoma, sans-serif;
}

.title-bar-controls button:hover {
  background: linear-gradient(to bottom, #fff 0%, #b0d0ff 100%);
}

.btn-close {
  background: linear-gradient(to bottom, #ff9a9a 0%, #e81123 50%, #c50e1f 100%) !important;
  color: #fff !important;
  font-weight: bold;
  font-size: 14px;
}

.btn-close:hover {
  background: linear-gradient(to bottom, #ffb0b0 0%, #f02030 100%) !important;
}

.window-body {
  flex: 1;
  overflow: auto;
  padding: 12px 14px;
  background: var(--xp-window-bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.window-body h2 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #0a246a;
  border-bottom: 1px solid #7f9db9;
  padding-bottom: 4px;
}

.window-body h3 {
  font-size: 14px;
  margin: 12px 0 6px;
  color: #1a3a7a;
}

.window-body p { margin-bottom: 8px; }

.window-body ul,
.window-body ol {
  margin: 6px 0 10px 0;
  padding-left: 1.4em;
  list-style-position: outside;
}
.window-body ol {
  list-style-type: decimal;
}
.window-body ul {
  list-style-type: disc;
}
.window-body li {
  margin: 0.2em 0;
  padding-left: 0.15em;
}
.window-body li::marker {
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.window-body .profile-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.window-body .profile-pic {
  width: 90px;
  height: 90px;
  border-radius: 6px;
  background: linear-gradient(135deg, #4fc3f7, #0288d1);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  background-size: cover;
  background-position: center;
  position: relative;
}

.window-body .profile-pic::after {
  content: "MA";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.project-card, .skill-bar-wrap {
  background: #fff;
  border: 1px solid #b0b0b0;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: inset 0 1px 0 #fff;
}

body:not(.light) .project-card,
body:not(.light) .skill-bar-wrap {
  background: #2a2a2e;
  border-color: #444;
  color: #eee;
}

.project-card h4 {
  margin-bottom: 4px;
  color: #0a246a;
}

body:not(.light) .project-card h4 { color: #7eb8ff; }

.project-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.project-card .tag {
  font-size: 10px;
  background: #e0e8f5;
  color: #1a3a7a;
  padding: 2px 6px;
  border-radius: 3px;
}

body:not(.light) .project-card .tag {
  background: #3a4a6a;
  color: #c0d0ff;
}

.skill-bar {
  height: 12px;
  background: #d0d0d0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.skill-bar > div {
  height: 100%;
  background: linear-gradient(to right, #3c8a2e, #5cb85c);
  border-radius: 3px;
}

/* Taskbar */
.taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: var(--xp-taskbar);
  display: flex;
  align-items: center;
  padding: 0 4px;
  z-index: 200;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.3);
  border-top: 1px solid #5a8ce8;
}

.start-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px 0 8px;
  background: var(--xp-start);
  border: none;
  border-radius: 0 12px 12px 0;
  color: #fff;
  font-family: Tahoma, sans-serif;
  font-size: 13px;
  font-weight: bold;
  font-style: italic;
  cursor: pointer;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
  box-shadow: 1px 0 2px rgba(0,0,0,0.3);
}

.start-btn:hover {
  filter: brightness(1.1);
}

.start-logo {
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3 3h8v8H3V3zm10 0h8v8h-8V3zM3 13h8v8H3v-8zm10 0h8v8h-8v-8z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.taskbar-apps {
  flex: 1;
  display: flex;
  gap: 2px;
  padding: 0 6px;
  overflow: hidden;
}

.taskbar-app {
  height: 28px;
  min-width: 120px;
  max-width: 180px;
  padding: 0 8px;
  background: linear-gradient(to bottom, #4a7de0 0%, #2a5cc0 100%);
  border: 1px solid #1a4a9a;
  border-radius: 3px;
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.taskbar-app.active {
  background: linear-gradient(to bottom, #1a4a9a 0%, #2a5cc0 100%);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  height: 28px;
  background: linear-gradient(to bottom, #1a4a9a, #0d2a6a);
  border-radius: 3px;
  margin-right: 2px;
}

.theme-toggle {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
}

.theme-toggle .moon { display: none; }
body.light .theme-toggle .sun { display: none; }
body.light .theme-toggle .moon { display: inline; }

.clock {
  color: #fff;
  font-size: 11px;
  font-family: Tahoma, sans-serif;
  min-width: 70px;
  text-align: right;
}

/* Start Menu */
.start-menu {
  display: none;
  position: absolute;
  bottom: 36px;
  left: 0;
  width: 400px;
  height: 480px;
  max-height: calc(100vh - 48px);
  background: #fff;
  border: 1px solid #0831d9;
  border-radius: 0 8px 0 0;
  box-shadow: 2px -2px 12px rgba(0,0,0,0.4);
  z-index: 250;
  overflow: hidden;
  font-family: Tahoma, sans-serif;
}

.start-menu.open { display: flex; }

.start-menu-left {
  width: 190px;
  background: linear-gradient(to bottom, #245edb, #1941a5);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(to bottom, #3a7de0, #245edb);
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: linear-gradient(135deg, #4fc3f7, #0288d1);
  border: 2px solid #fff;
  position: relative;
  flex-shrink: 0;
}

.user-avatar::after {
  content: "MA";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
}

.user-name {
  font-size: 13px;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
}

.start-links {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.start-links button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: #fff;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  font-family: Tahoma, sans-serif;
}

.start-links button:hover {
  background: rgba(255,255,255,0.15);
}

.sm-icon {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  flex-shrink: 0;
  display: inline-block;
  position: relative;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  overflow: hidden;
}
/* Glyph layer — same SVGs as desktop .icon-img, scaled for 24px tiles */
.sm-icon::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 62%;
  opacity: 0.95;
}
/* Default person glyph for About when no specific override */
.sm-icon.about-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M24 8c-4 0-8 3-8 8s4 8 8 8 8-3 8-8-4-8-8-8zm0 20c-8 0-16 4-16 8v4h32v-4c0-4-8-8-16-8z'/%3E%3C/svg%3E");
}
/* Ensure program icons also paint their glyph inside sm-icon */
.sm-icon.notepad-icon::after,
.sm-icon.paint-icon::after,
.sm-icon.terminal-icon::after,
.sm-icon.vscode-icon::after,
.sm-icon.minesweeper-icon::after,
.sm-icon.control-icon::after,
.sm-icon.recycle-icon::after {
  background-size: 62%;
}
.sm-icon.edu-icon::after,
.sm-icon.exp-icon::after,
.sm-icon.cert-icon::after,
.sm-icon.projects-icon::after,
.sm-icon.skills-icon::after,
.sm-icon.contact-icon::after,
.sm-icon.resume-icon::after {
  background-size: 62%;
}

/* Group labels in start list */
.sm-group-label {
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
  padding: 10px 12px 4px;
  color: #cfe0ff;
}
.start-links button {
  min-height: 32px;
}
.start-links .sm-icon {
  margin-right: 2px;
}

.start-menu-right {
  flex: 1;
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  color: #000;
}

.sm-section {
  padding: 6px 12px;
}

.sm-label {
  font-size: 11px;
  font-weight: bold;
  color: #245edb;
  margin-bottom: 4px;
  border-bottom: 1px solid #d0d0d0;
  padding-bottom: 2px;
}

.start-menu-right button {
  display: block;
  width: 100%;
  padding: 6px 8px;
  background: none;
  border: none;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
  font-family: Tahoma, sans-serif;
  color: #000;
}

.start-menu-right button:hover {
  background: #316ac5;
  color: #fff;
}

.sm-bottom {
  margin-top: auto;
  padding: 8px 12px;
  border-top: 1px solid #d0d0d0;
  display: flex;
  gap: 8px;
}

.sm-bottom button {
  flex: 1;
  padding: 6px;
  background: linear-gradient(to bottom, #f0f0f0, #d0d0d0);
  border: 1px solid #888;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
}

.sm-bottom button:hover {
  background: linear-gradient(to bottom, #fff, #e0e0e0);
}

/* ========== MOBILE (iPhone Pro Max) ========== */
.mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  background: #111;
  padding: 12px;
}

@media (min-width: 900px) {
  .mobile { display: none; }
}

.iphone-frame {
  width: 100%;
  max-width: 430px;
  height: min(932px, 96vh);
  background: #1a1a1a;
  border-radius: 55px;
  padding: 12px;
  box-shadow:
    0 0 0 3px #333,
    0 0 0 6px #111,
    0 20px 60px rgba(0,0,0,0.6);
  position: relative;
}

.iphone-notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
}

.dynamic-island {
  width: 126px;
  height: 37px;
  background: #000;
  border-radius: 20px;
}

.iphone-screen {
  width: 100%;
  height: 100%;
  background: var(--iphone-screen);
  border-radius: 44px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  color: var(--mobile-text);
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: -apple-system, "Segoe UI", sans-serif;
  z-index: 10;
}

.status-icons {
  display: flex;
  gap: 6px;
  font-size: 12px;
  align-items: center;
}

.mobile-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.home-screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 8px 20px 0;
  overflow-y: auto;
}

.mobile-header {
  text-align: center;
  padding: 20px 0 24px;
}

.mobile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, #4fc3f7, #0288d1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  position: relative;
  border: 3px solid rgba(255,255,255,0.15);
}

.mobile-avatar::after {
  content: "MA";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  font-family: -apple-system, sans-serif;
}

.mobile-header h1 {
  font-size: 24px;
  font-weight: 700;
  font-family: -apple-system, "Segoe UI", sans-serif;
  margin-bottom: 4px;
}

.mobile-header .subtitle {
  font-size: 14px;
  color: var(--mobile-muted);
  margin-bottom: 2px;
}

.mobile-header .years {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 12px;
  padding: 8px 4px 24px;
  flex: 1;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--mobile-text);
  cursor: pointer;
  font-family: -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
}

.app-img {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  background-size: 50%;
  background-repeat: no-repeat;
  background-position: center;
}

.app-img.about { background-color: #0a84ff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 12c2.7 0 5-2.3 5-5s-2.3-5-5-5-5 2.3-5 5 2.3 5 5 5zm0 2c-3.3 0-10 1.7-10 5v3h20v-3c0-3.3-6.7-5-10-5z'/%3E%3C/svg%3E"); }
.app-img.edu { background-color: #30d158; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 3L1 9l11 6 9-4.9V17h2V9L12 3zM5 13.2v3.5l7 3.8 7-3.8v-3.5l-7 3.8-7-3.8z'/%3E%3C/svg%3E"); }
.app-img.experience { background-color: #64d2ff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M10 2h4a2 2 0 012 2v2h4a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V8a2 2 0 012-2h4V4a2 2 0 012-2zm0 4h4V4h-4v2z'/%3E%3C/svg%3E"); }
.app-img.certifications { background-color: #ffd60a; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M12 2l2.5 5.5L20 9l-4 4 1 6-5-2.5L7 19l1-6-4-4 5.5-1.5L12 2zm0 4.2l-1.2 2.6-2.8.8 2.1 2-.5 3 2.4-1.2 2.4 1.2-.5-3 2.1-2-2.8-.8L12 6.2z'/%3E%3C/svg%3E"); }
.app-img.projects { background-color: #ff9f0a; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M4 4h16v2H4V4zm0 4h16v12H4V8zm2 2v8h12v-8H6z'/%3E%3C/svg%3E"); }
.app-img.skills { background-color: #bf5af2; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 2l2.4 7.2H22l-6 4.8 2.3 7.2L12 16.8 5.7 21.2 8 14 2 9.2h7.6z'/%3E%3C/svg%3E"); }
.app-img.contact { background-color: #ff453a; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E"); }
.app-img.resume { background-color: #64d2ff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E"); }

.dock {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 12px 16px 28px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  border-radius: 28px;
  margin: 0 8px 8px;
}

body.light .dock {
  background: rgba(0,0,0,0.06);
}

.dock .app-icon { gap: 0; }
.dock .app-img { width: 54px; height: 54px; }

.theme-toggle-mobile {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: none;
  background: var(--mobile-card);
  color: var(--mobile-text);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.theme-toggle-mobile .moon { display: none; }
body.light .theme-toggle-mobile .sun { display: none; }
body.light .theme-toggle-mobile .moon { display: inline; }

/* App pages */
.app-page {
  position: absolute;
  inset: 0;
  background: var(--iphone-screen);
  display: flex;
  flex-direction: column;
  z-index: 5;
  animation: slideIn 0.28s ease;
}

.app-page[hidden] { display: none; }

@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.page-header {
  display: flex;
  align-items: center;
  padding: 8px 16px 12px;
  border-bottom: 1px solid rgba(128,128,128,0.2);
  gap: 8px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 20px;
  font-weight: 400;
  cursor: pointer;
  padding: 4px 8px 4px 0;
  font-family: -apple-system, sans-serif;
}

.page-header h2 {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
  text-align: center;
  margin-right: 40px;
  font-family: -apple-system, sans-serif;
}

.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 40px;
  font-family: -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.page-body h3 {
  font-size: 16px;
  margin: 16px 0 8px;
  color: var(--accent);
}

.page-body p { margin-bottom: 10px; color: var(--mobile-text); }
.page-body ul,
.page-body ol {
  margin: 0 0 12px 0;
  padding-left: 1.5em;
  color: var(--mobile-muted);
  list-style-position: outside;
}
.page-body ol {
  list-style-type: decimal;
}
.page-body ul {
  list-style-type: disc;
}
.page-body li {
  margin: 0.25em 0;
  line-height: 1.45;
}
.page-body li::marker {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--mobile-text, #111);
}

.mobile-card {
  background: var(--mobile-card);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.mobile-card h4 {
  font-size: 15px;
  margin-bottom: 4px;
}

.mobile-card .meta {
  font-size: 13px;
  color: var(--mobile-muted);
  margin-bottom: 6px;
}

.skill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
}

.skill-row .bar {
  flex: 1;
  height: 6px;
  background: rgba(128,128,128,0.25);
  border-radius: 3px;
  margin-left: 12px;
  overflow: hidden;
}

.skill-row .bar > div {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.home-indicator {
  height: 5px;
  width: 134px;
  background: var(--mobile-text);
  opacity: 0.3;
  border-radius: 3px;
  margin: 8px auto 10px;
}

/* Utility */
[hidden] { display: none !important; }

/* ========== New App Icons ========== */
.notepad-icon { background: linear-gradient(135deg, #fff9c4, #fbc02d); }
.paint-icon { background: linear-gradient(135deg, #f8bbd9, #e91e63); }
.terminal-icon { background: linear-gradient(135deg, #263238, #000); }
.vscode-icon { background: linear-gradient(135deg, #007acc, #1e1e1e); }

.notepad-icon::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23333' d='M10 6h22l6 6v30H10V6zm20 2v6h6l-6-6zM14 20h20v2H14v-2zm0 6h20v2H14v-2zm0 6h14v2H14v-2z'/%3E%3C/svg%3E"); }
.paint-icon::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M24 8c-8 0-14 6-14 14 0 10 14 18 14 18s14-8 14-18c0-8-6-14-14-14zm0 20a6 6 0 110-12 6 6 0 010 12z'/%3E%3C/svg%3E"); }
.terminal-icon::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%230f0' d='M8 12h4l8 10-8 10H8l8-10-8-10zm16 16h16v4H24v-4z'/%3E%3C/svg%3E"); }
.vscode-icon::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M32 6L12 18v12l20 12 8-4V10l-8-4zM14 28V20l14-8v24l-14-8z'/%3E%3C/svg%3E"); }

.sm-group-label {
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
  padding: 10px 12px 4px;
  color: #cce0ff;
}

.start-menu {
  width: 420px;
  height: 460px;
  max-height: calc(100vh - 40px);
}

.start-menu-left {
  width: 210px;
}

.start-links {
  overflow-y: auto;
}

/* App windows — compact by default (JS sets exact size on open) */
.window[data-id="notepad"],
.window[data-id="paint"],
.window[data-id="terminal"],
.window[data-id="vscode"] {
  width: 480px;
  height: 340px;
  min-height: 240px;
}

.window[data-id="vscode"] {
  width: 560px;
  height: 400px;
}

.window[data-id="paint"] {
  width: 520px;
  height: 380px;
}

.window[data-id="terminal"] {
  width: 500px;
  height: 320px;
}

/* Maximized windows may grow beyond the compact max */
.window[data-maximized="1"] {
  max-width: none !important;
  max-height: none !important;
}

.window-body.no-pad {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  height: 100%;
}

/* ---- Notepad ---- */
.notepad-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1;
  background: #f3f3f3;
  color: #1a1a1a;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}

/* Windows 11–style Notepad */
.notepad-win11 {
  background: #f9f9f9;
}
.np11-menubar {
  display: flex;
  gap: 2px;
  padding: 4px 8px 0;
  background: #f9f9f9;
  user-select: none;
}
.np11-menu {
  position: relative;
}
.np11-menu-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 12.5px;
  font-family: inherit;
  border-radius: 4px;
  cursor: pointer;
  color: #1a1a1a;
}
.np11-menu-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}
.np11-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 40;
  min-width: 220px;
  padding: 4px;
  background: #f7f7f7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}
.np11-dropdown button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 12.5px;
  font-family: inherit;
  border-radius: 4px;
  cursor: pointer;
  color: #1a1a1a;
  text-align: left;
}
.np11-dropdown button:hover {
  background: rgba(0, 0, 0, 0.05);
}
.np11-dropdown kbd {
  font-family: inherit;
  font-size: 11px;
  opacity: 0.55;
  font-weight: 400;
}
.np11-dropdown hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin: 4px 6px;
}
.np11-check {
  display: inline-block;
  width: 14px;
  margin-right: 4px;
  color: #0067c0;
  font-weight: 600;
}
.np11-commandbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 8px;
  background: #f9f9f9;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.np11-cmd {
  border: none;
  background: transparent;
  padding: 6px 12px;
  font-size: 12.5px;
  font-family: inherit;
  border-radius: 6px;
  cursor: pointer;
  color: #1a1a1a;
}
.np11-cmd:hover {
  background: rgba(0, 0, 0, 0.05);
}
.np11-cmd:active {
  background: rgba(0, 0, 0, 0.08);
}
.np11-sep {
  width: 1px;
  height: 16px;
  background: rgba(0, 0, 0, 0.1);
  margin: 0 4px;
}
.np11-findbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #f3f3f3;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.np11-find-input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #fff;
}
.np11-find-input:focus {
  border-color: #0067c0;
  box-shadow: 0 0 0 1px #0067c0;
}
.notepad-textarea,
.np11-editor {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  padding: 12px 16px;
  font-family: "Cascadia Mono", "Consolas", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.55;
  background: #ffffff;
  color: #1a1a1a;
  min-height: 200px;
  white-space: pre-wrap;
}
.np11-statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 4px 12px;
  font-size: 11.5px;
  color: #5c5c5c;
  background: #f9f9f9;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}
.np11-statusbar span {
  white-space: nowrap;
}

/* Win11 dark */
body:not(.light) .notepad-app,
body:not(.light) .notepad-win11 {
  background: #202020;
  color: #ffffff;
}
body:not(.light) .np11-menubar,
body:not(.light) .np11-commandbar,
body:not(.light) .np11-statusbar {
  background: #202020;
  border-color: rgba(255, 255, 255, 0.08);
  color: #e6e6e6;
}
body:not(.light) .np11-menu-btn,
body:not(.light) .np11-cmd {
  color: #e6e6e6;
}
body:not(.light) .np11-menu-btn:hover,
body:not(.light) .np11-cmd:hover {
  background: rgba(255, 255, 255, 0.06);
}
body:not(.light) .np11-dropdown {
  background: #2c2c2c;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
body:not(.light) .np11-dropdown button {
  color: #e6e6e6;
}
body:not(.light) .np11-dropdown button:hover {
  background: rgba(255, 255, 255, 0.08);
}
body:not(.light) .np11-dropdown hr {
  border-color: rgba(255, 255, 255, 0.1);
}
body:not(.light) .np11-findbar {
  background: #1b1b1b;
  border-color: rgba(255, 255, 255, 0.08);
}
body:not(.light) .np11-find-input {
  background: #2c2c2c;
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}
body:not(.light) .np11-find-input:focus {
  border-color: #60cdff;
  box-shadow: 0 0 0 1px #60cdff;
}
body:not(.light) .notepad-textarea,
body:not(.light) .np11-editor {
  background: #1e1e1e;
  color: #e6e6e6;
}
body:not(.light) .np11-statusbar {
  color: #b3b3b3;
}
body:not(.light) .np11-check {
  color: #60cdff;
}
body:not(.light) .np11-sep {
  background: rgba(255, 255, 255, 0.12);
}

/* legacy toolbar (if any) */
.notepad-toolbar {
  display: none;
}

/* ---- Paint ---- */
.paint-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1;
}

.paint-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #ece9d8;
  border-bottom: 1px solid #aca899;
  flex-wrap: wrap;
}

.paint-toolbar label {
  font-size: 11px;
  font-family: Tahoma, sans-serif;
}

.paint-colors {
  display: flex;
  gap: 3px;
}

.paint-colors button {
  width: 20px;
  height: 20px;
  border: 1px solid #666;
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
}

.paint-colors button.active {
  outline: 2px solid #000;
  outline-offset: 1px;
}

.paint-toolbar input[type="range"] {
  width: 80px;
}

.paint-toolbar button.tool-btn {
  padding: 3px 8px;
  font-size: 11px;
  border: 1px solid #aca899;
  background: linear-gradient(to bottom, #fff, #ece9d8);
  border-radius: 2px;
  cursor: pointer;
  font-family: Tahoma, sans-serif;
}

.paint-toolbar button.tool-btn.active {
  background: #cde;
  border-color: #316ac5;
}

.paint-canvas-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #6b6b6b;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  position: relative;
}

.paint-canvas-wrap canvas {
  background: #ffffff;
  cursor: crosshair;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  touch-action: none;
  user-select: none;
}

body:not(.light) .paint-toolbar {
  background: #2d2d30;
  border-color: #3e3e42;
  color: #ccc;
}

body:not(.light) .paint-toolbar button.tool-btn {
  background: #3e3e42;
  border-color: #555;
  color: #ccc;
}

/* ---- Terminal ---- */
.terminal-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1;
  background: #0c0c0c;
  color: #cccccc;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
}

.terminal-output {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}

.terminal-output .prompt-line {
  color: #4ec9b0;
}

.terminal-output .cmd-echo {
  color: #dcdcaa;
}

.terminal-output .err {
  color: #f44747;
}

.terminal-output .info {
  color: #569cd6;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  padding: 6px 12px 10px;
  border-top: 1px solid #333;
  background: #0c0c0c;
}

.terminal-input-row .prompt {
  color: #4ec9b0;
  margin-right: 8px;
  white-space: nowrap;
}

.terminal-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #cccccc;
  font-family: inherit;
  font-size: inherit;
}

/* ---- VS Code ---- */
.vscode-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 13px;
}

.vscode-titlebar {
  display: flex;
  align-items: center;
  height: 30px;
  background: #3c3c3c;
  padding: 0 8px;
  gap: 12px;
  font-size: 12px;
  color: #ccc;
  border-bottom: 1px solid #252526;
}

.vscode-titlebar .logo {
  color: #007acc;
  font-weight: bold;
}

.vscode-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.vscode-sidebar {
  width: 180px;
  background: #252526;
  border-right: 1px solid #1e1e1e;
  padding: 8px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.vscode-sidebar .side-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  padding: 4px 12px;
}

.vscode-sidebar .file-item {
  padding: 4px 12px 4px 20px;
  cursor: pointer;
  font-size: 12px;
  color: #ccc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vscode-sidebar .file-item:hover {
  background: #2a2d2e;
}

.vscode-sidebar .file-item.active {
  background: #37373d;
  color: #fff;
}

.vscode-sidebar .file-item .fi {
  font-size: 14px;
}

.vscode-editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vscode-tabs {
  display: flex;
  background: #252526;
  border-bottom: 1px solid #1e1e1e;
  overflow-x: auto;
}

.vscode-tab {
  padding: 6px 14px;
  font-size: 12px;
  color: #969696;
  cursor: pointer;
  border-right: 1px solid #1e1e1e;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vscode-tab.active {
  background: #1e1e1e;
  color: #fff;
}

.vscode-tab .close-tab {
  opacity: 0.5;
  font-size: 14px;
}

.vscode-tab .close-tab:hover {
  opacity: 1;
}

.vscode-code {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.vscode-linenumbers {
  width: 40px;
  background: #1e1e1e;
  color: #858585;
  text-align: right;
  padding: 10px 8px;
  font-family: Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  user-select: none;
  border-right: 1px solid #333;
  overflow: hidden;
}

.vscode-code textarea {
  flex: 1;
  background: #1e1e1e;
  color: #d4d4d4;
  border: none;
  outline: none;
  resize: none;
  padding: 10px 12px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  tab-size: 2;
}

.vscode-statusbar {
  display: flex;
  justify-content: space-between;
  height: 22px;
  background: #007acc;
  color: #fff;
  font-size: 11px;
  padding: 0 10px;
  align-items: center;
}

.vscode-statusbar span {
  margin-right: 12px;
}

/* Mobile app icons for new apps */
.app-img.notepad { background-color: #ffd60a; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E"); }
.app-img.paint { background-color: #ff375f; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 3c-4.97 0-9 4.03-9 9s9 9 9 9 9-4.03 9-9-4.03-9-9-9zm0 12a3 3 0 110-6 3 3 0 010 6z'/%3E%3C/svg%3E"); }
.app-img.terminal { background-color: #1c1c1e; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2330d158'%3E%3Cpath d='M4 5h2l5 7-5 7H4l5-7-5-7zm8 12h8v2h-8v-2z'/%3E%3C/svg%3E"); }
.app-img.vscode { background-color: #007acc; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17 3L5 10.5v3L17 21l3-1.5V4.5L17 3zM7 12.5v-1l9-5.5v12l-9-5.5z'/%3E%3C/svg%3E"); }
.app-img.tetris,
.app-img.blockblaster {
  background-color: #0ea5e9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Crect x='9' y='2' width='6' height='6' rx='0.8'/%3E%3Crect x='3' y='8' width='6' height='6' rx='0.8'/%3E%3Crect x='9' y='8' width='6' height='6' rx='0.8'/%3E%3Crect x='15' y='8' width='6' height='6' rx='0.8'/%3E%3Crect x='9' y='14' width='6' height='6' rx='0.8'/%3E%3C/svg%3E");
}
/* Tetris — built-in mobile game (yellow handheld) */
.tt-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  overflow: hidden;
}
.tt-device {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #ffe566 0%, #f5c518 45%, #e6b800 100%);
  border-radius: 0;
  padding: 10px 12px 14px;
  box-sizing: border-box;
}
.tt-brand {
  text-align: center;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 0.35em;
  font-size: 13px;
  color: #5c4a00;
  margin-bottom: 8px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.tt-screen-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 8px;
  background: #3d4a2e;
  border: 4px solid #2a3320;
  border-radius: 8px;
  padding: 8px;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.35);
}
.tt-board {
  display: block;
  background: #9ca88a;
  border-radius: 2px;
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
}
.tt-side {
  width: 68px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: "Segoe UI", system-ui, sans-serif;
}
.tt-stat {
  background: #9ca88a;
  border-radius: 4px;
  padding: 4px 5px;
  color: #1a2210;
}
.tt-stat span {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 2px;
}
.tt-stat strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.tt-next,
.tt-hold {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 3px;
  background: #9ca88a;
}
.tt-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 25, 12, 0.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 4px;
  z-index: 2;
  padding: 12px;
  text-align: center;
}
.tt-overlay[hidden] { display: none !important; }
.tt-overlay-msg {
  margin: 0;
  color: #f8fafc;
  font-weight: 800;
  font-size: 22px;
  font-family: "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.04em;
}
.tt-overlay-sub {
  margin: 0 0 6px;
  color: #cbd5e1;
  font-size: 13px;
  font-family: "Segoe UI", system-ui, sans-serif;
}
.tt-controls {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.tt-row {
  display: flex;
  gap: 10px;
}
.tt-btn {
  min-width: 44px;
  height: 36px;
  border-radius: 18px;
  border: none;
  background: linear-gradient(180deg, #86efac, #22c55e);
  color: #052e16;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 3px 0 #15803d, 0 4px 8px rgba(0,0,0,0.2);
  font-family: inherit;
  touch-action: manipulation;
}
.tt-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #15803d; }
.tt-btn.tt-reset { background: linear-gradient(180deg, #fca5a5, #ef4444); color: #fff; box-shadow: 0 3px 0 #b91c1c, 0 4px 8px rgba(0,0,0,0.2); }
.tt-btn.tt-sound.off { opacity: 0.45; }
.tt-btn.tt-restart {
  min-width: 120px;
  height: 40px;
  background: linear-gradient(180deg, #93c5fd, #3b82f6);
  color: #fff;
  box-shadow: 0 3px 0 #1d4ed8, 0 4px 8px rgba(0,0,0,0.25);
}
.tt-dpad {
  display: grid;
  grid-template-columns: 52px 52px 52px;
  grid-template-rows: 48px 48px;
  gap: 8px;
  justify-content: center;
}
.tt-pad {
  width: 52px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, #7dd3fc, #2563eb);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 #1e40af, 0 5px 10px rgba(0,0,0,0.25);
  touch-action: manipulation;
  font-family: inherit;
}
.tt-pad:active { transform: translateY(2px); box-shadow: 0 2px 0 #1e40af; }
.tt-rot { grid-column: 2; grid-row: 1; }
.tt-left { grid-column: 1; grid-row: 2; }
.tt-down { grid-column: 2; grid-row: 2; }
.tt-right { grid-column: 3; grid-row: 2; }
.tt-drop {
  grid-column: 1 / 4;
  grid-row: 3;
  width: auto;
  height: 40px;
  border-radius: 20px;
  margin-top: 4px;
}
.tt-dpad {
  grid-template-rows: 48px 48px 44px;
}

.page-body-full {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.page-body-full .notepad-app,
.page-body-full .paint-app,
.page-body-full .terminal-app,
.page-body-full .vscode-app {
  min-height: 0;
  flex: 1;
  height: 100%;
}

.app-page {
  height: 100%;
}

.app-page .page-body-full {
  height: calc(100% - 52px);
}

/* desktop-icons layout set above — no scroll */

/* Keep title-bar controls from being tiny targets */
.title-bar-controls button {
  flex-shrink: 0;
}

/* Profile initials fallback when no photo */
.profile-pic:not(.has-photo)::after,
.user-avatar:not(.has-photo)::after,
.mobile-avatar:not(.has-photo)::after {
  content: "MA";
}

/* Ensure start menu scrolls if content is tall */
.start-menu-left .start-links {
  max-height: calc(100% - 70px);
  overflow-y: auto;
}

/* Dark mode readability for portfolio cards */
body:not(.light) .window-body h2 { color: #7eb8ff; }
body:not(.light) .window-body h3 { color: #a0c4ff; }
body:not(.light) .window-body { color: #e0e0e0; }
body:not(.light) .window-body a { color: #7eb8ff; }
body:not(.light) .project-card p,
body:not(.light) .window-body p { color: #ccc; }

/* ========== Advanced Window Management ========== */

/* Resize handles */
.resize-handle {
  position: absolute;
  z-index: 20;
  background: transparent;
}
.resize-n { top: 0; left: 8px; right: 8px; height: 5px; cursor: ns-resize; }
.resize-s { bottom: 0; left: 8px; right: 8px; height: 6px; cursor: ns-resize; }
.resize-e { right: 0; top: 8px; bottom: 8px; width: 6px; cursor: ew-resize; }
.resize-w { left: 0; top: 8px; bottom: 8px; width: 5px; cursor: ew-resize; }
.resize-ne { top: 0; right: 0; width: 10px; height: 10px; cursor: nesw-resize; }
.resize-nw { top: 0; left: 0; width: 10px; height: 10px; cursor: nwse-resize; }
.resize-se { bottom: 0; right: 0; width: 12px; height: 12px; cursor: nwse-resize; }
.resize-sw { bottom: 0; left: 0; width: 10px; height: 10px; cursor: nesw-resize; }

/* Snap preview (Aero Snap) */
.snap-preview {
  position: absolute;
  z-index: 40;
  pointer-events: none;
  background: rgba(36, 94, 219, 0.25);
  border: 2px solid rgba(36, 94, 219, 0.7);
  border-radius: 6px;
  box-shadow: inset 0 0 20px rgba(100, 160, 255, 0.2);
  transition: left 0.1s, top 0.1s, width 0.1s, height 0.1s;
}

/* Aero Snap + linked split-screen */
.window.snap-left,
.window.snap-right {
  border-radius: 0;
  transition: none;
}
body.split-resizing {
  cursor: col-resize !important;
}
body.split-resizing .window,
body.split-resizing .resize-handle {
  cursor: col-resize !important;
}
body.split-resizing .snap-left,
body.split-resizing .snap-right {
  outline: 1px solid rgba(36, 94, 219, 0.45);
}
/* Wider grab zone on shared split edge */
.window.snap-left .resize-e,
.window.snap-right .resize-w {
  width: 10px;
}
.window.snap-left .resize-e {
  right: -4px;
  background: linear-gradient(to right, transparent, rgba(36, 94, 219, 0.15));
}
.window.snap-right .resize-w {
  left: -4px;
  background: linear-gradient(to left, transparent, rgba(36, 94, 219, 0.15));
}
.snap-preview[data-zone="left"],
.snap-preview[data-zone="right"] {
  border-radius: 0 6px 6px 0;
}
.snap-preview[data-zone="right"] {
  border-radius: 6px 0 0 6px;
}
.snap-preview[data-zone="top"] {
  border-radius: 6px;
}


/* Window open / close / minimize animations */
.win-opening {
  animation: winOpen 0.18s ease-out;
}
.win-closing {
  animation: winClose 0.12s ease-in forwards;
  pointer-events: none;
}
.win-minimizing {
  animation: winMin 0.12s ease-in forwards;
  pointer-events: none;
}
@keyframes winOpen {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes winClose {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.9); }
}
@keyframes winMin {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to { opacity: 0; transform: scale(0.7) translateY(40px); }
}

/* Taskbar context menu */
.tb-context {
  position: fixed;
  z-index: 9999;
  min-width: 160px;
  background: #fff;
  border: 1px solid #0831d9;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.35);
  padding: 3px 0;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
}
.tb-context button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 5px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  color: #000;
}
.tb-context button:hover {
  background: #316ac5;
  color: #fff;
}
.tb-context hr {
  border: none;
  border-top: 1px solid #d0d0d0;
  margin: 3px 0;
}

/* Window management toolbar in start menu */
.wm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 12px;
}
.wm-actions button {
  flex: 1 1 45%;
  padding: 5px 6px !important;
  font-size: 11px !important;
  background: linear-gradient(to bottom, #f5f5f5, #e0e0e0) !important;
  border: 1px solid #999 !important;
  border-radius: 3px !important;
  color: #000 !important;
  cursor: pointer;
}
.wm-actions button:hover {
  background: linear-gradient(to bottom, #fff, #d0e0ff) !important;
  border-color: #316ac5 !important;
  color: #000 !important;
}

/* ========== Virtual Desktops ========== */
.vd-pager {
  display: flex;
  gap: 2px;
  align-items: center;
  padding: 0 6px;
  height: 28px;
  margin-right: 4px;
}

.vd-btn {
  width: 22px;
  height: 22px;
  border: 1px solid #1a4a9a;
  border-radius: 3px;
  background: linear-gradient(to bottom, #4a7de0 0%, #2a5cc0 100%);
  color: #fff;
  font-size: 11px;
  font-family: Tahoma, sans-serif;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  position: relative;
}

.vd-btn:hover {
  filter: brightness(1.15);
}

.vd-btn.active {
  background: linear-gradient(to bottom, #fff 0%, #cde 50%, #9bf 100%);
  color: #0a246a;
  border-color: #fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.vd-btn.has-windows::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #0f0;
}

.vd-btn.active.has-windows::after {
  background: #0a246a;
}

.vd-toast {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-family: Tahoma, sans-serif;
  font-size: 28px;
  font-weight: bold;
  padding: 16px 36px;
  border-radius: 8px;
  z-index: 300;
  pointer-events: none;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  animation: vdToast 0.8s ease-out forwards;
}

@keyframes vdToast {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); }
}

/* Desktop slide transition */
.desktop.vd-switching .wallpaper {
  animation: vdFade 0.25s ease;
}
@keyframes vdFade {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(0.7); }
}

.window.on-other-desktop {
  display: none !important;
}

.tb-context .vd-move-label {
  padding: 4px 16px 2px;
  font-size: 10px;
  color: #666;
  font-weight: bold;
  text-transform: uppercase;
}

/* VS Code run + output */
.vscode-titlebar {
  justify-content: flex-start;
  gap: 12px;
}
.vscode-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.vc-run, .vc-clear-out {
  padding: 2px 10px;
  font-size: 11px;
  border-radius: 3px;
  border: 1px solid #555;
  cursor: pointer;
  font-family: "Segoe UI", Tahoma, sans-serif;
}
.vc-run {
  background: #0e639c;
  color: #fff;
  border-color: #1177bb;
  font-weight: 600;
}
.vc-run:hover { background: #1177bb; }
.vc-clear-out {
  background: #3c3c3c;
  color: #ccc;
}
.vc-clear-out:hover { background: #505050; }

.vscode-editor-area {
  min-height: 0;
}
.vscode-code {
  flex: 1;
  min-height: 120px;
}
.vscode-output-panel {
  height: 140px;
  min-height: 80px;
  max-height: 40%;
  display: flex;
  flex-direction: column;
  border-top: 1px solid #333;
  background: #1e1e1e;
  flex-shrink: 0;
}
.vscode-output-header {
  padding: 4px 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  background: #252526;
  border-bottom: 1px solid #333;
}
.vc-out-hint { text-transform: none; letter-spacing: 0; color: #666; }
.vscode-output {
  flex: 1;
  margin: 0;
  padding: 8px 12px;
  overflow: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  color: #d4d4d4;
  white-space: pre-wrap;
  word-break: break-word;
}
.vscode-output.vc-err {
  color: #f48771;
}

/* Icon text wrapping for XP look */
.desktop-icons .icon span {
  display: block;
  max-width: 74px;
  text-align: center;
  line-height: 1.2;
  word-wrap: break-word;
}
.desktop-icons .icon {
  height: auto;
  min-height: 72px;
  flex-shrink: 0;
}

/* VS Code Preview + panel tabs */
.vscode-output-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.vc-panel-tab {
  background: transparent;
  border: none;
  color: #888;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: "Segoe UI", Tahoma, sans-serif;
}
.vc-panel-tab:hover { color: #ccc; background: #333; }
.vc-panel-tab.active {
  color: #fff;
  background: #0e639c;
}
.vc-panel-body {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}
.vscode-preview {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
  min-height: 100px;
}
.vscode-output-panel {
  height: 180px;
  max-height: 45%;
}

/* ========== Admin CMS panel ========== */
.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.admin-overlay[hidden] { display: none !important; }

.admin-panel {
  width: min(640px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: #f5f5f0;
  border: 1px solid #0831d9;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  font-family: Tahoma, "Segoe UI", sans-serif;
  color: #111;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(to right, #0a246a, #a6caf0);
  color: #fff;
  border-radius: 7px 7px 0 0;
}
.admin-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
}
.admin-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: linear-gradient(to bottom, #ff9a9a, #e81123);
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}
.admin-close:hover { filter: brightness(1.1); }

.admin-login,
.admin-editor {
  padding: 16px 18px 20px;
}

.admin-hint, .admin-foot {
  font-size: 12px;
  color: #444;
  margin-bottom: 12px;
}
.admin-foot code {
  background: #e8e8e0;
  padding: 1px 6px;
  border-radius: 3px;
}

.admin-label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  color: #0a246a;
  margin-bottom: 12px;
}
.admin-label input,
.admin-label textarea,
.admin-toolbar select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  border: 1px solid #7f9db9;
  border-radius: 3px;
  background: #fff;
  color: #111;
  box-sizing: border-box;
}
.admin-label textarea {
  resize: vertical;
  min-height: 220px;
  line-height: 1.4;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  align-items: center;
}
.admin-toolbar select {
  width: auto;
  min-width: 140px;
  flex: 1;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
}

.admin-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-family: Tahoma, sans-serif;
  border: 1px solid #888;
  border-radius: 3px;
  background: linear-gradient(to bottom, #fff, #e0e0e0);
  cursor: pointer;
  color: #111;
}
.admin-btn:hover {
  background: linear-gradient(to bottom, #fff, #d0e0ff);
  border-color: #316ac5;
}
.admin-btn.primary {
  background: linear-gradient(to bottom, #5a9aef, #245edb);
  border-color: #1941a5;
  color: #fff;
  font-weight: bold;
}
.admin-btn.primary:hover {
  filter: brightness(1.08);
}
.admin-btn.danger {
  background: linear-gradient(to bottom, #ffb0b0, #e81123);
  border-color: #a00;
  color: #fff;
}

.admin-error {
  color: #c00;
  font-size: 12px;
  margin: 0 0 10px;
}
.admin-status {
  font-size: 12px;
  color: #2d6b22;
  min-height: 1.2em;
  margin: 0 0 8px;
}
.admin-status.err { color: #c00; }

.admin-help {
  margin: 12px 0;
  font-size: 12px;
  color: #333;
}
.admin-help summary {
  cursor: pointer;
  font-weight: bold;
  color: #245edb;
}
.admin-help ul {
  margin: 8px 0 0 18px;
  padding: 0;
}
.admin-help li { margin-bottom: 4px; }

.admin-password-change {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #ccc;
}

body:not(.light) .admin-panel {
  background: #2a2a2e;
  color: #eee;
  border-color: #4a6ab0;
}
body:not(.light) .admin-label { color: #7eb8ff; }
body:not(.light) .admin-label input,
body:not(.light) .admin-label textarea,
body:not(.light) .admin-toolbar select {
  background: #1e1e1e;
  color: #ddd;
  border-color: #555;
}
body:not(.light) .admin-hint,
body:not(.light) .admin-foot { color: #aaa; }
body:not(.light) .admin-foot code { background: #3a3a40; color: #eee; }
body:not(.light) .admin-btn {
  background: #3e3e42;
  border-color: #555;
  color: #ddd;
}


/* ========== VS Code Pro layout ========== */
.vscode-pro {
  background: #1e1e1e;
  color: #cccccc;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 13px;
}
.vscode-menubar {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 30px;
  padding: 0 8px;
  background: #3c3c3c;
  border-bottom: 1px solid #252526;
  flex-shrink: 0;
  font-size: 12px;
  color: #ccc;
  user-select: none;
}
.vc-menu-item {
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
}
.vc-menu-item:hover { background: #505050; }
.vscode-menubar-center {
  flex: 1;
  text-align: center;
  color: #999;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 12px;
}
.vscode-pro .vscode-actions { margin-left: 0; display: flex; gap: 6px; }
.vscode-main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.vscode-activity {
  width: 48px;
  background: #333333;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 4px;
  flex-shrink: 0;
  border-right: 1px solid #252526;
}
.vc-act {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #858585;
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.vc-act:hover { color: #fff; }
.vc-act.active { color: #fff; }
.vc-act.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #fff;
  border-radius: 0 2px 2px 0;
}
.vscode-pro .vscode-sidebar {
  width: 200px;
  background: #252526;
  border-right: 1px solid #1e1e1e;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}
.vc-side-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.vc-side-panel[hidden] { display: none !important; }
.side-folder {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #ccc;
  letter-spacing: 0.3px;
}
.vc-side-actions { padding: 8px 12px; }
.vc-new-file {
  width: 100%;
  padding: 5px 8px;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid #3c3c3c;
  background: #2a2d2e;
  color: #ccc;
  border-radius: 3px;
  font-family: "Segoe UI", Tahoma, sans-serif;
}
.vc-new-file:hover { background: #37373d; border-color: #007acc; }
.vc-search-input {
  margin: 8px 12px;
  padding: 6px 8px;
  background: #3c3c3c;
  border: 1px solid #3c3c3c;
  color: #ccc;
  border-radius: 3px;
  font-size: 12px;
  outline: none;
}
.vc-search-input:focus { border-color: #007acc; }
.vc-search-results {
  flex: 1;
  overflow: auto;
  padding: 0 8px 8px;
  font-size: 11px;
}
.vc-search-hit {
  padding: 6px 8px;
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 2px;
  color: #ccc;
}
.vc-search-hit:hover { background: #2a2d2e; }
.vc-search-hit strong { color: #4ec9b0; font-weight: 600; }
.vc-git-info, .vc-ext-list { padding: 12px; font-size: 12px; color: #ccc; }
.vc-git-info .muted, .muted { color: #888; font-size: 11px; }
.vc-ext {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #333;
}
.vc-ext span { color: #888; font-size: 10px; }
.vscode-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #1e1e1e;
  border-bottom: 1px solid #252526;
  font-size: 12px;
  color: #bbbbbb;
  flex-shrink: 0;
}
.vc-crumb-sep { color: #666; }
.vc-crumb-file { color: #ccc; }
.vscode-pro .vscode-tabs {
  background: #252526;
  min-height: 35px;
}
.vscode-pro .vscode-tab {
  padding: 8px 12px;
  gap: 6px;
  border-right: 1px solid #1e1e1e;
}
.vscode-pro .vscode-tab.active {
  background: #1e1e1e;
  border-top: 1px solid #007acc;
  color: #fff;
}
.vc-tab-icon { font-size: 12px; }
.vc-tab-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.vscode-pro .vscode-linenumbers {
  background: #1e1e1e;
  color: #858585;
  padding-top: 10px;
}
.vscode-pro .vc-editor,
.vscode-pro .vscode-code textarea {
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  caret-color: #aeafad;
}
.vscode-terminal-panel {
  flex: 1;
  background: #1e1e1e;
  padding: 10px 12px;
  font-family: Consolas, monospace;
  font-size: 12px;
  overflow: auto;
  color: #cccccc;
}
.vc-term-prompt { color: #4ec9b0; }
.vc-term-ok { color: #4ec9b0; }
.vc-term-cursor { color: #fff; animation: vcBlink 1s step-end infinite; }
@keyframes vcBlink {
  50% { opacity: 0; }
}
.vc-command-palette {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 90%);
  background: #252526;
  border: 1px solid #007acc;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 50;
  border-radius: 6px;
  overflow: hidden;
}
.vc-cmd-input {
  width: 100%;
  padding: 10px 14px;
  background: #3c3c3c;
  border: none;
  border-bottom: 1px solid #007acc;
  color: #fff;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, sans-serif;
}
.vc-cmd-list { max-height: 240px; overflow: auto; }
.vc-cmd-item {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 12px;
  color: #ccc;
}
.vc-cmd-item:hover, .vc-cmd-item.active { background: #094771; color: #fff; }
.vc-cmd-item.muted { color: #888; cursor: default; }
.vscode-pro .vscode-statusbar {
  background: #007acc;
  height: 22px;
  font-size: 11px;
}
.vc-sb-left, .vc-sb-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vc-sb-branch { font-weight: 500; }
.vscode-pro .vscode-editor-area { min-height: 0; }
.vscode-pro .vscode-output-panel { height: 160px; max-height: 40%; }

/* Larger default VS Code window */
.window[data-id="vscode"] {
  width: 720px !important;
  height: 500px !important;
  max-width: min(92vw, 900px);
  max-height: min(calc(100vh - 60px), 640px);
}


/* ========== Dark mode polish ========== */
/* Only tint default wallpaper in dark mode — never fight custom wallpapers */
body:not(.light):not([data-wallpaper]) .wallpaper,
body:not(.light)[data-wallpaper="default"] .wallpaper {
  background:
    radial-gradient(ellipse at 30% 20%, #1e3a5f 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, #0f172a 0%, transparent 45%),
    linear-gradient(160deg, #0b1220 0%, #1a2744 40%, #0f172a 100%);
  filter: saturate(1.05);
}
body:not(.light)[data-wallpaper]:not([data-wallpaper="default"]) .wallpaper {
  filter: none;
}
body:not(.light) .desktop-icons .icon span {
  color: var(--icon-label);
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}
body:not(.light) .window {
  background: var(--xp-window-bg);
  border-color: #0f172a;
  color: var(--text);
}
body:not(.light) .title-bar {
  background: var(--xp-title);
}
body:not(.light) .window-body {
  background: var(--xp-window-bg);
  color: var(--text);
}
body:not(.light) .taskbar {
  background: var(--xp-taskbar);
  border-top-color: #334155;
}
body:not(.light) .start-btn {
  background: var(--xp-start);
}
body:not(.light) .task-btn {
  background: var(--taskbar-btn);
  color: #e2e8f0;
  border-color: transparent;
}
body:not(.light) .task-btn.active {
  background: rgba(59, 130, 246, 0.35);
  border-color: #3b82f6;
}
body:not(.light) .start-menu {
  background: var(--start-menu-bg);
  border-color: #334155;
  color: var(--text);
}
body:not(.light) .start-menu a,
body:not(.light) .start-menu button,
body:not(.light) .start-links button {
  color: var(--text);
}
body:not(.light) .start-menu button:hover,
body:not(.light) .start-links button:hover {
  background: #334155;
}
body:not(.light) .context-menu {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
body:not(.light) .context-menu button:hover {
  background: #334155;
}
body:not(.light) .boot-screen {
  background: #000;
}
body:not(.light) .sticky-note {
  background: #3d3a1f;
  color: #f5f5dc;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}
body:not(.light) .profile-pic {
  border-color: #3b82f6;
}
body:not(.light) .skill-bar {
  background: #334155;
}
body:not(.light) .skill-bar > span {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}
body:not(.light) .clock {
  color: #e2e8f0;
}
body:not(.light) .tray {
  color: #cbd5e1;
}
/* Smooth theme transition for main surfaces */
body, .desktop, .wallpaper, .window, .taskbar, .start-menu, .mobile {
  transition: background-color 0.25s ease, color 0.2s ease, border-color 0.2s ease;
}


/* ========== Desktop context menu ========== */
.context-menu {
  position: fixed;
  z-index: 9000;
  min-width: 180px;
  background: #fff;
  border: 1px solid #666;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.35);
  padding: 4px 0;
  font-family: Tahoma, "Segoe UI", sans-serif;
  font-size: 12px;
}
.context-menu[hidden] { display: none !important; }
.context-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 5px 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  color: #111;
}
.context-menu button:hover {
  background: #316ac5;
  color: #fff;
}
.ctx-sep {
  height: 1px;
  background: #ccc;
  margin: 4px 8px;
}
.wallpaper.refresh-flash {
  filter: brightness(1.25) saturate(1.15) !important;
  transition: filter 0.2s ease, background 0.35s ease;
}
.wallpaper {
  transition: background 0.35s ease, filter 0.2s ease;
}
.home-screen {
  transition: background 0.35s ease;
}

/* ========== OS logoff / shutdown overlay ========== */
.os-overlay {
  position: fixed;
  inset: 0;
  z-index: 30000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: Tahoma, "Segoe UI", sans-serif;
}
.os-overlay[hidden] { display: none !important; }
.os-overlay-inner { text-align: center; max-width: 360px; padding: 24px; }
.os-overlay-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, #f60 0 50%, transparent 50%),
    linear-gradient(225deg, #4c0 0 50%, transparent 50%),
    linear-gradient(315deg, #06f 0 50%, transparent 50%),
    linear-gradient(45deg, #fc0 0 50%, transparent 50%);
  background-size: 50% 50%;
  background-position: top left, top right, bottom right, bottom left;
  background-repeat: no-repeat;
  background-color: #000;
}
.os-overlay-msg {
  font-size: 18px;
  margin: 0 0 16px;
  color: #9cf;
}
.os-overlay.safe-off .os-overlay-msg {
  color: #0f0;
  font-family: Consolas, monospace;
  font-size: 16px;
}
.os-overlay-bar {
  height: 14px;
  border: 1px solid #333;
  background: #111;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}
.os-overlay-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #245edb, #5a9aef);
  transition: width 0.15s linear;
}
.os-overlay-sub {
  font-size: 12px;
  color: #888;
  margin: 0 0 16px;
  min-height: 1.2em;
}
.os-overlay-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-family: Tahoma, sans-serif;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(to bottom, #3c8a2e, #2d6b22);
  border: 1px solid #1a4a12;
  border-radius: 4px;
  cursor: pointer;
}
.os-overlay-btn:hover { filter: brightness(1.1); }

/* ========== Minesweeper ========== */
.minesweeper-icon {
  background: linear-gradient(135deg, #c0c0c0, #808080);
}
.minesweeper-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='14' fill='%23333'/%3E%3Ccircle cx='18' cy='20' r='2' fill='%23fff'/%3E%3Ccircle cx='30' cy='20' r='2' fill='%23fff'/%3E%3Cpath stroke='%23fff' stroke-width='2' d='M16 30q8 6 16 0' fill='none'/%3E%3C/svg%3E");
}
.sm-icon.minesweeper-icon {
  background: linear-gradient(135deg, #c0c0c0, #808080);
}
.minesweeper-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  background: #c0c0c0;
  height: 100%;
  box-sizing: border-box;
  font-family: Tahoma, sans-serif;
  user-select: none;
}
.ms-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 240px;
  margin-bottom: 8px;
  padding: 4px 6px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  box-sizing: border-box;
}
.ms-mines, .ms-time {
  font-family: Consolas, monospace;
  font-weight: bold;
  font-size: 14px;
  background: #000;
  color: #f00;
  padding: 2px 6px;
  min-width: 56px;
  text-align: center;
}
.ms-face {
  width: 32px;
  height: 32px;
  font-size: 18px;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  background: #c0c0c0;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.ms-face:active {
  border-color: #808080 #fff #fff #808080;
}
.ms-board {
  display: grid;
  gap: 0;
  border: 3px solid;
  border-color: #808080 #fff #fff #808080;
  background: #c0c0c0;
}
.ms-cell {
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  background: #c0c0c0;
  font-size: 12px;
  font-weight: bold;
  font-family: Tahoma, sans-serif;
  cursor: pointer;
  line-height: 20px;
  text-align: center;
}
.ms-cell.open {
  border: 1px solid #808080;
  background: #c0c0c0;
  cursor: default;
}
.ms-cell.mine { background: #f66; }
.ms-cell[data-n="1"] { color: #00f; }
.ms-cell[data-n="2"] { color: #008000; }
.ms-cell[data-n="3"] { color: #f00; }
.ms-cell[data-n="4"] { color: #000080; }
.ms-cell[data-n="5"] { color: #800000; }
.ms-cell[data-n="6"] { color: #008080; }
.ms-cell[data-n="7"] { color: #000; }
.ms-cell[data-n="8"] { color: #808080; }
.ms-status {
  margin-top: 8px;
  font-size: 11px;
  color: #333;
}
.window[data-id="minesweeper"] {
  width: 320px !important;
  height: 380px !important;
}

/* ========== Project cards with demo frames ========== */
.proj-intro {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.proj-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.proj-header h4 { margin: 0; }
.proj-desc {
  margin: 8px 0 6px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text, #1a202c);
}
.project-card > p {
  margin: 4px 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text, #222);
}
.project-card > p strong {
  color: var(--xp-blue, #245edb);
}
body:not(.light) .proj-desc {
  color: #e2e8f0;
}
body:not(.light) .project-card > p {
  color: #cbd5e1;
}
body:not(.light) .project-card > p strong {
  color: #93c5fd;
}
.proj-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e0e0e0;
  color: #333;
  font-weight: 600;
}
.proj-badge.live {
  background: #dcfce7;
  color: #166534;
}
body:not(.light) .proj-badge { background: #334155; color: #e2e8f0; }
body:not(.light) .proj-badge.live { background: #14532d; color: #86efac; }
.proj-demo-frame {
  height: 72px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border: 1px solid rgba(0,0,0,0.12);
  overflow: hidden;
  position: relative;
}
.proj-demo-label {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Attractive SVG project previews — fluid / responsive */
.proj-visual {
  height: auto;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.14);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 360 / 140;
  overflow: hidden;
  border-radius: 8px;
  container-type: inline-size;
}
.proj-visual:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}
.proj-svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  vertical-align: top;
  aspect-ratio: 360 / 140;
}
/* Scale text/icons slightly on very narrow cards via container queries when supported */
@container (max-width: 280px) {
  .proj-svg {
    /* viewBox handles geometry; keep full width */
  }
}
.project-card[data-project] {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.project-card[data-project]:hover {
  border-color: #5a9aef;
  box-shadow: 0 2px 10px rgba(36, 94, 219, 0.15);
}
body:not(.light) .project-card[data-project]:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.2);
}
body:not(.light) .proj-visual {
  border-color: #334155;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

/* Mobile / narrow: full-bleed fluid SVG, no hard max-height crop */
.mobile-card .proj-visual {
  min-height: 0;
  max-height: none;
  border-radius: 10px;
  aspect-ratio: 360 / 140;
}
.mobile-card .proj-svg {
  max-height: none;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

/* Windowed desktop: clamp only on very large cards so previews stay proportional */
@media (min-width: 900px) {
  .proj-visual {
    max-height: 180px;
  }
  .proj-svg {
    max-height: 180px;
  }
}
@media (max-width: 480px) {
  .proj-visual {
    max-height: none;
    border-radius: 10px;
  }
  .proj-svg {
    max-height: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .proj-visual:hover {
    transform: none;
  }
}


/* Real site screenshot previews */
.proj-screenshot {
  height: auto;
  min-height: 0;
  padding: 0;
  background: #0f172a;
}
.proj-screenshot picture,
.proj-screenshot .proj-shot {
  display: block;
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: cover;
  object-position: top center;
  vertical-align: top;
}
.proj-screenshot .proj-shot {
  border-radius: 0;
}
.mobile-card .proj-screenshot .proj-shot {
  max-height: 140px;
}
body:not(.light) .proj-screenshot {
  background: #0f172a;
}

/* ========== Project SVG preview animations ========== */
/* Marker: proj-svg-anims */

@keyframes projPosterFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes projCursorBlink {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes projMetricPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes projMetricGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}
@keyframes projCtaPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes projDashIn {
  0% { opacity: 0.45; }
  50% { opacity: 1; }
  100% { opacity: 0.75; }
}
@keyframes projBarGrow {
  0%, 100% { transform: scaleX(1); transform-origin: left center; }
  50% { transform: scaleX(1.08); transform-origin: left center; }
}
@keyframes projIconBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes projWindowBreathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes projStartPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}
@keyframes projSearchShimmer {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* --- Performance-oriented SVG motion ---
   - Only transform/opacity (compositor-friendly)
   - Paused when off-screen (.in-view toggled by IntersectionObserver)
   - No permanent will-change (avoids extra layers for 6 cards × many nodes)
   - contain: on frame limits style/layout invalidation
*/
.proj-visual {
  contain: layout style;
  content-visibility: auto;
  contain-intrinsic-size: 360px 140px;
}

/* Default: animations defined but paused (zero ongoing work off-screen) */
.proj-visual .anim-poster,
.proj-visual .anim-search-panel,
.proj-visual .anim-cursor,
.proj-visual .anim-metric,
.proj-visual .anim-metric-val,
.proj-visual .anim-cta,
.proj-visual .anim-dash,
.proj-visual .anim-bar,
.proj-visual .anim-icon,
.proj-visual .anim-window,
.proj-visual .anim-start {
  animation-play-state: paused;
  transform-box: fill-box;
  transform-origin: center;
}

.proj-visual.in-view .anim-poster,
.proj-visual.in-view .anim-search-panel,
.proj-visual.in-view .anim-cursor,
.proj-visual.in-view .anim-metric,
.proj-visual.in-view .anim-metric-val,
.proj-visual.in-view .anim-cta,
.proj-visual.in-view .anim-dash,
.proj-visual.in-view .anim-bar,
.proj-visual.in-view .anim-icon,
.proj-visual.in-view .anim-window,
.proj-visual.in-view .anim-start {
  animation-play-state: running;
}

/* Optional boost only while hovering an in-view card */
.project-card:hover .proj-visual.in-view .anim-poster,
.project-card:hover .proj-visual.in-view .anim-metric,
.project-card:hover .proj-visual.in-view .anim-icon,
.project-card:hover .proj-visual.in-view .anim-window {
  will-change: transform;
}

.proj-visual .anim-poster {
  animation: projPosterFloat 3.6s ease-in-out infinite;
}
.proj-visual .anim-poster.anim-d0 { animation-delay: 0s; }
.proj-visual .anim-poster.anim-d1 { animation-delay: 0.4s; }
.proj-visual .anim-poster.anim-d2 { animation-delay: 0.8s; }

.proj-visual .anim-search-panel {
  animation: projSearchShimmer 3.2s ease-in-out infinite;
}

.proj-visual .anim-cursor {
  animation: projCursorBlink 1.1s step-end infinite;
}

/* Single transform animation on metric group — drop separate glow layer work */
.proj-visual .anim-metric {
  animation: projMetricPulse 2.8s ease-in-out infinite;
}
.proj-visual .anim-metric.anim-d0 { animation-delay: 0s; }
.proj-visual .anim-metric.anim-d1 { animation-delay: 0.45s; }
.proj-visual .anim-metric.anim-d2 { animation-delay: 0.9s; }
.proj-visual .anim-metric-val {
  /* opacity-only is cheap; keep subtle without filter (filter is costly) */
  animation: projSearchShimmer 2.8s ease-in-out infinite;
}

.proj-visual .anim-cta {
  animation: projCtaPulse 2.2s ease-in-out infinite;
}

.proj-visual .anim-dash {
  animation: projDashIn 3.4s ease-in-out infinite;
}
.proj-visual .anim-dash.anim-d0 { animation-delay: 0s; }
.proj-visual .anim-dash.anim-d1 { animation-delay: 0.5s; }
.proj-visual .anim-dash.anim-d2 { animation-delay: 1s; }

.proj-visual .anim-bar {
  animation: projBarGrow 3s ease-in-out infinite;
  transform-origin: left center;
}
.proj-visual .anim-bar.anim-d1 { animation-delay: 0.55s; }

.proj-visual .anim-icon {
  animation: projIconBob 2.8s ease-in-out infinite;
}
.proj-visual .anim-icon.anim-d0 { animation-delay: 0s; }
.proj-visual .anim-icon.anim-d1 { animation-delay: 0.35s; }
.proj-visual .anim-icon.anim-d2 { animation-delay: 0.7s; }

.proj-visual .anim-window {
  animation: projWindowBreathe 4s ease-in-out infinite;
}

.proj-visual .anim-start {
  animation: projStartPulse 2.4s ease-in-out infinite;
}

/* Clear will-change when not hovering to free GPU layers */
.project-card:not(:hover) .proj-visual [class*="anim-"] {
  will-change: auto;
}

/* Pause motion when user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .proj-visual .anim-poster,
  .proj-visual .anim-search-panel,
  .proj-visual .anim-cursor,
  .proj-visual .anim-metric,
  .proj-visual .anim-metric-val,
  .proj-visual .anim-cta,
  .proj-visual .anim-dash,
  .proj-visual .anim-bar,
  .proj-visual .anim-icon,
  .proj-visual .anim-window,
  .proj-visual .anim-start {
    animation: none !important;
    will-change: auto !important;
  }
}

/* Slightly stronger motion on hover of an in-view card only */
.project-card:hover .proj-visual.in-view .anim-poster {
  animation-duration: 2.6s;
}
.project-card:hover .proj-visual.in-view .anim-metric {
  animation-duration: 2s;
}


.proj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 8px;
}
.proj-btn {
  display: inline-block;
  padding: 6px 12px;
  font-size: 12px;
  font-family: Tahoma, "Segoe UI", sans-serif;
  border-radius: 4px;
  border: 1px solid #7f9db9;
  background: linear-gradient(to bottom, #fff, #e8e8e8);
  color: #111;
  text-decoration: none;
  cursor: pointer;
}
.proj-btn:hover { border-color: #316ac5; background: #e8f0ff; }
.proj-btn.primary {
  background: linear-gradient(to bottom, #5a9aef, #245edb);
  border-color: #1941a5;
  color: #fff;
  font-weight: 600;
}
.proj-btn.primary:hover { filter: brightness(1.08); }
.proj-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
body:not(.light) .proj-btn {
  background: #334155;
  border-color: #475569;
  color: #e2e8f0;
}
body:not(.light) .proj-btn.primary {
  background: linear-gradient(to bottom, #3b82f6, #1d4ed8);
  border-color: #1e40af;
  color: #fff;
}

/* ========== Control Panel ========== */
.control-icon { background: linear-gradient(135deg, #90a4ae, #546e7a); }
.control-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='8' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cpath stroke='%23fff' stroke-width='3' d='M24 8v4M24 36v4M8 24h4M36 24h4M12 12l3 3M33 33l3 3M12 36l3-3M33 15l3-3'/%3E%3C/svg%3E");
}
.control-app { padding: 12px 14px; font-size: 12px; color: var(--text); }
.cp-title { margin: 0 0 12px; font-size: 16px; }
.cp-section {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #ccc);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.cp-section h4 { margin: 0 0 8px; font-size: 13px; }
.cp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.cp-row select, .cp-row input { font-family: Tahoma, sans-serif; font-size: 12px; }
.cp-about { margin: 0; color: var(--text-muted); line-height: 1.4; }
.cp-test-sound { margin-top: 4px; }

/* Wallpaper variants */
body[data-wallpaper="green"] .wallpaper {
  background: linear-gradient(160deg, #1b4332 0%, #2d6a4f 40%, #40916c 100%) !important;
}
body[data-wallpaper="sunset"] .wallpaper {
  background: linear-gradient(160deg, #4a1942 0%, #c44900 45%, #ffb703 100%) !important;
}
body[data-wallpaper="night"] .wallpaper {
  background: linear-gradient(160deg, #0d1b2a 0%, #1b263b 50%, #415a77 100%) !important;
}

/* —— Modern Apple-inspired wallpapers (CSS only) —— */

/* Sonoma — soft peach / sky abstract */
body[data-wallpaper="sonoma"] .wallpaper {
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(255, 180, 140, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 25%, rgba(140, 190, 255, 0.5) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255, 220, 200, 0.35) 0%, transparent 60%),
    linear-gradient(165deg, #f5e6dc 0%, #c8d9f0 45%, #9bb8e0 100%) !important;
}
body.light[data-wallpaper="sonoma"] .wallpaper {
  background:
    radial-gradient(ellipse 80% 60% at 15% 85%, rgba(255, 160, 120, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 20%, rgba(120, 180, 255, 0.4) 0%, transparent 50%),
    linear-gradient(165deg, #fff5ef 0%, #d6e8fa 50%, #a8c8f0 100%) !important;
}

/* Sequoia — deep teal / forest glass */
body[data-wallpaper="sequoia"] .wallpaper {
  background:
    radial-gradient(ellipse 90% 70% at 10% 90%, rgba(20, 80, 70, 0.7) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 90% 15%, rgba(40, 120, 100, 0.45) 0%, transparent 45%),
    radial-gradient(circle at 50% 40%, rgba(60, 140, 120, 0.25) 0%, transparent 55%),
    linear-gradient(160deg, #0a1f1c 0%, #143d36 40%, #1a5c52 100%) !important;
}
body.light[data-wallpaper="sequoia"] .wallpaper {
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(80, 160, 140, 0.4) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 20%, rgba(100, 180, 160, 0.35) 0%, transparent 50%),
    linear-gradient(160deg, #e8f5f2 0%, #b8ddd4 50%, #7eb8a8 100%) !important;
}

/* Ventura — purple / indigo aurora */
body[data-wallpaper="ventura"] .wallpaper {
  background:
    radial-gradient(ellipse 70% 55% at 15% 70%, rgba(120, 60, 180, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse 65% 50% at 85% 25%, rgba(60, 100, 220, 0.5) 0%, transparent 50%),
    radial-gradient(ellipse 40% 35% at 55% 45%, rgba(180, 100, 220, 0.3) 0%, transparent 55%),
    linear-gradient(155deg, #1a1030 0%, #2a1a50 40%, #1e2a60 100%) !important;
}
body.light[data-wallpaper="ventura"] .wallpaper {
  background:
    radial-gradient(ellipse 70% 55% at 20% 75%, rgba(180, 140, 230, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse 65% 50% at 80% 20%, rgba(140, 170, 255, 0.4) 0%, transparent 50%),
    linear-gradient(155deg, #f0e8ff 0%, #d4d0f5 45%, #b0c0f0 100%) !important;
}

/* Monterey — ocean wave blues */
body[data-wallpaper="monterey"] .wallpaper {
  background:
    radial-gradient(ellipse 100% 40% at 50% 100%, rgba(20, 80, 140, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse 80% 35% at 30% 85%, rgba(40, 140, 200, 0.4) 0%, transparent 45%),
    radial-gradient(ellipse 60% 30% at 70% 75%, rgba(80, 180, 220, 0.3) 0%, transparent 40%),
    linear-gradient(180deg, #0a1628 0%, #0e2848 35%, #143a60 70%, #1a4a70 100%) !important;
}
body.light[data-wallpaper="monterey"] .wallpaper {
  background:
    radial-gradient(ellipse 100% 45% at 50% 100%, rgba(60, 140, 200, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 70% 40% at 25% 80%, rgba(100, 180, 230, 0.3) 0%, transparent 45%),
    linear-gradient(180deg, #e8f4fc 0%, #b8d8f0 40%, #78b0d8 100%) !important;
}

/* Big Sur — layered hill silhouettes */
body[data-wallpaper="bigsur"] .wallpaper {
  background:
    linear-gradient(180deg, transparent 55%, rgba(20, 50, 40, 0.85) 55%, rgba(15, 40, 35, 0.95) 70%, #0a1a18 100%),
    linear-gradient(180deg, transparent 42%, rgba(40, 90, 70, 0.55) 42%, rgba(30, 70, 55, 0.7) 58%, transparent 58%),
    linear-gradient(180deg, transparent 28%, rgba(60, 120, 90, 0.35) 28%, rgba(50, 100, 80, 0.45) 45%, transparent 45%),
    radial-gradient(ellipse 50% 30% at 70% 22%, rgba(255, 200, 120, 0.35) 0%, transparent 60%),
    linear-gradient(180deg, #1a3050 0%, #2a5080 25%, #3a7090 50%, #2a6050 100%) !important;
}
body.light[data-wallpaper="bigsur"] .wallpaper {
  background:
    linear-gradient(180deg, transparent 55%, rgba(80, 140, 110, 0.5) 55%, rgba(60, 120, 95, 0.65) 70%, #4a9070 100%),
    linear-gradient(180deg, transparent 40%, rgba(120, 180, 150, 0.4) 40%, rgba(100, 160, 130, 0.5) 55%, transparent 55%),
    radial-gradient(ellipse 45% 28% at 75% 18%, rgba(255, 220, 150, 0.5) 0%, transparent 55%),
    linear-gradient(180deg, #a8d0f0 0%, #90c0e8 30%, #78b0c8 55%, #68a090 100%) !important;
}

/* Aurora Borealis */
body[data-wallpaper="aurora"] .wallpaper {
  background:
    radial-gradient(ellipse 90% 40% at 20% 30%, rgba(40, 220, 160, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 80% 35% at 70% 40%, rgba(80, 120, 255, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse 70% 30% at 45% 55%, rgba(160, 80, 255, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse 60% 25% at 80% 20%, rgba(0, 255, 180, 0.25) 0%, transparent 45%),
    linear-gradient(180deg, #050a18 0%, #0a1528 40%, #0e1a30 100%) !important;
}
body.light[data-wallpaper="aurora"] .wallpaper {
  background:
    radial-gradient(ellipse 90% 40% at 25% 35%, rgba(80, 220, 180, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse 80% 35% at 70% 45%, rgba(120, 150, 255, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse 70% 30% at 50% 60%, rgba(180, 120, 255, 0.25) 0%, transparent 50%),
    linear-gradient(180deg, #e8f0ff 0%, #d0e0f8 50%, #b8d0f0 100%) !important;
}

/* Soft horizon — dawn peach / gold */
body[data-wallpaper="horizon"] .wallpaper {
  background:
    radial-gradient(ellipse 100% 50% at 50% 100%, rgba(255, 160, 80, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse 60% 30% at 50% 70%, rgba(255, 200, 140, 0.35) 0%, transparent 50%),
    linear-gradient(180deg, #1a2040 0%, #3a4060 30%, #8a6070 60%, #e09060 85%, #f0c080 100%) !important;
}
body.light[data-wallpaper="horizon"] .wallpaper {
  background:
    radial-gradient(ellipse 100% 45% at 50% 100%, rgba(255, 180, 100, 0.4) 0%, transparent 55%),
    linear-gradient(180deg, #c8d8f0 0%, #e0d0d8 40%, #f0c8a0 70%, #ffd8a8 100%) !important;
}

/* Deep nebula */
body[data-wallpaper="nebula"] .wallpaper {
  background:
    radial-gradient(ellipse 50% 40% at 30% 40%, rgba(180, 60, 200, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse 45% 35% at 70% 60%, rgba(60, 80, 220, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse 35% 30% at 55% 25%, rgba(255, 100, 180, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 15% 80%, rgba(40, 200, 255, 0.2) 0%, transparent 40%),
    linear-gradient(160deg, #08051a 0%, #120a28 50%, #0a1028 100%) !important;
}
body.light[data-wallpaper="nebula"] .wallpaper {
  background:
    radial-gradient(ellipse 50% 40% at 30% 40%, rgba(200, 120, 220, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 45% 35% at 70% 55%, rgba(120, 140, 240, 0.3) 0%, transparent 50%),
    linear-gradient(160deg, #f0e8ff 0%, #e0d8f8 50%, #d0d8f5 100%) !important;
}

/* Midnight glow — elegant dark with blue rim light */
body[data-wallpaper="midnight"] .wallpaper {
  background:
    radial-gradient(ellipse 70% 50% at 50% 110%, rgba(40, 100, 200, 0.4) 0%, transparent 55%),
    radial-gradient(ellipse 40% 25% at 80% 15%, rgba(100, 140, 255, 0.2) 0%, transparent 50%),
    linear-gradient(165deg, #050810 0%, #0a1220 40%, #0e1a30 100%) !important;
}
body.light[data-wallpaper="midnight"] .wallpaper {
  background:
    radial-gradient(ellipse 70% 50% at 50% 110%, rgba(80, 140, 220, 0.25) 0%, transparent 55%),
    linear-gradient(165deg, #e8eef8 0%, #d0dcec 50%, #b8cce0 100%) !important;
}

/* Mint glass */
body[data-wallpaper="mint"] .wallpaper {
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(100, 230, 200, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 80% 70%, rgba(80, 200, 180, 0.3) 0%, transparent 50%),
    linear-gradient(150deg, #0a201c 0%, #143830 45%, #1a5048 100%) !important;
}
body.light[data-wallpaper="mint"] .wallpaper {
  background:
    radial-gradient(ellipse 80% 60% at 25% 35%, rgba(140, 240, 210, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 75% 65%, rgba(120, 220, 200, 0.3) 0%, transparent 50%),
    linear-gradient(150deg, #e8faf5 0%, #c0f0e4 50%, #90e0d0 100%) !important;
}

/* Peach bloom */
body[data-wallpaper="peach"] .wallpaper {
  background:
    radial-gradient(ellipse 90% 70% at 30% 80%, rgba(255, 140, 100, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 80% 25%, rgba(255, 180, 160, 0.35) 0%, transparent 50%),
    linear-gradient(160deg, #2a1820 0%, #4a2830 40%, #6a3840 100%) !important;
}
body.light[data-wallpaper="peach"] .wallpaper {
  background:
    radial-gradient(ellipse 90% 70% at 25% 75%, rgba(255, 160, 120, 0.4) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 80% 20%, rgba(255, 200, 180, 0.35) 0%, transparent 50%),
    linear-gradient(160deg, #fff0ea 0%, #ffd8cc 50%, #ffc0b0 100%) !important;
}

/* Modern slate — clean gray / blue professional */
body[data-wallpaper="slate"] .wallpaper {
  background:
    radial-gradient(ellipse 60% 40% at 70% 20%, rgba(100, 140, 180, 0.25) 0%, transparent 55%),
    linear-gradient(155deg, #1a1e28 0%, #252a38 45%, #2e3444 100%) !important;
}
body.light[data-wallpaper="slate"] .wallpaper {
  background:
    radial-gradient(ellipse 60% 40% at 70% 20%, rgba(140, 170, 200, 0.3) 0%, transparent 55%),
    linear-gradient(155deg, #f0f2f6 0%, #e0e4ec 50%, #c8d0dc 100%) !important;
}

/* ========== Recycle Bin ========== */
.recycle-icon { background: linear-gradient(135deg, #78909c, #455a64); }
.recycle-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M16 10h16l2 4h8v4H6v-4h8l2-4zm2 10h12v20H18V20z'/%3E%3C/svg%3E");
}
.recycle-app { padding: 10px; height: 100%; box-sizing: border-box; }
.recycle-empty { text-align: center; padding: 40px 12px; color: var(--text-muted); }
.recycle-empty-icon { font-size: 40px; margin-bottom: 8px; }
.recycle-toolbar { margin-bottom: 10px; }
.recycle-list { list-style: none; margin: 0; padding: 0; }
.recycle-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border, #ccc);
  border-radius: 4px;
  margin-bottom: 6px;
  background: var(--card-bg, #fff);
  font-size: 12px;
}
.recycle-list button {
  font-size: 11px;
  cursor: pointer;
  font-family: Tahoma, sans-serif;
}

/* ========== XP Dialog ========== */
.xp-dialog {
  position: fixed;
  inset: 0;
  z-index: 40000;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.xp-dialog[hidden] { display: none !important; }
.xp-dialog-box {
  width: min(360px, 92vw);
  background: #ece9d8;
  border: 2px solid #0054e3;
  box-shadow: 4px 4px 16px rgba(0,0,0,0.4);
  font-family: Tahoma, sans-serif;
}
.xp-dialog-title {
  background: linear-gradient(to right, #0a246a, #a6caf0);
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 6px;
}
.xp-dialog-body { padding: 16px 14px; font-size: 12px; color: #111; line-height: 1.4; }
.xp-dialog-actions { padding: 0 14px 12px; text-align: right; }
.xp-dialog-actions button {
  min-width: 72px;
  padding: 4px 12px;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  cursor: pointer;
}

/* ========== Screensaver ========== */
.xp-screensaver {
  position: fixed;
  inset: 0;
  z-index: 35000;
  background: #000;
  color: #3cf;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: Tahoma, sans-serif;
}
.xp-screensaver[hidden] { display: none !important; }
.ss-logo {
  font-size: 28px;
  font-weight: bold;
  animation: ssFloat 6s ease-in-out infinite alternate;
  text-shadow: 0 0 12px #0ff;
}
.ss-hint { margin-top: 16px; font-size: 12px; color: #666; }
@keyframes ssFloat {
  from { transform: translate(-40px, -20px); }
  to { transform: translate(40px, 30px); }
}

/* ========== Contact form ========== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-width: 400px;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}
.contact-form input,
.contact-form textarea {
  font-family: Tahoma, "Segoe UI", sans-serif;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--border, #7f9db9);
  border-radius: 3px;
  background: #fff;
  color: #111;
}
body:not(.light) .contact-form input,
body:not(.light) .contact-form textarea {
  background: #1e1e24;
  color: #e2e8f0;
  border-color: #475569;
}
.contact-form-note {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: normal;
  margin: 0;
}


/* ========== Professional Resume ========== */
.resume-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, #ccc);
}
.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: Tahoma, "Segoe UI", sans-serif;
  border-radius: 4px;
  border: 1px solid #7f9db9;
  background: linear-gradient(to bottom, #fff, #e8e8e8);
  color: #111;
  text-decoration: none;
  cursor: pointer;
}
.resume-btn:hover { border-color: #316ac5; background: #e8f0ff; }
.resume-btn.primary {
  background: linear-gradient(to bottom, #5a9aef, #245edb);
  border-color: #1941a5;
  color: #fff;
  font-weight: 600;
}
.resume-btn.primary:hover { filter: brightness(1.08); }
body:not(.light) .resume-btn {
  background: #334155;
  border-color: #475569;
  color: #e2e8f0;
}
body:not(.light) .resume-btn.primary {
  background: linear-gradient(to bottom, #3b82f6, #1d4ed8);
  border-color: #1e40af;
  color: #fff;
}

.resume-doc {
  font-family: "DejaVu Sans Mono", "JetBrains Mono", "Roboto Mono", "Cascadia Mono", "Consolas", "Courier New", monospace;
  color: #1a202c;
  line-height: 1.45;
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  padding: 18px 20px 24px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
body:not(.light) .resume-doc {
  background: #f8fafc;
  color: #1a202c;
  border-color: #334155;
}

.resume-header {
  text-align: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #1a365d;
}
.resume-name {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: #1a365d;
  letter-spacing: 0.3px;
  border: none;
  padding: 0;
}
.resume-tagline {
  margin: 0 0 6px;
  font-size: 12px;
  color: #4a5568;
}
.resume-contact {
  margin: 0;
  font-size: 11px;
  color: #4a5568;
  line-height: 1.5;
}
.resume-contact a {
  color: #1a365d;
  text-decoration: none;
}
.resume-contact a:hover { text-decoration: underline; }
.resume-contact .sep { margin: 0 4px; opacity: 0.6; }

.resume-section {
  margin-bottom: 12px;
}
.resume-section h2 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #1a365d;
  border-bottom: 1px solid #cbd5e0;
  padding-bottom: 3px;
}
.resume-section > p {
  margin: 0 0 4px;
  font-size: 12.5px;
  color: #2d3748;
}

.resume-item { margin-bottom: 8px; }
.resume-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.resume-item h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1a202c;
}
.resume-dates {
  font-size: 11px;
  color: #4a5568;
  font-style: italic;
  white-space: nowrap;
}
.resume-meta {
  margin: 1px 0 4px;
  font-size: 11.5px;
  color: #4a5568;
  font-style: italic;
}
.resume-item p {
  margin: 0 0 3px;
  font-size: 12.5px;
  color: #2d3748;
}
.resume-item ul,
.resume-plain {
  margin: 2px 0 0 16px;
  padding: 0;
  font-size: 12.5px;
  color: #2d3748;
}
.resume-item li,
.resume-plain li {
  margin-bottom: 2px;
}
.resume-link {
  font-size: 11px;
  font-weight: 600;
  color: #245edb;
  text-decoration: none;
}
.resume-link:hover { text-decoration: underline; }

.resume-skills {
  margin: 0;
  display: grid;
  gap: 4px;
  font-size: 12.5px;
}
.resume-skills > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 6px;
}
.resume-skills dt {
  margin: 0;
  font-weight: 700;
  color: #1a365d;
}
.resume-skills dd {
  margin: 0;
  color: #2d3748;
}

/* Larger default Resume window */
.window[data-id="resume"] {
  width: 560px !important;
  height: 480px !important;
  max-width: min(92vw, 640px);
  max-height: min(calc(100vh - 60px), 620px);
}

/* Print / Save as PDF — clean single-page style */
@media print {
  body * { visibility: hidden !important; }
  .resume-doc,
  .resume-doc * { visibility: visible !important; }
  .resume-doc {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0.4in 0.55in;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }
  .no-print,
  .resume-toolbar { display: none !important; }
  .desktop, .mobile, .taskbar, .start-menu, .boot-screen,
  .window:not([data-id="resume"]),
  .title-bar { display: none !important; }
}


/* ========== Project code snippets ========== */
.proj-snippet {
  margin: 10px 0 8px;
  border: 1px solid var(--border, #b0b0b0);
  border-radius: 6px;
  background: var(--card-bg, #fff);
  overflow: hidden;
}
.proj-snippet > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: Tahoma, "Segoe UI", sans-serif;
  color: #0a246a;
  background: linear-gradient(to bottom, #f8fafc, #e8eef5);
  border-bottom: 1px solid transparent;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.proj-snippet > summary::-webkit-details-marker { display: none; }
.proj-snippet > summary::before {
  content: "▸";
  display: inline-block;
  font-size: 11px;
  transition: transform 0.15s ease;
  color: #316ac5;
}
.proj-snippet[open] > summary::before { transform: rotate(90deg); }
.proj-snippet[open] > summary {
  border-bottom-color: var(--border, #b0b0b0);
}
.proj-snippet > summary:hover {
  background: linear-gradient(to bottom, #eef4ff, #dce8f8);
}

.proj-code-wrap {
  position: relative;
  background: #1e1e2e;
  max-height: 220px;
  overflow: auto;
}
.proj-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 3px 10px;
  font-size: 11px;
  font-family: Tahoma, "Segoe UI", sans-serif;
  border-radius: 4px;
  border: 1px solid #475569;
  background: #334155;
  color: #e2e8f0;
  cursor: pointer;
  opacity: 0.85;
}
.proj-copy:hover { opacity: 1; background: #475569; }
.proj-copy.copied {
  background: #166534;
  border-color: #22c55e;
  color: #fff;
}

.proj-code {
  margin: 0;
  padding: 12px 14px 14px;
  padding-right: 72px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11.5px;
  line-height: 1.5;
  color: #cdd6f4;
  white-space: pre;
  overflow-x: auto;
  tab-size: 2;
}
.proj-code code { font-family: inherit; color: inherit; }

/* Syntax tokens */
.c-kw { color: #cba6f7; font-weight: 600; }   /* keywords */
.c-fn { color: #89b4fa; }                      /* functions */
.c-str { color: #a6e3a1; }                     /* strings */
.c-num { color: #fab387; }                     /* numbers */
.c-cm { color: #6c7086; font-style: italic; }  /* comments */
.c-type { color: #94e2d5; }                    /* types */

body:not(.light) .proj-snippet {
  background: #252530;
  border-color: #444;
}
body:not(.light) .proj-snippet > summary {
  color: #7eb8ff;
  background: linear-gradient(to bottom, #2a2a32, #1e1e24);
}
body:not(.light) .proj-snippet > summary:hover {
  background: linear-gradient(to bottom, #333340, #252530);
}
body:not(.light) .proj-snippet[open] > summary {
  border-bottom-color: #444;
}

/* Mobile */
.mobile-card .proj-snippet { margin-top: 8px; }
.mobile-card .proj-code { font-size: 11px; padding-right: 64px; }


/* Triple / quarter snap states */
.window.snap-third-left,
.window.snap-third-center,
.window.snap-third-right,
.window.snap-top-left,
.window.snap-top-right,
.window.snap-bottom-left,
.window.snap-bottom-right {
  border-radius: 0;
  transition: none;
}
.window.snap-third-left .resize-e,
.window.snap-third-center .resize-e,
.window.snap-third-center .resize-w,
.window.snap-third-right .resize-w {
  width: 10px;
}
.window.snap-third-left .resize-e,
.window.snap-third-center .resize-e {
  right: -4px;
  background: linear-gradient(to right, transparent, rgba(36, 94, 219, 0.18));
}
.window.snap-third-center .resize-w,
.window.snap-third-right .resize-w {
  left: -4px;
  background: linear-gradient(to left, transparent, rgba(36, 94, 219, 0.18));
}
.snap-preview[data-zone^="third"] {
  border-radius: 4px;
  background: rgba(36, 94, 219, 0.28);
}
.snap-preview[data-zone="top-left"],
.snap-preview[data-zone="bottom-left"] {
  border-radius: 0 6px 6px 0;
}
.snap-preview[data-zone="top-right"],
.snap-preview[data-zone="bottom-right"] {
  border-radius: 6px 0 0 6px;
}


/* Start menu right-panel icons */
.start-menu-right button {
  display: flex !important;
  align-items: center;
  gap: 8px;
}
.sm-icon-right {
  width: 20px;
  height: 20px;
  border-radius: 3px;
}
.sm-icon-right::after {
  background-size: 60%;
}
.start-menu-right button:hover .sm-icon-right {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.35);
}
/* Dark theme left labels stay readable */
body:not(.light) .sm-group-label {
  color: #93c5fd;
}




/* ========== IconWidth / IconHeight / Shell Icon Size (WindowMetrics) ========== */
.desktop-icons .icon {
  width: var(--icon-cell-w, 78px);
  min-height: var(--icon-cell-h, auto);
  box-sizing: border-box;
}
.desktop-icons .icon-img {
  width: var(--icon-img-size, 48px);
  height: var(--icon-img-size, 48px);
}

/* Presets only apply when not using custom pixel metrics */
body[data-icon-desktop="small"]:not([style*="--icon-img-size"]) .desktop-icons .icon-img,
body[data-icon-desktop="small"] .desktop-icons .icon-img {
  width: var(--icon-img-size, 32px);
  height: var(--icon-img-size, 32px);
}
body[data-icon-desktop="small"] .desktop-icons .icon {
  width: var(--icon-cell-w, 64px);
  font-size: 10px;
  padding: 2px;
}
body[data-icon-desktop="medium"] .desktop-icons .icon {
  width: var(--icon-cell-w, 78px);
  font-size: 11px;
}
body[data-icon-desktop="medium"] .desktop-icons .icon-img {
  width: var(--icon-img-size, 48px);
  height: var(--icon-img-size, 48px);
}
body[data-icon-desktop="large"] .desktop-icons .icon {
  width: var(--icon-cell-w, 96px);
  font-size: 12px;
  padding: 6px;
}
body[data-icon-desktop="large"] .desktop-icons .icon-img {
  width: var(--icon-img-size, 64px);
  height: var(--icon-img-size, 64px);
  border-radius: 6px;
}
body[data-icon-desktop="xlarge"] .desktop-icons .icon {
  width: var(--icon-cell-w, 112px);
  font-size: 12px;
  padding: 8px;
}
body[data-icon-desktop="xlarge"] .desktop-icons .icon-img {
  width: var(--icon-img-size, 80px);
  height: var(--icon-img-size, 80px);
  border-radius: 8px;
}
body[data-icon-desktop="custom"] .desktop-icons .icon {
  width: var(--icon-cell-w, 78px);
  min-height: var(--icon-cell-h, auto);
  font-size: 11px;
}
body[data-icon-desktop="custom"] .desktop-icons .icon-img {
  width: var(--icon-img-size, 48px);
  height: var(--icon-img-size, 48px);
  border-radius: 4px;
}

/* Start menu icons */
body[data-icon-start="small"] .start-links .sm-icon {
  width: 18px;
  height: 18px;
}
body[data-icon-start="small"] .start-menu-right .sm-icon-right {
  width: 16px;
  height: 16px;
}
body[data-icon-start="medium"] .start-links .sm-icon {
  width: 24px;
  height: 24px;
}
body[data-icon-start="medium"] .start-menu-right .sm-icon-right {
  width: 20px;
  height: 20px;
}
body[data-icon-start="large"] .start-links .sm-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
}
body[data-icon-start="large"] .start-menu-right .sm-icon-right {
  width: 26px;
  height: 26px;
}
body[data-icon-start="large"] .start-links button {
  min-height: 36px;
  gap: 12px;
}
body[data-icon-start="xlarge"] .start-links .sm-icon {
  width: 40px;
  height: 40px;
  border-radius: 5px;
}
body[data-icon-start="xlarge"] .start-menu-right .sm-icon-right {
  width: 32px;
  height: 32px;
}
body[data-icon-start="xlarge"] .start-links button {
  min-height: 44px;
  gap: 12px;
  font-size: 13px;
}

/* Taskbar app icons scale lightly with desktop size */
body[data-icon-desktop="small"] .taskbar-app .tb-icon {
  width: 14px;
  height: 14px;
}
body[data-icon-desktop="large"] .taskbar-app .tb-icon,
body[data-icon-desktop="xlarge"] .taskbar-app .tb-icon {
  width: 18px;
  height: 18px;
}


/* ========== Desktop icon spacing ========== */
/* Presets set CSS variables (registry can override with exact px) */
body[data-icon-spacing="tight"] {
  --icon-gap-y: 0px;
  --icon-gap-x: 2px;
}
body[data-icon-spacing="tight"] .desktop-icons .icon {
  padding: 2px;
}
body[data-icon-spacing="normal"] {
  --icon-gap-y: 4px;
  --icon-gap-x: 6px;
}
body[data-icon-spacing="comfortable"] {
  --icon-gap-y: 10px;
  --icon-gap-x: 14px;
}
body[data-icon-spacing="comfortable"] .desktop-icons .icon {
  padding: 6px;
}
body[data-icon-spacing="wide"] {
  --icon-gap-y: 16px;
  --icon-gap-x: 20px;
}
body[data-icon-spacing="wide"] .desktop-icons .icon {
  padding: 8px;
}
body[data-icon-spacing="custom"] .desktop-icons .icon {
  padding: 4px;
}

/* Start menu list spacing scales slightly with icon spacing preference */
body[data-icon-spacing="tight"] .start-links button {
  padding-top: 4px;
  padding-bottom: 4px;
  min-height: 28px;
}
body[data-icon-spacing="comfortable"] .start-links button {
  padding-top: 10px;
  padding-bottom: 10px;
}
body[data-icon-spacing="wide"] .start-links button {
  padding-top: 12px;
  padding-bottom: 12px;
  min-height: 40px;
}


/* ========== Registry Editor ========== */
.registry-icon {
  background: linear-gradient(135deg, #efebe9, #6d4c41);
}
.registry-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M10 8h28v6H10V8zm0 10h12v22H10V18zm16 0h12v10H26V18zm0 14h12v8H26v-8z'/%3E%3C/svg%3E");
}
.registry-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: Tahoma, "Segoe UI", sans-serif;
  font-size: 12px;
  color: var(--text, #111);
  background: var(--card-bg, #fff);
}
.reg-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: linear-gradient(to bottom, #ece9d8, #d4d0c8);
  border-bottom: 1px solid #888;
}
.reg-title { font-weight: 700; }
.reg-status { color: #333; font-size: 11px; }
.reg-status.err { color: #b91c1c; font-weight: 600; }
.reg-body {
  flex: 1;
  display: flex;
  min-height: 0;
}
.reg-tree {
  width: 200px;
  border-right: 1px solid #b0b0b0;
  overflow: auto;
  padding: 6px 4px;
  background: #fafafa;
}
.reg-tree-root {
  font-weight: 700;
  padding: 4px 6px;
  margin-bottom: 4px;
}
.reg-tree-item { margin-left: 4px; }
.reg-twist {
  border: none;
  background: none;
  cursor: pointer;
  width: 16px;
  font-size: 10px;
  color: #333;
}
.reg-folder {
  font-weight: 600;
  color: #0a246a;
}
.reg-tree-children { margin-left: 14px; }
.reg-key {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 3px 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  border-radius: 2px;
}
.reg-key:hover { background: #e8f0ff; }
.reg-key.active {
  background: #316ac5;
  color: #fff;
}
.reg-values {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.reg-path {
  padding: 6px 10px;
  background: #f0f0f0;
  border-bottom: 1px solid #ccc;
  font-family: Consolas, monospace;
  font-size: 11px;
  word-break: break-all;
}
.reg-table {
  width: 100%;
  border-collapse: collapse;
  flex: 1;
}
.reg-table th {
  text-align: left;
  background: #ece9d8;
  border-bottom: 1px solid #999;
  padding: 4px 8px;
  font-weight: 600;
}
.reg-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #e5e5e5;
  vertical-align: middle;
}
.reg-row { cursor: pointer; }
.reg-row:hover { background: #eef4ff; }
.reg-row.active { background: #c8ddf8; }
.reg-val-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 4px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  border-radius: 2px;
  vertical-align: -1px;
}
.reg-edit {
  border-top: 1px solid #ccc;
  padding: 8px 10px 10px;
  background: #f7f7f7;
}
.reg-edit label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.reg-edit-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.reg-edit-row input {
  font-family: Consolas, monospace;
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
}
.reg-name { width: 160px; background: #eee; }
.reg-data { flex: 1; min-width: 100px; }
.reg-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: #555;
  line-height: 1.35;
}
body:not(.light) .registry-app { background: #1e1e24; color: #e2e8f0; }
body:not(.light) .reg-toolbar { background: #2a2a32; border-color: #444; }
body:not(.light) .reg-tree { background: #252530; border-color: #444; }
body:not(.light) .reg-folder { color: #7eb8ff; }
body:not(.light) .reg-path { background: #2a2a32; border-color: #444; }
body:not(.light) .reg-table th { background: #2a2a32; border-color: #444; }
body:not(.light) .reg-table td { border-color: #333; }
body:not(.light) .reg-row:hover { background: #334155; }
body:not(.light) .reg-row.active { background: #1e3a5f; }
body:not(.light) .reg-edit { background: #252530; border-color: #444; }
body:not(.light) .reg-name { background: #1e1e24; color: #e2e8f0; border-color: #555; }
body:not(.light) .reg-data { background: #1e1e24; color: #e2e8f0; border-color: #555; }
body:not(.light) .reg-hint { color: #94a3b8; }
body:not(.light) .reg-status { color: #cbd5e1; }

/* gap driven by --icon-gap-y / --icon-gap-x (Control Panel + Registry) */


/* VS Code live / download controls */
.vc-live-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #ccc;
  margin-right: 6px;
  cursor: pointer;
  user-select: none;
}
.vc-live-label input { accent-color: #007acc; cursor: pointer; }
.vc-download {
  background: #3c3c3c;
  color: #ddd;
  border: 1px solid #555;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 4px;
}
.vc-download:hover { background: #505050; color: #fff; }
.vscode-preview {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}
.vc-term-err { color: #f87171; }
.vc-term-ok { color: #86efac; }


/* ========== Paint Pro toolbar ========== */
.paint-pro {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.paint-pro .paint-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 6px 8px;
}
.paint-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.paint-pro .tool-btn {
  min-width: 28px;
  height: 26px;
  padding: 0 6px;
  font-size: 12px;
  line-height: 1;
}
.paint-custom-color {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
}
.paint-color-input {
  width: 28px;
  height: 22px;
  padding: 0;
  border: 1px solid #888;
  border-radius: 3px;
  cursor: pointer;
  background: none;
}
.paint-size-label,
.paint-fill-shape {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.paint-actions {
  display: flex;
  gap: 3px;
  margin-left: auto;
}
.paint-pro .paint-canvas-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #6b6b6b;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  position: relative;
}
.paint-pro canvas,
.paint-pro canvas.paint-surface {
  background: #ffffff;
  box-shadow: none;
  cursor: crosshair;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  flex: 1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.paint-status {
  font-size: 11px;
  padding: 3px 8px;
  background: #ece9d8;
  border-top: 1px solid #aaa;
  color: #333;
  font-family: Tahoma, sans-serif;
}
body:not(.light) .paint-status {
  background: #2a2a32;
  border-color: #444;
  color: #cbd5e1;
}


/* ========== Vector Graphics app ========== */
.vector-icon {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
}
.vector-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3' d='M8 36L24 8l16 28H8z'/%3E%3Ccircle cx='24' cy='28' r='3' fill='%23fff'/%3E%3C/svg%3E");
}
.vector-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  font-family: Tahoma, "Segoe UI", sans-serif;
  font-size: 12px;
  background: var(--card-bg, #fff);
  color: var(--text, #111);
}
.vg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  background: linear-gradient(to bottom, #f0f0f0, #d8d8d8);
  border-bottom: 1px solid #999;
}
.vg-tools, .vg-actions { display: flex; flex-wrap: wrap; gap: 3px; }
.vg-actions { margin-left: auto; }
.vg-btn {
  min-width: 28px; height: 26px; padding: 0 7px;
  border: 1px solid #888; border-radius: 3px;
  background: linear-gradient(to bottom, #fff, #e8e8e8);
  cursor: pointer; font-size: 12px;
}
.vg-btn:hover { background: #e8f0ff; border-color: #316ac5; }
.vg-btn.active { background: #c8ddf8; border-color: #245edb; }
.vg-btn.primary { background: linear-gradient(to bottom, #5a9aef, #245edb); color: #fff; border-color: #1941a5; }
.vg-field { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.vg-field input[type="color"] { width: 28px; height: 22px; padding: 0; border: 1px solid #888; }
.vg-field input[type="number"] { width: 44px; }
.vg-body { flex: 1; display: flex; min-height: 0; }
.vg-canvas-wrap {
  flex: 1; overflow: auto; background: #64748b;
  display: flex; align-items: flex-start; justify-content: center; padding: 10px;
}
.vg-svg {
  background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  max-width: 100%; height: auto;
}
.vg-shape.vg-selected {
  outline: 1px dashed #245edb;
  filter: drop-shadow(0 0 1px #245edb);
}
.vg-side {
  width: 200px; border-left: 1px solid #bbb;
  background: #f7f7f7; padding: 8px; overflow: auto;
}
.vg-side-title { font-weight: 700; color: #245edb; margin: 6px 0 4px; font-size: 11px; text-transform: uppercase; }
.vg-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; max-height: 120px; overflow: auto; }
.vg-list-item {
  text-align: left; border: 1px solid transparent; background: #fff;
  padding: 3px 6px; cursor: pointer; border-radius: 2px; font-size: 11px;
}
.vg-list-item:hover { border-color: #aaa; }
.vg-list-item.active { background: #c8ddf8; border-color: #245edb; }
.vg-empty, .vg-help { color: #666; font-size: 11px; margin: 0 0 6px; line-height: 1.35; }
.vg-tips { margin: 0 0 8px; padding-left: 16px; font-size: 11px; color: #444; line-height: 1.4; }
.vg-code {
  margin: 0; padding: 6px; background: #1e1e2e; color: #cdd6f4;
  font-size: 10px; border-radius: 4px; max-height: 100px; overflow: auto;
  white-space: pre-wrap; word-break: break-all;
}
.vg-status {
  padding: 3px 8px; border-top: 1px solid #aaa; background: #ece9d8; font-size: 11px;
}
body:not(.light) .vector-app { background: #1e1e24; color: #e2e8f0; }
body:not(.light) .vg-toolbar { background: #2a2a32; border-color: #444; }
body:not(.light) .vg-btn { background: #334155; color: #e2e8f0; border-color: #555; }
body:not(.light) .vg-btn.active { background: #1e3a5f; border-color: #3b82f6; }
body:not(.light) .vg-side { background: #252530; border-color: #444; }
body:not(.light) .vg-list-item { background: #1e1e24; color: #e2e8f0; }
body:not(.light) .vg-list-item.active { background: #1e3a5f; }
body:not(.light) .vg-help, body:not(.light) .vg-tips { color: #94a3b8; }
body:not(.light) .vg-status { background: #2a2a32; border-color: #444; color: #cbd5e1; }
body:not(.light) .vg-side-title { color: #7eb8ff; }

/* ========== Feature pack: a11y skip ========== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100000;
  background: #245edb;
  color: #fff;
  padding: 8px 14px;
  font-family: Tahoma, sans-serif;
  font-size: 13px;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ========== Desktop widgets ========== */
.desktop-widgets {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}
.desktop-widgets .gadget {
  pointer-events: auto;
}
.clock-gadget {
  background: linear-gradient(160deg, rgba(15,23,42,0.75), rgba(30,58,95,0.85));
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 12px 18px;
  text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  min-width: 120px;
}
.gadget-time {
  font-size: 28px;
  font-weight: 700;
  font-family: Tahoma, "Segoe UI", sans-serif;
  letter-spacing: 1px;
}
.gadget-date {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

.gadget-ms {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  opacity: 0.9;
  margin-top: 1px;
}
.gadget-eth {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.clock-gadget {
  min-width: 140px;
}

.gadget-lang,
.gadget-hc {
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(36,94,219,0.7);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  cursor: pointer;
  margin-top: 6px;
  display: block;
  width: 100%;
}
.gadget-lang:hover,
.gadget-hc:hover { filter: brightness(1.1); }
.gadget-hc { background: rgba(15,23,42,0.75); }

/* High contrast accessibility mode */
body.high-contrast {
  --text: #fff !important;
  --text-muted: #eee !important;
  --xp-window-bg: #000 !important;
  --card-bg: #000 !important;
  --border: #fff !important;
}
body.high-contrast .window,
body.high-contrast .window-body {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}
body.high-contrast .title-bar {
  background: #000 !important;
  color: #fff !important;
  border-bottom: 2px solid #fff !important;
}
body.high-contrast a { color: #ffff00 !important; text-decoration: underline !important; }
body.high-contrast .taskbar {
  background: #000 !important;
  border-top: 2px solid #fff !important;
}
body.high-contrast .desktop-icons .icon span {
  color: #fff !important;
  text-shadow: 0 0 2px #000, 1px 1px 0 #000 !important;
}
body.high-contrast .project-card,
body.high-contrast .cert-tile,
body.high-contrast .testimonial-card {
  background: #000 !important;
  border: 2px solid #fff !important;
  color: #fff !important;
}
@media (prefers-reduced-motion: reduce) {
  body.high-contrast * {
    animation: none !important;
    transition: none !important;
  }
}

/* ========== New app icons ========== */
.edge-icon, .ie-icon { background: linear-gradient(135deg, #0ea5e9, #2563eb 45%, #1d4ed8); }
.edge-icon::after, .ie-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='14' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cpath stroke='%23fff' stroke-width='2' d='M10 24h28M24 10c-6 6-6 22 0 28M24 10c6 6 6 22 0 28' fill='none'/%3E%3C/svg%3E");
}
.wmp-icon { background: linear-gradient(135deg, #fbbf24, #b45309); }
.wmp-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M16 12v24l20-12-20-12z'/%3E%3C/svg%3E");
}
.solitaire-icon { background: linear-gradient(135deg, #22c55e, #166534); }
.solitaire-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ctext x='10' y='32' font-size='22'%3E♠%3C/text%3E%3C/svg%3E");
}
.blog-icon { background: linear-gradient(135deg, #94a3b8, #334155); }
.blog-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M8 12h32v24H8V12zm4 4v4h24v-4H12zm0 8v12h10V24H12zm14 0v12h10V24H26z'/%3E%3C/svg%3E");
}
.help-icon { background: linear-gradient(135deg, #38bdf8, #0369a1); }
.help-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='16' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Ctext x='24' y='30' text-anchor='middle' fill='%23fff' font-size='20' font-weight='700'%3E?%3C/text%3E%3C/svg%3E");
}
.testimonial-icon { background: linear-gradient(135deg, #e879f9, #a21caf); }
.testimonial-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M14 18h8v8c0 6-4 10-8 12v-4c2-1 4-3 4-6h-4V18zm16 0h8v8c0 6-4 10-8 12v-4c2-1 4-3 4-6h-4V18z'/%3E%3C/svg%3E");
}
.github-icon { background: linear-gradient(135deg, #1f2937, #111); }
.github-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M24 8c-8.8 0-16 7.2-16 16 0 7.1 4.6 13.1 11 15.2.8.1 1.1-.3 1.1-.7v-2.6c-4.5 1-5.4-1.9-5.4-1.9-.7-1.8-1.8-2.3-1.8-2.3-1.5-1 .1-1 .1-1 1.6.1 2.5 1.7 2.5 1.7 1.5 2.5 3.8 1.8 4.7 1.4.1-1.1.6-1.8 1-2.2-3.6-.4-7.3-1.8-7.3-8 0-1.8.6-3.2 1.7-4.3-.2-.4-.7-2.1.1-4.3 0 0 1.4-.4 4.5 1.6 1.3-.4 2.7-.5 4.1-.5s2.8.2 4.1.5c3.1-2 4.5-1.6 4.5-1.6.9 2.2.3 3.9.1 4.3 1.1 1.1 1.7 2.6 1.7 4.3 0 6.2-3.8 7.6-7.4 8 .6.5 1.1 1.5 1.1 3v4.5c0 .4.3.9 1.1.7C35.4 37.1 40 31.1 40 24c0-8.8-7.2-16-16-16z'/%3E%3C/svg%3E");
}
.pack-icon { background: linear-gradient(135deg, #a78bfa, #5b21b6); }
.pack-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23fff' d='M10 12h28v6H10v-6zm2 10h24v18H12V22zm8 4v8h4v-8h4l-6-6-6 6h4z'/%3E%3C/svg%3E");
}

/* ========== Microsoft Edge ========== */
.edge-app { display:flex; flex-direction:column; height:100%; min-height:0; flex:1; background:#fff; color:#111; font-family:Tahoma,sans-serif; font-size:12px; box-sizing:border-box; }
.edge-toolbar { display:flex; gap:4px; padding:6px; background:#ece9d8; border-bottom:1px solid #888; align-items:center; }
.edge-nav { padding:3px 8px; font-size:12px; cursor:pointer; border:1px solid #888; background:linear-gradient(to bottom,#fff,#e0e0e0); border-radius:3px; }
.edge-address { flex:1; padding:4px 8px; border:1px solid #7f9db9; font-family:Consolas,monospace; font-size:12px; }
.edge-body { flex:1; overflow:auto; padding:12px 14px; }
.edge-status { padding:3px 8px; background:#ece9d8; border-top:1px solid #aaa; font-size:11px; }
.edge-links { margin:8px 0 0 18px; line-height:1.8; }
.edge-page img { max-width:100%; }

/* ========== Media Player ========== */
.wmp-app { display:flex; flex-direction:column; height:100%; min-height:0; flex:1; background:#1a1a1a; color:#eee; font-family:Tahoma,sans-serif; font-size:12px; box-sizing:border-box; }
.wmp-display { padding:16px; text-align:center; background:linear-gradient(160deg,#0f172a,#1e3a5f); }
.wmp-viz { height:48px; margin:0 auto 10px; width:80%; border-radius:6px; background:repeating-linear-gradient(90deg,#22c55e 0 4px,transparent 4px 10px); opacity:0.35; }
.wmp-viz.playing { opacity:1; animation:wmpPulse 0.4s ease infinite alternate; }
@keyframes wmpPulse { from { transform:scaleY(0.7); } to { transform:scaleY(1.1); } }
.wmp-controls { display:flex; gap:8px; padding:8px; align-items:center; background:#111; }
.wmp-controls button { padding:4px 12px; cursor:pointer; }
.wmp-playlist { list-style:none; margin:0; padding:0; overflow:auto; flex:1; }
.wmp-playlist li { padding:8px 12px; cursor:pointer; border-bottom:1px solid #333; }
.wmp-playlist li:hover, .wmp-playlist li.active { background:#245edb; }

/* ========== Solitaire ========== */
.sol-app { height:100%; background:#0d5c2e; padding:8px; box-sizing:border-box; color:#fff; font-family:Tahoma,sans-serif; font-size:12px; overflow:auto; }
.sol-toolbar { display:flex; gap:10px; align-items:center; margin-bottom:8px; }
.sol-new { cursor:pointer; padding:4px 10px; }
.sol-top { display:flex; gap:10px; margin-bottom:12px; align-items:flex-start; }
.sol-foundations { display:flex; gap:8px; margin-left:auto; }
.sol-tableau { display:flex; gap:8px; }
.sol-col { min-width:64px; min-height:90px; position:relative; }
.sol-card { width:60px; height:84px; background:#fff; color:#111; border-radius:4px; border:1px solid #333; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; cursor:pointer; box-shadow:1px 1px 3px rgba(0,0,0,0.3); margin-bottom:-60px; position:relative; }
.sol-col .sol-card:last-child { margin-bottom:0; }
.sol-card.back { background:linear-gradient(135deg,#1d4ed8,#1e3a8a); color:transparent; }
.sol-card.red { color:#c00; }
.sol-slot { width:60px; height:84px; border:2px dashed rgba(255,255,255,0.35); border-radius:4px; display:flex; align-items:center; justify-content:center; opacity:0.7; }
.sol-found .sol-card { margin:0; }
.sol-stock, .sol-waste { min-width:64px; }
.sol-count { font-size:10px; display:block; text-align:center; margin-top:4px; }

/* ========== Blog / My Computer ========== */
.blog-app, .mc-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  font-family: Tahoma, "Segoe UI", sans-serif;
  font-size: 12px;
  color: var(--text, #111);
  background: var(--card-bg, #fff);
  box-sizing: border-box;
}
.mc-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: linear-gradient(to bottom, #ece9d8, #d4d0c8);
  border-bottom: 1px solid #888;
  flex-shrink: 0;
}
.mc-tb {
  min-width: 28px;
  height: 24px;
  border: 1px solid #888;
  border-radius: 3px;
  background: linear-gradient(to bottom, #fff, #e8e8e8);
  cursor: pointer;
  font-size: 12px;
}
.mc-tb:hover { border-color: #316ac5; background: #e8f0ff; }
.mc-tb-sep { width: 1px; height: 18px; background: #aaa; margin: 0 4px; }
.mc-path {
  flex: 1;
  min-width: 0;
  padding: 3px 8px;
  background: #fff;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  font-family: Consolas, monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-search {
  width: 140px;
  max-width: 32%;
  padding: 3px 8px;
  border: 1px solid #7f9db9;
  border-radius: 3px;
  font-family: inherit;
  font-size: 11px;
}
.mc-body { display: flex; flex: 1; min-height: 0; }
.blog-sidebar, .mc-sidebar {
  width: 158px;
  background: #ece9d8;
  border-right: 1px solid #888;
  padding: 8px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: auto;
}
.blog-side-title { font-weight: 700; margin-bottom: 8px; color: #0a246a; }
.blog-nav {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 7px 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  border-radius: 4px;
  color: inherit;
}
.blog-nav:hover, .blog-nav.active { background: #316ac5; color: #fff; }
.mc-side-foot { margin-top: auto; padding-top: 12px; }
.mc-disk-meter {
  height: 8px;
  background: #c0c0c0;
  border: 1px solid #888;
  border-radius: 2px;
  overflow: hidden;
}
.mc-disk-fill {
  height: 100%;
  background: linear-gradient(90deg, #3c8a2e, #5bb450);
}
.mc-disk-label { font-size: 10px; color: #555; display: block; margin-top: 4px; }
.blog-main, .mc-main { flex: 1; overflow: auto; padding: 12px 14px; min-width: 0; }
.mc-statusbar {
  display: flex;
  justify-content: space-between;
  padding: 3px 10px;
  background: #ece9d8;
  border-top: 1px solid #888;
  font-size: 11px;
  color: #333;
  flex-shrink: 0;
}
.mc-lead { margin: 0 0 12px; color: var(--text-muted, #555); line-height: 1.4; }
.mc-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.mc-section-head h3 { margin: 0; font-size: 14px; }
.mc-badge {
  background: #316ac5;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}
.mc-muted { font-size: 11px; color: #666; margin-left: auto; }
.mc-empty { color: #666; font-style: italic; }

.mc-drive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.mc-drive {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  padding: 12px;
  border: 1px solid #b0b0b0;
  border-radius: 8px;
  background: linear-gradient(165deg, #fff 0%, #f0f4fa 100%);
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.mc-drive:hover {
  border-color: #316ac5;
  box-shadow: 0 4px 12px rgba(49, 106, 197, 0.15);
  transform: translateY(-1px);
}
/* --- Custom My Computer drive icons --- */
.mc-drive-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  position: relative;
  isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.12),
    0 3px 8px rgba(0, 0, 0, 0.2);
  background: linear-gradient(160deg, #93c5fd 0%, #1d4ed8 100%);
}
.mc-drive-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.28) 0%, transparent 45%);
  pointer-events: none;
  z-index: 1;
}
.mc-drive-icon::after {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 2;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

/* C: Local Disk — 3.5" HDD */
.mc-icon-hdd {
  background: linear-gradient(160deg, #38bdf8 0%, #0c4a6e 100%);
}
.mc-icon-hdd::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0%25' stop-color='%23e2e8f0'/%3E%3Cstop offset='100%25' stop-color='%2394a3b8'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='8' y='18' width='48' height='30' rx='4' fill='url(%23g)' stroke='%23fff' stroke-width='1.5'/%3E%3Crect x='14' y='24' width='36' height='12' rx='2' fill='%230c4a6e' opacity='0.35'/%3E%3Ccircle cx='46' cy='42' r='3.5' fill='%230c4a6e'/%3E%3Ccircle cx='46' cy='42' r='1.5' fill='%237dd3fc'/%3E%3Crect x='14' y='40' width='18' height='4' rx='1' fill='%230c4a6e' opacity='0.45'/%3E%3Ctext x='14' y='16' font-family='Tahoma,sans-serif' font-size='11' font-weight='700' fill='%23fff'%3EC:%3C/text%3E%3C/svg%3E");
}

/* D: Programs — CD / DVD */
.mc-icon-cd {
  background: linear-gradient(160deg, #c4b5fd 0%, #5b21b6 100%);
}
.mc-icon-cd::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='34' r='18' fill='none' stroke='%23fff' stroke-width='3.5'/%3E%3Ccircle cx='32' cy='34' r='12' fill='none' stroke='%23fff' stroke-width='2' opacity='0.75'/%3E%3Ccircle cx='32' cy='34' r='4.5' fill='%23fff'/%3E%3Ccircle cx='32' cy='34' r='2' fill='%235b21b6'/%3E%3Cpath d='M32 16v4M32 48v4M14 34h4M46 34h4' stroke='%23fff' stroke-width='2' stroke-linecap='round' opacity='0.5'/%3E%3Ctext x='14' y='14' font-family='Tahoma,sans-serif' font-size='11' font-weight='700' fill='%23fff'%3ED:%3C/text%3E%3C/svg%3E");
}

/* Network Places — globe + nodes */
.mc-icon-net {
  background: linear-gradient(160deg, #34d399 0%, #065f46 100%);
}
.mc-icon-net::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='30' r='14' fill='none' stroke='%23fff' stroke-width='2.5'/%3E%3Cpath d='M18 30h28M32 16c-6 6-6 16 0 28M32 16c6 6 6 16 0 28' fill='none' stroke='%23fff' stroke-width='1.8' opacity='0.85'/%3E%3Ccircle cx='18' cy='48' r='4' fill='%23fff'/%3E%3Ccircle cx='46' cy='48' r='4' fill='%23fff'/%3E%3Ccircle cx='32' cy='12' r='3.5' fill='%23fff'/%3E%3Cpath d='M32 15v8M20 45l8-8M44 45l-8-8' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Shared Downloads — folder + arrow */
.mc-icon-share {
  background: linear-gradient(160deg, #fbbf24 0%, #92400e 100%);
}
.mc-icon-share::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%23fff' d='M12 18h16l4 4h20v26H12V18z' opacity='0.95'/%3E%3Cpath fill='%2392400e' d='M28 30v12h8V30h6L32 20 22 30h6z' opacity='0.85'/%3E%3C/svg%3E");
}

/* System — classic tower + monitor */
.mc-icon-sys {
  background: linear-gradient(160deg, #e2e8f0 0%, #1e293b 100%);
}
.mc-icon-sys::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect x='10' y='12' width='32' height='24' rx='2' fill='%23fff'/%3E%3Crect x='13' y='15' width='26' height='16' fill='%231e293b' opacity='0.4'/%3E%3Crect x='20' y='38' width='12' height='3' fill='%23fff'/%3E%3Crect x='16' y='42' width='20' height='3' rx='1' fill='%23fff'/%3E%3Crect x='46' y='16' width='10' height='28' rx='1.5' fill='%23fff'/%3E%3Ccircle cx='51' cy='22' r='1.8' fill='%231e293b'/%3E%3Crect x='48' y='28' width='6' height='2' rx='0.5' fill='%231e293b' opacity='0.5'/%3E%3Crect x='48' y='32' width='6' height='2' rx='0.5' fill='%231e293b' opacity='0.5'/%3E%3C/svg%3E");
}

.mc-drive:hover .mc-drive-icon {
  transform: scale(1.06);
  transition: transform 0.15s ease;
}
.mc-drive-icon {
  transition: transform 0.15s ease;
}

body:not(.light) .mc-drive-icon {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 6px rgba(0, 0, 0, 0.35),
    0 3px 10px rgba(0, 0, 0, 0.45);
}

.mc-drive-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mc-drive-meta strong { font-size: 12px; }
.mc-drive-meta > span { font-size: 11px; color: #555; }
.mc-drive-bar {
  display: block;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}
.mc-drive-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #245edb, #5a9aef);
  border-radius: 3px;
}
.mc-drive-bar-net i { background: linear-gradient(90deg, #059669, #34d399); }

.blog-post, .mc-doc {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fafafa;
}
.mc-doc { display: flex; gap: 10px; align-items: flex-start; }
.mc-doc-icon { font-size: 22px; line-height: 1; }
.mc-doc-body { min-width: 0; flex: 1; }
.blog-post h4, .mc-doc h4 { margin: 0 0 4px; font-size: 13px; }
.blog-post time, .mc-doc time { font-size: 11px; color: #666; }
.blog-post p, .mc-doc p { margin: 6px 0 0; line-height: 1.45; color: #333; }
.blog-links { line-height: 1.9; }
.pack-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.mc-net-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.mc-net-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px solid #c5d0e0;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(165deg, #fff, #eef4ff);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.mc-net-card:hover {
  transform: translateY(-2px);
  border-color: #316ac5;
  box-shadow: 0 6px 16px rgba(49, 106, 197, 0.14);
}
.mc-net-ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: #316ac5;
  margin-bottom: 4px;
}
.mc-tone-gh .mc-net-ico { background: #111; }
.mc-tone-site .mc-net-ico { background: #245edb; }
.mc-tone-movie .mc-net-ico { background: #b45309; }
.mc-tone-type .mc-net-ico { background: #15803d; }
.mc-tone-in .mc-net-ico { background: #0a66c2; }
.mc-tone-mail .mc-net-ico { background: #ea580c; }
.mc-net-title { font-weight: 700; font-size: 12px; }
.mc-net-sub { font-size: 11px; color: #64748b; word-break: break-all; }

.mc-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
.mc-app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  color: inherit;
}
.mc-app-tile:hover { border-color: #316ac5; background: #eef4ff; }
.mc-app-emoji { font-size: 22px; }

.mc-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.mc-pack-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px solid #c5d0e0;
  border-radius: 10px;
  background: linear-gradient(165deg, #fff, #f8fafc);
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.mc-pack-card:hover { border-color: #316ac5; box-shadow: 0 4px 12px rgba(49,106,197,0.12); }
.mc-pack-ico { font-size: 24px; }
.mc-pack-card strong { font-size: 12px; }
.mc-pack-card span:last-child { font-size: 11px; color: #666; }
.mc-hint { margin-top: 8px; font-size: 11px; }

.mc-sys-card {
  border: 1px solid #b0b0b0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  max-width: 480px;
}
.mc-sys-banner {
  padding: 14px 16px;
  background: linear-gradient(135deg, #245edb, #5a9aef);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.mc-sys-dl {
  margin: 0;
  padding: 12px 16px;
  display: grid;
  gap: 8px;
}
.mc-sys-dl > div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  font-size: 12px;
}
.mc-sys-dl dt { margin: 0; font-weight: 700; color: #0a246a; }
.mc-sys-dl dd { margin: 0; color: #333; }
.mc-sys-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 14px;
}

body:not(.light) .mc-toolbar,
body:not(.light) .mc-statusbar,
body:not(.light) .blog-sidebar,
body:not(.light) .mc-sidebar {
  background: #2a2a32;
  border-color: #444;
  color: #e2e8f0;
}
body:not(.light) .mc-path,
body:not(.light) .mc-search {
  background: #1e1e24;
  border-color: #555;
  color: #e2e8f0;
}
body:not(.light) .mc-tb {
  background: #334155;
  border-color: #555;
  color: #e2e8f0;
}
body:not(.light) .blog-side-title { color: #7eb8ff; }
body:not(.light) .mc-drive,
body:not(.light) .mc-net-card,
body:not(.light) .mc-pack-card,
body:not(.light) .mc-app-tile,
body:not(.light) .mc-sys-card,
body:not(.light) .blog-post,
body:not(.light) .mc-doc {
  background: linear-gradient(165deg, #252530, #1e1e24);
  border-color: #3f3f4a;
  color: #e2e8f0;
}
body:not(.light) .mc-drive-meta > span,
body:not(.light) .mc-net-sub,
body:not(.light) .blog-post time,
body:not(.light) .mc-doc time,
body:not(.light) .mc-lead,
body:not(.light) .mc-disk-label { color: #94a3b8; }
body:not(.light) .blog-post p,
body:not(.light) .mc-doc p,
body:not(.light) .mc-sys-dl dd { color: #cbd5e1; }
body:not(.light) .mc-sys-dl dt { color: #7eb8ff; }
body:not(.light) .mc-drive-bar { background: #334155; }

.window[data-id="blog"],
.window[data-id="downloadpack"] {
  width: 640px !important;
  height: 480px !important;
  max-width: min(94vw, 720px);
  max-height: min(calc(100vh - 60px), 560px);
}

/* ========== Help / testimonials / github ========== */
.help-app, .testimonial-app, .gh-app { padding:12px 14px; font-family:Tahoma,sans-serif; font-size:12px; color:var(--text,#111); height:100%; min-height:0; flex:1; overflow:auto; box-sizing:border-box; }
.help-app table { width:100%; border-collapse:collapse; margin:8px 0 12px; font-size:12px; }
.help-app td, .help-app th { border:1px solid var(--border,#ccc); padding:6px 8px; text-align:left; }
.help-app th { background:var(--card-bg,#f0f0f0); }
body:not(.light) .edge-body, body:not(.light) .edge-status { background:#1e1e24; color:#e2e8f0; }
body:not(.light) .edge-toolbar { background:#2a2a32; border-color:#444; color:#eee; }
body:not(.light) .edge-address { background:#1e1e24; color:#eee; border-color:#555; }
.help-table { width:100%; border-collapse:collapse; margin:8px 0 14px; }
.help-table td { padding:6px 8px; border-bottom:1px solid #ddd; vertical-align:top; }
.help-table kbd { background:#eee; border:1px solid #bbb; border-radius:3px; padding:1px 5px; font-size:11px; }
.testimonial-card { margin:0 0 12px; padding:12px 14px; background:#f8fafc; border-left:4px solid #245edb; border-radius:0 6px 6px 0; }
.testimonial-card footer { margin-top:8px; font-size:11px; color:#555; }
.gh-table { width:100%; border-collapse:collapse; font-size:11px; }
.gh-table th, .gh-table td { text-align:left; padding:6px 8px; border-bottom:1px solid #ddd; }

/* ========== Skills radar / cert gallery / timeline / case study ========== */
.skills-radar-wrap { max-width:240px; margin:0 auto 16px; }
.skills-radar { width:100%; height:auto; color:#334155; }
.cert-gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:10px; margin-bottom:14px; }
.cert-tile { display:flex; flex-direction:column; gap:6px; align-items:flex-start; text-align:left; padding:12px; border:1px solid #ccc; border-radius:8px; background:#fff; cursor:pointer; font-family:Tahoma,sans-serif; font-size:11px; }
.cert-tile:hover { border-color:#245edb; box-shadow:0 2px 8px rgba(36,94,219,0.15); }
.cert-badge { font-size:22px; }
.resume-timeline { margin-bottom:14px; padding:10px 12px; background:#f0f4fa; border-radius:6px; border:1px solid #c5d4eb; font-family:Tahoma,sans-serif; font-size:12px; }
.tl-range { width:min(280px,100%); vertical-align:middle; }
.tl-events { margin:8px 0 0; padding-left:18px; }
.tl-events li { margin-bottom:4px; transition:opacity 0.15s; }
.case-study-card { margin-top:10px; }
.case-study summary { cursor:pointer; font-weight:600; color:#245edb; }

body:not(.light) .blog-sidebar { background:#2a2a32; border-color:#444; }
body:not(.light) .blog-side-title { color:#7eb8ff; }
body:not(.light) .blog-post { background:#1e1e24; border-color:#444; }
body:not(.light) .testimonial-card { background:#1e293b; }
body:not(.light) .cert-tile { background:#1e1e24; border-color:#444; color:#e2e8f0; }
body:not(.light) .resume-timeline { background:#1e293b; border-color:#334155; color:#e2e8f0; }
body:not(.light) .help-table kbd { background:#334155; border-color:#555; color:#e2e8f0; }
body:not(.light) .edge-app { background:#1e1e24; color:#e2e8f0; }
body:not(.light) .edge-toolbar, body:not(.light) .edge-status { background:#2a2a32; border-color:#444; color:#ccc; }
body:not(.light) .edge-address { background:#111; color:#eee; border-color:#555; }


/* ========== Edge / WMP / Help — working apps polish ========== */
.edge-toolbar { display:flex; flex-wrap:wrap; gap:4px; align-items:center; padding:6px 8px; background:#ece9d8; border-bottom:1px solid #888; }
.edge-nav { padding:3px 8px; font-size:12px; cursor:pointer; font-family:Tahoma,sans-serif; border:1px solid #888; background:linear-gradient(to bottom,#fff,#e8e8e8); border-radius:3px; }
.edge-nav:hover { border-color:#316ac5; background:#e8f0ff; }
.edge-go { font-weight:700; }
.edge-address { flex:1; min-width:120px; padding:4px 8px; border:1px solid #7f9db9; font-family:Consolas,monospace; font-size:12px; }
.edge-body { flex:1; overflow:auto; padding:12px 14px; min-height:0; background:#fff; }
.edge-status { padding:3px 8px; background:#ece9d8; border-top:1px solid #aaa; font-size:11px; }
.edge-links { margin:8px 0 12px 18px; line-height:1.85; }
/* Edge iframe — full-bleed browser surface */
.edge-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  -webkit-overflow-scrolling: touch;
  overflow: auto;
}
.edge-external .proj-btn { margin-right: 6px; margin-top: 6px; }

/* Full in-app browser when opening project / external links */
.edge-body:has(.edge-browse) {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
}
.edge-browse,
.edge-external.edge-browse {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  position: relative;
  background: #ffffff;
}
.edge-ext-bar { display: none !important; }

.edge-browse .edge-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: 100%;
  margin: 0;
  border: 0;
  background: #fff;
  /* soft inset so the page surface feels embedded */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.edge-frame-note {
  display: none;
  padding: 8px 12px;
  font-size: 11px;
  line-height: 1.4;
  background: #f5f5f0;
  color: #444;
  border-top: 1px solid #ccc;
}
.edge-frame-note:not([hidden]) {
  display: block;
}
.edge-frame-note a {
  color: #1e4a8c;
}

body:not(.light) .edge-frame-note {
  background: rgba(15, 23, 42, 0.95);
  color: #94a3b8;
}
body:not(.light) .edge-browse .edge-frame {
  background: #0b0f19;
}

/* Loading pulse behind iframe while content arrives */
.edge-browse::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(49, 106, 197, 0.08), transparent 55%),
    #f3f3f3;
}
.edge-browse .edge-frame,
.edge-browse .edge-frame-note {
  position: relative;
  z-index: 1;
}

.edge-home .muted, .edge-page .muted { color:#666; font-size:12px; }
body:not(.light) .edge-toolbar, body:not(.light) .edge-status { background:#2a2a32; border-color:#444; color:#e2e8f0; }
body:not(.light) .edge-body { background:#1e1e24; color:#e2e8f0; }
body:not(.light) .edge-nav { background:#334155; border-color:#555; color:#e2e8f0; }
body:not(.light) .edge-address { background:#111; color:#eee; border-color:#555; }
body:not(.light) .edge-frame { border-color:#444; background:#111; }

.wmp-time { font-size:11px; opacity:0.85; margin-top:6px; font-variant-numeric:tabular-nums; }
.wmp-vol-label { display:inline-flex; align-items:center; gap:4px; margin-left:auto; font-size:11px; }
.wmp-foot { padding:6px 10px; font-size:11px; border-top:1px solid #333; }
.wmp-controls button { min-width:36px; padding:4px 10px; cursor:pointer; font-family:Tahoma,sans-serif; }

.help-topics { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0 12px; }
.help-topic {
  padding:6px 10px; font-size:12px; font-family:Tahoma,sans-serif; cursor:pointer;
  border:1px solid var(--border,#7f9db9); border-radius:4px;
  background:linear-gradient(to bottom,#fff,#e8e8e8); color:var(--text,#111);
}
.help-topic:hover { border-color:#316ac5; }
.help-topic.active {
  background:linear-gradient(to bottom,#5a9aef,#245edb); color:#fff; border-color:#1941a5; font-weight:600;
}
.help-panel ul { margin:0 0 12px 18px; line-height:1.55; }
.help-panel .proj-btn { margin:4px 6px 0 0; }
body:not(.light) .help-topic { background:#334155; border-color:#555; color:#e2e8f0; }
body:not(.light) .help-topic.active { background:linear-gradient(to bottom,#3b82f6,#1d4ed8); color:#fff; }


/* ========== App error panels ========== */
.app-error-panel {
  padding: 16px 18px;
  font-family: Tahoma, "Segoe UI", sans-serif;
  font-size: 12px;
  color: var(--text, #111);
  background: var(--card-bg, #fff);
  height: 100%;
  box-sizing: border-box;
  overflow: auto;
}
.app-error-panel h3 { color: #b91c1c; }
body:not(.light) .app-error-panel h3 { color: #fca5a5; }
.app-error-panel .muted { color: var(--text-muted, #666); font-size: 11px; }
.app-error-panel .proj-btn { margin-top: 8px; }


/* ========== Solitaire / Testimonials / GitHub polish ========== */
.sol-toolbar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:8px; }
.sol-new { cursor:pointer; padding:4px 12px; font-family:Tahoma,sans-serif; font-size:12px; }
.sol-moves { font-size:11px; opacity:0.9; }
.sol-msg { font-size:11px; flex:1; min-width:140px; }
.sol-card {
  width:60px; height:84px; border-radius:4px; border:1px solid #333;
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px;
  cursor:pointer; box-shadow:1px 1px 3px rgba(0,0,0,0.3); background:#fff; color:#111;
  font-family:Tahoma,sans-serif; padding:0; margin:0;
}
.sol-col .sol-card { margin-bottom:-58px; position:relative; }
.sol-col .sol-card:last-child { margin-bottom:0; }
.sol-card.back { background:linear-gradient(135deg,#1d4ed8,#1e3a8a); color:transparent; }
.sol-card.red { color:#c00; }
.sol-card.black { color:#111; }
.sol-stock-btn { cursor:pointer; }
.sol-count { display:block; text-align:center; font-size:10px; margin-top:4px; }

.testimonial-stage { margin:12px 0; min-height:100px; }
.testimonial-nav { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.t-dots { display:flex; gap:6px; flex:1; justify-content:center; }
.t-dot {
  width:10px; height:10px; border-radius:50%; border:1px solid #888; background:#ccc; padding:0; cursor:pointer;
}
.t-dot.active { background:#245edb; border-color:#1941a5; }
.testimonial-list { margin:8px 0 0 0; padding:0; list-style:none; font-size:11px; color:var(--text-muted,#666); }
.testimonial-list li { padding:4px 0; border-bottom:1px solid var(--border,#ddd); }
.testimonial-list li.active { color:var(--text,#111); font-weight:600; }
.testimonial-actions { margin:8px 0 12px; display:flex; flex-wrap:wrap; gap:6px; }

.gh-profile { display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.gh-avatar {
  width:48px; height:48px; border-radius:50%; background:#245edb; color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:700; flex-shrink:0;
}
.gh-name { font-weight:700; font-size:14px; }
.gh-stats { display:flex; flex-wrap:wrap; gap:10px; margin:0 0 10px; font-size:12px; }
.gh-stat {
  background:var(--card-bg,#f0f0f0); border:1px solid var(--border,#ccc);
  padding:4px 10px; border-radius:4px;
}
.gh-table { width:100%; border-collapse:collapse; font-size:12px; }
.gh-table th, .gh-table td { border:1px solid var(--border,#ccc); padding:6px 8px; text-align:left; vertical-align:top; }
.gh-table th { background:var(--card-bg,#f0f0f0); }
body:not(.light) .gh-table th { background:#2a2a32; }
body:not(.light) .gh-stat { background:#1e293b; }


/* ========== Liveweave playground (replaces VS Code editor UI) ========== */
.liveweave-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: Tahoma, "Segoe UI", sans-serif;
  font-size: 12px;
}
.lw-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: linear-gradient(to bottom, #2d2d2d, #252525);
  border-bottom: 1px solid #111;
  flex-shrink: 0;
}
.lw-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 6px;
}
.lw-logo {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #f97316, #ea580c);
  letter-spacing: -0.5px;
}
.lw-title {
  font-weight: 700;
  color: #f3f4f6;
  font-size: 13px;
}
.lw-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.lw-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}
.lw-check input { accent-color: #f97316; cursor: pointer; }
.lw-btn {
  border: 1px solid #444;
  background: #333;
  color: #eee;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.lw-btn:hover { background: #404040; border-color: #666; }
.lw-btn.lw-run {
  background: linear-gradient(to bottom, #f97316, #ea580c);
  border-color: #c2410c;
  color: #fff;
  font-weight: 700;
}
.lw-btn.lw-run:hover { filter: brightness(1.06); }
.lw-status {
  margin-left: auto;
  color: #94a3b8;
  font-size: 11px;
}
.lw-status.ok { color: #86efac; }
.lw-status.err { color: #fca5a5; }

.lw-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.lw-workspace.lw-layout-left {
  flex-direction: row;
}
.lw-editors {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  border-bottom: 1px solid #111;
}
.lw-layout-left .lw-editors {
  flex-direction: column;
  flex: 1.15;
  border-bottom: none;
  border-right: 1px solid #111;
  max-width: 55%;
}
.lw-layout-top .lw-editors {
  flex: 1.05;
  min-height: 42%;
}
.lw-pane {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #111;
  background: #1e1e1e;
}
.lw-pane:last-child { border-right: none; }
.lw-layout-left .lw-pane {
  border-right: none;
  border-bottom: 1px solid #111;
  min-height: 80px;
}
.lw-layout-left .lw-pane:last-child { border-bottom: none; }
.lw-pane-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #252526;
  border-bottom: 1px solid #111;
  font-weight: 700;
  font-size: 11px;
  color: #e5e7eb;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.lw-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.lw-dot.html { background: #e34c26; }
.lw-dot.css { background: #264de4; }
.lw-dot.js { background: #f7df1e; }
.lw-code {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 0;
  resize: none;
  padding: 8px 10px;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  outline: none;
  tab-size: 2;
}
.lw-code:focus {
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.35);
}
.lw-preview-wrap {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.lw-layout-left .lw-preview-wrap {
  flex: 1;
}
.lw-layout-top .lw-preview-wrap {
  min-height: 38%;
}
.lw-preview-wrap .lw-pane-head {
  background: #f3f4f6;
  color: #111;
  border-bottom: 1px solid #d1d5db;
  text-transform: none;
  letter-spacing: 0;
}
.lw-preview-hint {
  margin-left: auto;
  font-weight: 500;
  font-size: 10px;
  color: #6b7280;
  text-transform: none;
}
.lw-preview {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
  min-height: 0;
}

/* Light theme adjustments when OS is light */
body.light .liveweave-app {
  background: #f5f5f5;
  color: #111;
}
body.light .lw-toolbar {
  background: linear-gradient(to bottom, #fafafa, #e8e8e8);
  border-bottom-color: #bbb;
}
body.light .lw-title { color: #111; }
body.light .lw-btn {
  background: #fff;
  color: #111;
  border-color: #999;
}
body.light .lw-btn:hover { background: #f0f0f0; }
body.light .lw-pane,
body.light .lw-code {
  background: #fff;
  color: #111;
}
body.light .lw-pane-head {
  background: #ece9d8;
  color: #111;
  border-bottom-color: #bbb;
}
body.light .lw-editors,
body.light .lw-pane {
  border-color: #bbb;
}
body.light .lw-status { color: #555; }
body.light .lw-status.ok { color: #15803d; }
body.light .lw-status.err { color: #b91c1c; }

.window[data-id="vscode"] {
  min-width: 640px;
  min-height: 420px;
}
.window[data-id="vscode"] .window-body.no-pad,
.window[data-id="vscode"] .window-body {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}


/* Liveweave.com embed + mode switch */
.liveweave-app.lw-integrated {
  background: #121212;
}
.lw-mode-tabs {
  display: inline-flex;
  border: 1px solid #444;
  border-radius: 6px;
  overflow: hidden;
  margin-right: 4px;
}
.lw-mode-btn {
  border: 0;
  background: #2a2a2a;
  color: #cbd5e1;
  padding: 4px 12px;
  font-size: 11px;
  font-family: Tahoma, "Segoe UI", sans-serif;
  cursor: pointer;
}
.lw-mode-btn:hover { background: #333; }
.lw-mode-btn.active {
  background: linear-gradient(to bottom, #f97316, #ea580c);
  color: #fff;
  font-weight: 700;
}
.lw-online-view {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #0a0a0a;
}
.lw-site-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.lw-local-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.lw-local-view[hidden],
.lw-online-view[hidden],
.lw-online-actions[hidden],
.lw-local-actions[hidden] {
  display: none !important;
}
.lw-embed-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  background: #1e1e24;
  color: #e2e8f0;
  font-family: Tahoma, "Segoe UI", sans-serif;
}
.lw-embed-fallback h3 { margin: 0; color: #f97316; }
.lw-embed-fallback a { color: #93c5fd; }
.lw-btn.lw-open-ext {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
body.light .lw-mode-btn {
  background: #eee;
  color: #222;
}
body.light .lw-mode-btn.active {
  background: linear-gradient(to bottom, #f97316, #ea580c);
  color: #fff;
}
body.light .lw-mode-tabs { border-color: #999; }


/* ========== Soft skills presentation ========== */
.skills-lead {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text-muted, #555);
  line-height: 1.45;
}
.skills-section-title {
  margin: 16px 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--xp-blue, #245edb);
  letter-spacing: 0.02em;
}
.soft-skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.soft-skill-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 12px 11px;
  border-radius: 8px;
  border: 1px solid var(--border, #c5d0e0);
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.soft-skill-card:hover {
  border-color: var(--xp-blue, #245edb);
  box-shadow: 0 4px 12px rgba(36, 94, 219, 0.12);
  transform: translateY(-1px);
}
.soft-skill-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
  background: linear-gradient(145deg, #dbeafe, #eff6ff);
  border: 1px solid #bfdbfe;
}
.soft-skill-body h4 {
  margin: 0 0 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text, #111);
}
.soft-skill-body p {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted, #555);
}
.skills-focus-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.skills-focus-tags .tag {
  background: #eef4ff;
  border: 1px solid #c5d4eb;
  color: #1e3a8a;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
}

body:not(.light) .soft-skill-card {
  background: linear-gradient(180deg, #252530 0%, #1e1e24 100%);
  border-color: #3f3f4a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
body:not(.light) .soft-skill-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.15);
}
body:not(.light) .soft-skill-icon {
  background: linear-gradient(145deg, #1e3a5f, #0f172a);
  border-color: #334155;
}
body:not(.light) .soft-skill-body h4 { color: #e2e8f0; }
body:not(.light) .soft-skill-body p { color: #94a3b8; }
body:not(.light) .skills-section-title { color: #7eb8ff; }
body:not(.light) .skills-focus-tags .tag {
  background: #1e293b;
  border-color: #334155;
  color: #bfdbfe;
}


/* ========== Contact list — attractive tiles ========== */
.contact-lead {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted, #555);
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
a.contact-tile {
  text-decoration: none;
  color: inherit;
}
.contact-tile {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 11px;
  border-radius: 10px;
  border: 1px solid var(--border, #c5d0e0);
  background: linear-gradient(165deg, #ffffff 0%, #eef4ff 55%, #e8f0fe 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-height: 64px;
}
a.contact-tile:hover {
  transform: translateY(-2px);
  border-color: var(--xp-blue, #245edb);
  box-shadow: 0 6px 16px rgba(36, 94, 219, 0.15);
}
a.contact-tile:active {
  transform: translateY(0);
}
.contact-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.35);
  font-family: Tahoma, "Segoe UI", sans-serif;
}
.contact-tile:nth-child(1) .contact-tile-icon { background: linear-gradient(145deg, #f97316, #ea580c); }
.contact-tile:nth-child(2) .contact-tile-icon { background: linear-gradient(145deg, #22c55e, #15803d); }
.contact-tile:nth-child(3) .contact-tile-icon { background: linear-gradient(145deg, #334155, #0f172a); }
.contact-tile:nth-child(4) .contact-tile-icon { background: linear-gradient(145deg, #0a66c2, #004182); }
.contact-tile:nth-child(5) .contact-tile-icon { background: linear-gradient(145deg, #a855f7, #7e22ce); }
.contact-tile-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.contact-tile-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #64748b);
}
.contact-tile-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #0f172a);
  word-break: break-word;
  line-height: 1.3;
}
.contact-tile-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, #64748b);
  margin-top: 2px;
}
.contact-form-heading {
  margin: 4px 0 10px;
  font-size: 13px;
  color: var(--xp-blue, #245edb);
}

body:not(.light) .contact-tile {
  background: linear-gradient(165deg, #252530 0%, #1e1e24 100%);
  border-color: #3f3f4a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
body:not(.light) a.contact-tile:hover {
  border-color: #3b82f6;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.18);
}
body:not(.light) .contact-tile-value { color: #e2e8f0; }
body:not(.light) .contact-tile-label,
body:not(.light) .contact-tile-sub { color: #94a3b8; }
body:not(.light) .contact-lead { color: #94a3b8; }
body:not(.light) .contact-form-heading { color: #7eb8ff; }

/* Resume contact list — match PDF labeled icon rows */
.resume-contact-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
}
.resume-contact-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.resume-contact-list .rci {
  color: #1e40af;
  font-size: 14px;
  width: 1.15em;
  text-align: center;
  flex-shrink: 0;
}
.resume-contact-list .rcl {
  font-weight: 700;
  color: #0f172a;
  min-width: 4.6em;
}
.resume-contact-list a {
  color: #1e40af;
  text-decoration: none;
}
.resume-contact-list a:hover {
  text-decoration: underline;
}
@media print {
  .resume-contact-list a {
    color: #0f172a;
    text-decoration: none;
  }
}

/* Mobile home header — clearer text hierarchy */
.mobile-header .subtitle {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin: 4px 0 2px;
  color: #1e293b;
}
.mobile-header .years {
  font-size: 12.5px;
  line-height: 1.4;
  color: #64748b;
  max-width: 16rem;
  margin-left: auto;
  margin-right: auto;
}

/* ========== Device Inspector — card UI (screenshot match) ========== */
.app-img.device {
  background-color: #5b5fc7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17 1H7c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 18H7V5h10v14z'/%3E%3C/svg%3E");
}

.device-inspector.di-card-ui {
  height: 100%;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #eef2ff;
  background: linear-gradient(180deg, #eef2ff 0%, #f4f6fb 45%, #eef1f8 100%);
  padding: 16px 14px 28px;
  box-sizing: border-box;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
}

.device-inspector.di-card-ui .di-wrap {
  max-width: 420px;
  margin: 0 auto;
}

.device-inspector.di-card-ui .di-kicker {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0 2px;
}

.device-inspector.di-card-ui .di-kicker-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(145deg, #7c6cff, #5b5fc7);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(91, 95, 199, 0.35);
}

.device-inspector.di-card-ui .di-kicker-text {
  font-size: 14px;
  line-height: 1.35;
  color: #64748b;
  font-weight: 500;
  padding-top: 4px;
}

.device-inspector.di-card-ui .di-main-card {
  background: #fff;
  border-radius: 20px;
  padding: 18px 16px 8px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.9);
  margin-bottom: 12px;
}

.device-inspector.di-card-ui .di-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.device-inspector.di-card-ui .di-device-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #6d63f2, #5b5fc7);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 0 6px 16px rgba(91, 95, 199, 0.35);
}

.device-inspector.di-card-ui .di-device-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.device-inspector.di-card-ui .di-title-block {
  flex: 1;
  min-width: 0;
}

.device-inspector.di-card-ui .di-name {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #0f172a;
}

.device-inspector.di-card-ui .di-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.35;
}

.device-inspector.di-card-ui .di-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #10b981;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid #a7f3d0;
}

.device-inspector.di-card-ui .di-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.device-inspector.di-card-ui .di-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.device-inspector.di-card-ui .di-pill.online {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.device-inspector.di-card-ui .di-pill.offline {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.device-inspector.di-card-ui .di-pill.battery {
  background: #fffbeb;
  color: #d97706;
  border-color: #fde68a;
}

.device-inspector.di-card-ui .di-pill.arch,
.device-inspector.di-card-ui .di-pill-net {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}

.device-inspector.di-card-ui .di-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  margin: 0 -4px 14px;
  padding: 14px 0;
}

.device-inspector.di-card-ui .di-stat {
  text-align: center;
  padding: 4px 6px;
}

.device-inspector.di-card-ui .di-stat + .di-stat {
  border-left: 1px solid #f1f5f9;
}

.device-inspector.di-card-ui .di-stat-icon {
  width: 22px;
  height: 22px;
  margin: 0 auto 6px;
  color: #6366f1;
}

.device-inspector.di-card-ui .di-stat-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.device-inspector.di-card-ui .di-stat-icon.di-stat-ram {
  color: #f59e0b;
}

.device-inspector.di-card-ui .di-stat-icon.di-stat-disk {
  color: #10b981;
}

.device-inspector.di-card-ui .di-stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 4px;
}

.device-inspector.di-card-ui .di-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.device-inspector.di-card-ui .di-storage {
  margin: 0 2px 12px;
}

.device-inspector.di-card-ui .di-storage-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.device-inspector.di-card-ui .di-storage-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.device-inspector.di-card-ui .di-storage-meta {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.device-inspector.di-card-ui .di-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.device-inspector.di-card-ui .di-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #10b981);
  transition: width 0.55s ease;
}

.device-inspector.di-card-ui .di-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.device-inspector.di-card-ui .di-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 2px;
  border-top: 1px solid #f1f5f9;
}

.device-inspector.di-card-ui .di-row-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eef2ff;
  color: #5b5fc7;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.device-inspector.di-card-ui .di-row-icon svg {
  width: 16px;
  height: 16px;
}

.device-inspector.di-card-ui .di-row-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #94a3b8;
  min-width: 96px;
  flex-shrink: 0;
}

.device-inspector.di-card-ui .di-row-value {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  text-align: right;
  flex: 1;
  min-width: 0;
  word-break: break-word;
  line-height: 1.35;
}

.device-inspector.di-card-ui .di-tools-card {
  padding-bottom: 14px;
}

.device-inspector.di-card-ui .di-tools-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 12px;
}

.device-inspector.di-card-ui .di-speed-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.device-inspector.di-card-ui .di-speed-metric {
  text-align: center;
  padding: 10px 6px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.device-inspector.di-card-ui .di-speed-metric-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 4px;
}

.device-inspector.di-card-ui .di-speed-metric-value {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.device-inspector.di-card-ui .di-speed-progress {
  margin-bottom: 10px;
}

.device-inspector.di-card-ui .di-speed-status {
  margin-top: 6px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
}

.device-inspector.di-card-ui .di-speed-run,
.device-inspector.di-card-ui .di-persist-btn,
.device-inspector.di-card-ui .di-refresh {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.device-inspector.di-card-ui .di-speed-run {
  background: linear-gradient(135deg, #38bdf8, #5b5fc7);
  color: #fff;
  margin-bottom: 14px;
}

.device-inspector.di-card-ui .di-persist {
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.device-inspector.di-card-ui .di-persist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.device-inspector.di-card-ui .di-persist-title {
  font-size: 13px;
  font-weight: 700;
}

.device-inspector.di-card-ui .di-persist-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}

.device-inspector.di-card-ui .di-persist-badge.di-persist-yes {
  background: #ecfdf5;
  color: #059669;
}

.device-inspector.di-card-ui .di-persist-badge.di-persist-no {
  background: #fff7ed;
  color: #c2410c;
}

.device-inspector.di-card-ui .di-persist-desc {
  margin: 0 0 10px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.device-inspector.di-card-ui .di-persist-btn {
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff;
}

.device-inspector.di-card-ui .di-persist-result {
  margin: 8px 0 0;
  font-size: 12px;
  text-align: center;
  color: #64748b;
}

.device-inspector.di-card-ui .di-persist-result-ok {
  color: #059669;
  font-weight: 600;
}

.device-inspector.di-card-ui .di-persist-result-err {
  color: #c2410c;
}

.device-inspector.di-card-ui .di-speed-run:disabled,
.device-inspector.di-card-ui .di-persist-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.device-inspector.di-card-ui .di-net-unsupported {
  margin: 0 0 10px;
  padding: 10px;
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  border-radius: 10px;
  text-align: center;
}

.device-inspector.di-card-ui .di-note {
  margin: 8px 4px 12px;
  font-size: 11px;
  line-height: 1.45;
  color: #94a3b8;
  text-align: center;
}

.device-inspector.di-card-ui .di-refresh {
  background: #fff;
  color: #5b5fc7;
  border: 1px solid #c7d2fe;
}

.device-inspector.di-card-ui .di-empty-hint {
  display: none;
}

body.light .device-inspector.di-card-ui {
  background: linear-gradient(180deg, #eef2ff 0%, #f4f6fb 45%, #eef1f8 100%);
}


/* ========== Voice Room (shareable multi-party call) ========== */
.icon-img.voice-icon {
  background-color: #0284c7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 14a3 3 0 003-3V5a3 3 0 10-6 0v6a3 3 0 003 3zm5-3a5 5 0 01-10 0H5a7 7 0 0014 0h-2zm-5 7a1 1 0 01-1-1v-1h2v1a1 1 0 01-1 1z'/%3E%3C/svg%3E");
}
.app-img.voice {
  background-color: #0ea5e9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 14a3 3 0 003-3V5a3 3 0 10-6 0v6a3 3 0 003 3zm5-3a5 5 0 01-10 0H5a7 7 0 0014 0h-2zm-5 7a1 1 0 01-1-1v-1h2v1a1 1 0 01-1 1z'/%3E%3C/svg%3E");
}

.voice-call {
  height: 100%;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #ecfeff 0%, #f0f9ff 40%, #f8fafc 100%);
  padding: 14px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #0f172a;
}

.voice-call .vc-shell {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}

.voice-call .vc-hero {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.voice-call .vc-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #38bdf8, #0284c7);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.35);
}

.voice-call .vc-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.voice-call .vc-sub {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: #64748b;
}

.voice-call .vc-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  border: 1px solid #e2e8f0;
}

.voice-call .vc-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.voice-call .vc-row {
  display: flex;
  gap: 8px;
}

.voice-call .vc-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font-size: 15px;
  font-family: inherit;
  background: #f8fafc;
}

.voice-call .vc-input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.voice-call .vc-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

.voice-call .vc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.voice-call .vc-btn {
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.voice-call .vc-btn-primary {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #fff;
}

.voice-call .vc-btn-secondary {
  background: #e0f2fe;
  color: #0369a1;
}

.voice-call .vc-btn-ghost {
  background: #f1f5f9;
  color: #475569;
}

.voice-call .vc-btn-sm {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.voice-call .vc-status {
  margin: 10px 0 0;
  font-size: 13px;
  text-align: center;
}

.voice-call .vc-status-ok { color: #059669; }
.voice-call .vc-status-err { color: #dc2626; }

.voice-call .vc-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  background: #0f172a;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #1e293b;
}

.voice-call .vc-stage-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #1e293b;
}

.voice-call .vc-room-pill {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-call .vc-frame-wrap {
  flex: 1;
  min-height: 320px;
  position: relative;
}

.voice-call .vc-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.voice-call .vc-note {
  margin: 0;
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  line-height: 1.4;
}

/* Desktop window body */
.window-body .voice-call {
  height: 100%;
}

.voice-call .vc-advanced {
  margin-top: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 12px 12px;
}
.voice-call .vc-advanced > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  padding: 4px 0;
}
.voice-call .vc-advanced .vc-label { margin-top: 8px; }

.voice-call .vc-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: #475569;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.voice-call .vc-check input {
  width: 16px;
  height: 16px;
  accent-color: #0284c7;
}

.voice-call .vc-perm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.voice-call .vc-perm-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}
.voice-call .vc-perm-pill.vc-perm-ok {
  background: #ecfdf5;
  color: #059669;
}
.voice-call .vc-perm-pill.vc-perm-bad {
  background: #fef2f2;
  color: #dc2626;
}
.voice-call .vc-perm-pill.vc-perm-wait {
  background: #fff7ed;
  color: #c2410c;
}


/* ========== Sudoku ========== */

/* Modern Sudoku icons (desktop + mobile) */
.icon-img.sudoku-icon,
.sudoku-icon {
  background: linear-gradient(145deg, #38bdf8 0%, #2563eb 55%, #1d4ed8 100%) !important;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.sudoku-icon::after,
.icon-img.sudoku-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3' y='3' width='18' height='18' rx='3' fill='%23fff' fill-opacity='0.15' stroke='%23fff' stroke-width='1.5'/%3E%3Cpath d='M3 9h18M3 15h18M9 3v18M15 3v18' stroke='%23fff' stroke-width='1.5'/%3E%3Ccircle cx='6.5' cy='6.5' r='1.2' fill='%23fff'/%3E%3Ccircle cx='12' cy='12' r='1.2' fill='%23fff'/%3E%3Ccircle cx='17.5' cy='17.5' r='1.2' fill='%23fff'/%3E%3C/svg%3E") !important;
  background-size: 62% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}
.sm-icon.sudoku-icon {
  background: linear-gradient(145deg, #38bdf8, #1d4ed8) !important;
  border-radius: 6px;
}
.sm-icon.sudoku-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3' y='3' width='18' height='18' rx='3' fill='%23fff' fill-opacity='0.15' stroke='%23fff' stroke-width='1.5'/%3E%3Cpath d='M3 9h18M3 15h18M9 3v18M15 3v18' stroke='%23fff' stroke-width='1.5'/%3E%3Ccircle cx='6.5' cy='6.5' r='1.2' fill='%23fff'/%3E%3Ccircle cx='12' cy='12' r='1.2' fill='%23fff'/%3E%3Ccircle cx='17.5' cy='17.5' r='1.2' fill='%23fff'/%3E%3C/svg%3E") !important;
  background-size: 70% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}
.app-img.sudoku {
  background: linear-gradient(145deg, #38bdf8 0%, #2563eb 50%, #1d4ed8 100%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3' y='3' width='18' height='18' rx='3' fill='%23fff' fill-opacity='0.15' stroke='%23fff' stroke-width='1.5'/%3E%3Cpath d='M3 9h18M3 15h18M9 3v18M15 3v18' stroke='%23fff' stroke-width='1.5'/%3E%3Ccircle cx='6.5' cy='6.5' r='1.2' fill='%23fff'/%3E%3Ccircle cx='12' cy='12' r='1.2' fill='%23fff'/%3E%3Ccircle cx='17.5' cy='17.5' r='1.2' fill='%23fff'/%3E%3C/svg%3E"), linear-gradient(145deg, #38bdf8 0%, #2563eb 50%, #1d4ed8 100%);
  background-size: 55%, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.sudoku-app {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  height: 100%;
  box-sizing: border-box;
  background: #f3f4f6;
  font-family: Tahoma, "Segoe UI", sans-serif;
  outline: none;
}
body:not(.light) .sudoku-app { background: #1e293b; color: #e2e8f0; }
.sdk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.sdk-diff { font-size: 11px; display: flex; gap: 4px; align-items: center; }
.sdk-level { font-size: 11px; }
.sdk-btn {
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}
.sdk-btn.active { background: #0ea5e9; color: #fff; border-color: #0284c7; }
body:not(.light) .sdk-btn { background: #334155; color: #e2e8f0; border-color: #475569; }
.sdk-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: min(100%, 320px);
  margin: 0 auto;
  border: 2px solid #0f172a;
  background: #0f172a;
  gap: 0;
}
body:not(.light) .sdk-board { border-color: #94a3b8; }
.sdk-cell {
  aspect-ratio: 1;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  position: relative;
  color: #0f172a;
}
body:not(.light) .sdk-cell { background: #0f172a; color: #e2e8f0; border-color: #334155; }
.sdk-cell.sdk-left { border-left-width: 2px; border-left-color: #0f172a; }
.sdk-cell.sdk-top { border-top-width: 2px; border-top-color: #0f172a; }
.sdk-cell.sdk-right { border-right-width: 2px; border-right-color: #0f172a; }
.sdk-cell.sdk-bottom { border-bottom-width: 2px; border-bottom-color: #0f172a; }
.sdk-cell.sdk-given { color: #0f172a; font-weight: 700; background: #e2e8f0; }
body:not(.light) .sdk-cell.sdk-given { background: #1e293b; color: #f8fafc; }
.sdk-cell.sdk-selected { outline: 2px solid #0ea5e9; z-index: 1; }
.sdk-cell.sdk-same { background: #e0f2fe; }
body:not(.light) .sdk-cell.sdk-same { background: #0c4a6e; }
.sdk-cell.sdk-error { color: #dc2626 !important; background: #fee2e2 !important; }
.sdk-cell.sdk-wrong { color: #b45309 !important; background: #fef3c7 !important; box-shadow: inset 0 0 0 2px #f59e0b; }
.sdk-has-notes { font-weight: 400; }
.sdk-notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  font-size: 7px;
  line-height: 1;
  color: #64748b;
  pointer-events: none;
}
.sdk-notes-grid span {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sdk-pad {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  width: min(100%, 320px);
  margin: 0 auto;
}
.sdk-key {
  aspect-ratio: 1;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}
body:not(.light) .sdk-key { background: #334155; color: #e2e8f0; border-color: #475569; }
.sdk-key:hover { background: #e0f2fe; }
.sdk-status { font-size: 11px; text-align: center; min-height: 1.2em; color: #475569; }
body:not(.light) .sdk-status { color: #94a3b8; }
.window[data-id="sudoku"] .window-body { overflow: auto; }

.sdk-timer {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  min-width: 3.2em;
  color: #0f172a;
}
body:not(.light) .sdk-timer { color: #e2e8f0; }

/* Sudoku view compatibility — desktop window + iPhone / small screens */
.sudoku-app {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  box-sizing: border-box;
  background: #f3f4f6;
  font-family: Tahoma, "Segoe UI", system-ui, sans-serif;
  outline: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
body:not(.light) .sudoku-app { background: #1e293b; color: #e2e8f0; }

.sdk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sdk-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: min(100%, 360px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border: 2px solid #0f172a;
  box-sizing: border-box;
  flex-shrink: 0;
  max-height: min(360px, 52vh);
  max-width: min(360px, 52vh, 100%);
}

.sdk-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: clamp(12px, 2.8vw, 18px);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sdk-pad {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  width: min(100%, 360px);
  max-width: min(360px, 100%);
  margin: 0 auto;
  flex-shrink: 0;
}

.sdk-key {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid #94a3b8;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sdk-status {
  flex-shrink: 0;
  font-size: 12px;
  text-align: center;
  min-height: 1.2em;
  color: #475569;
  padding: 0 8px 4px;
}

#page-sudoku {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
#page-sudoku .page-header {
  flex-shrink: 0;
}
#page-sudoku .page-body-full {
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: 100%;
  overflow: hidden;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}
#page-sudoku .sudoku-app {
  padding: 6px 8px max(10px, env(safe-area-inset-bottom, 0px));
  padding-left: max(8px, env(safe-area-inset-left, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
  height: 100%;
}

@media (max-width: 900px) {
  .sudoku-app {
    gap: 6px;
    background: #f8fafc;
  }
  body:not(.light) .sudoku-app { background: #0f172a; }
  .sdk-toolbar {
    gap: 4px;
  }
  .sdk-btn, .sdk-level, .sdk-diff, .sdk-game {
    font-size: 10px;
    padding: 6px 8px;
    min-height: 32px;
  }
  .sdk-board {
    width: min(100%, 92vw, 340px);
    max-width: min(92vw, 340px, 55vh);
    max-height: min(55vh, 340px);
  }
  .sdk-cell {
    font-size: clamp(11px, 3.6vw, 16px);
  }
  .sdk-pad {
    width: min(100%, 92vw, 340px);
    gap: 5px;
  }
  .sdk-key {
    font-size: 14px;
    min-height: 40px;
    border-radius: 8px;
  }
}

/* Very narrow phones */
@media (max-width: 380px) {
  .sdk-toolbar .sdk-diff { font-size: 9px; }
  .sdk-btn { padding: 5px 6px; font-size: 9px; }
  .sdk-board {
    max-width: min(96vw, 50vh);
    max-height: min(50vh, 96vw);
  }
  .sdk-key { min-height: 36px; font-size: 13px; }
}

/* Short / landscape viewports */
@media (max-height: 560px), (orientation: landscape) and (max-height: 500px) {
  .sudoku-app { gap: 4px; padding-top: 4px; }
  .sdk-toolbar { gap: 3px; }
  .sdk-btn, .sdk-level, .sdk-diff, .sdk-game {
    font-size: 9px;
    padding: 4px 6px;
    min-height: 28px;
  }
  .sdk-board {
    max-height: min(42vh, 280px);
    max-width: min(42vh, 280px, 90vw);
  }
  .sdk-key { min-height: 32px; font-size: 12px; }
  .sdk-status { font-size: 10px; padding-bottom: 2px; }
}

/* Landscape wide: board + pad side by side when height is tight */
@media (orientation: landscape) and (max-height: 480px) and (min-width: 640px) {
  .sudoku-app {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
  }
  .sdk-toolbar {
    width: 100%;
    order: 0;
  }
  .sdk-board {
    order: 1;
    max-height: min(70vh, 300px);
    max-width: min(70vh, 300px);
  }
  .sdk-pad {
    order: 2;
    width: min(200px, 40vw);
    grid-template-columns: repeat(3, 1fr);
    margin-left: 12px;
  }
  .sdk-status {
    width: 100%;
    order: 3;
  }
}

/* Tetris view compatibility — iPhone / small screens / landscape */
.tt-shell {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.tt-device {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #ffe566 0%, #f5c518 45%, #e6b800 100%);
  border-radius: 0;
  padding: 8px 10px max(12px, env(safe-area-inset-bottom, 0px));
  padding-left: max(10px, env(safe-area-inset-left, 0px));
  padding-right: max(10px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
  overflow: hidden;
}
.tt-brand {
  flex-shrink: 0;
  text-align: center;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 0.35em;
  font-size: 12px;
  color: #5c4a00;
  margin-bottom: 6px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.tt-screen-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #3d4a2e;
  border: 4px solid #2a3320;
  border-radius: 8px;
  padding: 6px;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.35);
  overflow: hidden;
}
.tt-board {
  display: block;
  background: #9ca88a;
  border-radius: 2px;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  touch-action: none;
  flex-shrink: 0;
  margin: 0 auto;
}
.tt-side {
  width: 64px;
  max-width: 28%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: "Segoe UI", system-ui, sans-serif;
  overflow: auto;
  max-height: 100%;
  -webkit-overflow-scrolling: touch;
}
.tt-controls {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-bottom: 2px;
}
.tt-dpad {
  display: grid;
  grid-template-columns: minmax(44px, 52px) minmax(44px, 52px) minmax(44px, 52px);
  grid-template-rows: minmax(40px, 48px) minmax(40px, 48px) minmax(36px, 44px);
  gap: 6px;
  justify-content: center;
  width: 100%;
  max-width: 220px;
}
.tt-pad {
  width: 100%;
  height: 100%;
  min-width: 44px;
  min-height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, #7dd3fc, #2563eb);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 #1e40af, 0 5px 10px rgba(0,0,0,0.25);
  touch-action: manipulation;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.tt-drop {
  grid-column: 1 / 4;
  grid-row: 3;
  width: auto;
  height: auto;
  min-height: 36px;
  border-radius: 20px;
  margin-top: 0;
}
#page-tetris,
#page-blockblaster {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
#page-tetris .page-header,
#page-blockblaster .page-header {
  flex-shrink: 0;
}
#page-tetris .page-body-full,
#page-blockblaster .page-body-full {
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: 100%;
  overflow: hidden;
}

/* Very narrow phones */
@media (max-width: 380px) {
  .tt-side { width: 56px; gap: 4px; }
  .tt-stat { padding: 3px 4px; }
  .tt-stat strong { font-size: 12px; }
  .tt-next, .tt-hold { width: 48px; height: 48px; }
  .tt-brand { font-size: 11px; letter-spacing: 0.25em; }
}

/* Short viewports / landscape iPhone */
@media (max-height: 520px), (orientation: landscape) and (max-height: 500px) {
  .tt-brand { display: none; }
  .tt-device { padding: 4px 6px max(6px, env(safe-area-inset-bottom, 0px)); }
  .tt-screen-wrap { border-width: 3px; padding: 4px; gap: 6px; }
  .tt-controls { margin-top: 4px; gap: 4px; }
  .tt-row { gap: 6px; }
  .tt-btn { height: 32px; min-width: 40px; font-size: 12px; }
  .tt-dpad {
    grid-template-columns: 40px 40px 40px;
    grid-template-rows: 36px 36px 32px;
    gap: 4px;
    max-width: 160px;
  }
  .tt-pad { min-width: 36px; min-height: 32px; font-size: 13px; }
  .tt-side { width: 52px; }
}

/* Landscape: side-by-side playfield + controls when wide enough */
@media (orientation: landscape) and (max-height: 480px) and (min-width: 600px) {
  .tt-device {
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
  }
  .tt-screen-wrap {
    flex: 1;
  }
  .tt-controls {
    margin-top: 0;
    justify-content: center;
    max-width: 200px;
  }
}


/* List numbers — mobile typing / content views */
@media (max-width: 900px) {
  .page-body ul,
  .page-body ol,
  .window-body ul,
  .window-body ol,
  .mobile-card ul,
  .mobile-card ol {
    margin-left: 0;
    padding-left: 1.6em;
    padding-right: 0.5em;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .page-body ol,
  .window-body ol,
  .mobile-card ol {
    list-style-type: decimal;
    list-style-position: outside;
  }
  .page-body li::marker,
  .window-body li::marker,
  .mobile-card li::marker {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
  }
  /* Avoid numbers clipping inside cards / overflow:hidden parents */
  .mobile-card,
  .page-body,
  .app-page .page-body {
    overflow-x: visible;
  }
  .mobile-card ol,
  .mobile-card ul {
    color: var(--mobile-muted, #666);
  }
}

/* Sudoku number pad — clearer digits on mobile typing */
@media (max-width: 900px) {
  .sdk-key {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    font-size: 16px; /* reduces iOS input zoom */
    min-height: 44px;
  }
  .sdk-cell {
    font-variant-numeric: tabular-nums;
  }
}


/* Sudoku number pad — always show digits 1–9 fully (no horizontal clip) */
.sdk-pad {
  display: grid !important;
  grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
  gap: 4px !important;
  width: 100% !important;
  max-width: min(360px, 100%) !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  padding: 0 2px !important;
  flex-shrink: 0 !important;
  overflow: visible !important;
}
.sdk-key {
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 40px !important;
  border-radius: 8px !important;
  font-size: clamp(12px, 3.8vw, 16px) !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.sdk-status {
  max-width: 100%;
  padding: 0 10px 6px !important;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal !important;
  line-height: 1.35;
}
@media (max-width: 900px) {
  .sdk-pad {
    width: 100% !important;
    max-width: 100% !important;
    gap: 3px !important;
    padding: 0 4px !important;
  }
  .sdk-key {
    min-height: 42px !important;
    font-size: clamp(13px, 4.2vw, 17px) !important;
  }
  .sdk-board {
    width: min(100%, calc(100vw - 24px)) !important;
    max-width: min(100%, calc(100vw - 24px), 55vh) !important;
  }
}
@media (max-width: 380px) {
  .sdk-pad { gap: 2px !important; }
  .sdk-key {
    min-height: 38px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
  }
}


/* Control Panel — function + view compatibility */
.control-app {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text);
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.cp-title { margin: 0 0 12px; font-size: 16px; }
.cp-section {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #ccc);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
body:not(.light) .cp-section {
  background: #1e293b;
  border-color: #334155;
}
.cp-section h4 { margin: 0 0 8px; font-size: 13px; }
.cp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.cp-row > span {
  flex: 1 1 120px;
  min-width: 0;
}
.cp-row select,
.cp-row input[type="checkbox"] {
  font-family: Tahoma, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  max-width: 100%;
}
.cp-row select {
  min-width: 120px;
  flex: 0 1 160px;
  min-height: 36px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border, #94a3b8);
  background: var(--card-bg, #fff);
  color: inherit;
}
.cp-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.cp-about { margin: 0; color: var(--text-muted, #64748b); line-height: 1.4; }
.cp-test-sound,
.cp-open-reg {
  margin-top: 6px;
  min-height: 36px;
  touch-action: manipulation;
}
.app-img.control {
  background: linear-gradient(145deg, #64748b 0%, #334155 100%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M19.14 12.94c.04-.31.06-.63.06-.94s-.02-.63-.06-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.49.49 0 00-.59-.22l-2.39.96a7.2 7.2 0 00-1.62-.94l-.36-2.54A.49.49 0 0014 2h-4a.49.49 0 00-.49.42l-.36 2.54c-.59.24-1.13.56-1.62.94l-2.39-.96a.49.49 0 00-.59.22L2.63 8.87a.49.49 0 00.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94L2.75 14.5a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.3.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.25.42.49.42h4c.24 0 .44-.18.49-.42l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32a.49.49 0 00-.12-.61l-2.03-1.58zM12 15.5A3.5 3.5 0 1112 8.5a3.5 3.5 0 010 7z'/%3E%3C/svg%3E"), linear-gradient(145deg, #64748b 0%, #334155 100%);
  background-size: 55%, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  border-radius: 14px;
}
#page-control {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
#page-control .page-body-full {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 !important;
}
#page-control .control-app {
  padding: 10px 12px max(16px, env(safe-area-inset-bottom, 0px));
}
@media (max-width: 900px) {
  .control-app { font-size: 14px; }
  .cp-row select { min-height: 40px; font-size: 15px; flex: 1 1 100%; }
  .cp-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .cp-section { border-radius: 12px; }
}
@media (max-width: 420px) {
  .control-app { padding: 8px 10px; }
  .cp-title { font-size: 15px; }
}


/* ========== Android phone shell (mobile only) ========== */
@media (max-width: 899px) {
  .mobile {
    display: flex !important;
    align-items: stretch;
    justify-content: center;
    background: #0b0f14;
    min-height: 100dvh;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
  }
  .android-frame {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 100dvh;
    background: #000;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .android-screen {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #121212;
    color: #e8eaed;
    font-family: "Roboto", "Segoe UI", system-ui, sans-serif;
  }
  body.light .android-screen {
    background: #f0f2f5;
    color: #202124;
  }
  .android-status-bar {
    flex-shrink: 0;
    height: 28px;
    padding: 4px 14px 0;
    padding-top: max(4px, env(safe-area-inset-top, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    background: transparent;
    color: inherit;
  }
  .android-status-bar .status-icons {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    opacity: 0.9;
  }
  .mobile-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: transparent;
  }
  .home-screen {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 12px 12px;
    background:
      radial-gradient(ellipse at 20% 0%, rgba(66, 133, 244, 0.25), transparent 50%),
      radial-gradient(ellipse at 80% 20%, rgba(52, 168, 83, 0.15), transparent 45%),
      #121212;
  }
  body.light .home-screen {
    background:
      radial-gradient(ellipse at 20% 0%, rgba(66, 133, 244, 0.12), transparent 50%),
      #e8f0fe;
  }
  .mobile-header {
    text-align: left;
    padding: 12px 8px 16px;
  }
  .mobile-header h1 {
    font-size: 22px;
    font-weight: 500;
    margin: 8px 0 4px;
    font-family: "Roboto", "Segoe UI", system-ui, sans-serif;
  }
  .mobile-header .subtitle,
  .mobile-header .years {
    font-size: 13px;
    opacity: 0.75;
  }
  .mobile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
  }
  .app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 10px;
    padding: 4px 4px 20px;
  }
  .app-icon {
    background: transparent;
    border: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 4px;
    cursor: pointer;
    font-family: "Roboto", system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
  }
  .app-icon span {
    font-size: 11px;
    font-weight: 400;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .app-img {
    width: 52px;
    height: 52px;
    border-radius: 16px; /* Android adaptive-icon-ish */
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  }
  .dock {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 8px;
    margin: 8px 8px 4px;
    padding: 10px 12px;
    background: rgba(32, 33, 36, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.08);
  }
  body.light .dock {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0,0,0,0.06);
  }
  .dock .app-icon span { display: none; }
  .dock .app-img {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }
  .android-nav {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    height: 48px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #000;
    color: #e8eaed;
  }
  body.light .android-nav {
    background: #e8eaed;
    color: #202124;
  }
  .android-nav-btn {
    font-size: 18px;
    opacity: 0.9;
    width: 48px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
  }
  /* Material-style app pages */
  .app-page {
    background: #121212;
    color: #e8eaed;
  }
  body.light .app-page {
    background: #f0f2f5;
    color: #202124;
  }
  .page-header {
    background: #1e1f22;
    border-bottom: none;
    padding: 10px 12px;
    min-height: 52px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
  body.light .page-header {
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  }
  .page-header h2 {
    font-family: "Roboto", system-ui, sans-serif;
    font-weight: 500;
    font-size: 18px;
    text-align: left;
    margin-right: 0;
  }
  .back-btn {
    font-family: "Roboto", system-ui, sans-serif;
    color: #8ab4f8;
    font-size: 22px;
  }
  body.light .back-btn { color: #1a73e8; }
  .page-body {
    font-family: "Roboto", "Segoe UI", system-ui, sans-serif;
  }
  .mobile-card {
    border-radius: 16px;
    background: #1e1f22;
    box-shadow: none;
    border: 1px solid rgba(255,255,255,0.06);
  }
  body.light .mobile-card {
    background: #fff;
    border-color: rgba(0,0,0,0.06);
  }
  /* Settings / Control on phone */
  #page-control .control-app {
    background: transparent;
    padding: 12px 14px max(20px, env(safe-area-inset-bottom, 0px));
  }
  #page-control .cp-section {
    border-radius: 16px;
    background: #1e1f22;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 14px;
    margin-bottom: 12px;
  }
  body.light #page-control .cp-section {
    background: #fff;
    border-color: rgba(0,0,0,0.08);
  }
  #page-control .cp-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
  }
  #page-control .cp-row select {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    border-radius: 12px;
    padding: 10px 12px;
    background: #2d2e31;
    color: #e8eaed;
    border: 1px solid rgba(255,255,255,0.12);
  }
  body.light #page-control .cp-row select {
    background: #f1f3f4;
    color: #202124;
    border-color: rgba(0,0,0,0.12);
  }
  #page-control .cp-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
  }
  #page-control .proj-btn,
  #page-control .cp-test-sound {
    width: 100%;
    min-height: 48px;
    border-radius: 24px;
    font-size: 15px;
  }
  /* Hide legacy iPhone chrome if any leftover */
  .iphone-notch,
  .dynamic-island,
  .iphone-frame,
  .home-indicator {
    display: none !important;
  }
}

/* Desktop: never show android chrome */
@media (min-width: 900px) {
  .android-nav { display: none !important; }
}

/* Android navigation gesture feedback (phone only) */
@media (max-width: 899px) {
  .android-gesture-hint {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    border-radius: 999px;
    background: rgba(138, 180, 248, 0.35);
    box-shadow: 0 0 0 1px rgba(138, 180, 248, 0.5);
    transition: opacity 0.12s ease;
  }
  .android-gesture-hint[data-kind="back"] {
    top: 30%;
    left: 0;
    width: calc(4px + 18px * var(--g-progress, 0));
    height: 96px;
    border-radius: 0 12px 12px 0;
  }
  .android-gesture-hint[data-kind="home"] {
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: calc(48px + 80px * var(--g-progress, 0));
    height: 4px;
    transform: translateX(-50%);
    border-radius: 4px;
    background: rgba(232, 234, 237, 0.85);
  }
  .android-recents-pulse {
    animation: androidRecentsPulse 0.55s ease;
  }
  @keyframes androidRecentsPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.04); box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.45); }
    100% { transform: scale(1); }
  }
}


/* Chat app (like Sudoku) */
.chat-icon {
  background: linear-gradient(145deg, #6366f1, #7c3aed);
}
.chat-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.2L4 17.2V4h16v12z'/%3E%3C/svg%3E");
}
.sm-icon.chat-icon {
  background: linear-gradient(145deg, #6366f1, #7c3aed);
}
.app-img.chat {
  background: linear-gradient(145deg, #6366f1, #7c3aed);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.2L4 17.2V4h16v12z'/%3E%3C/svg%3E"), linear-gradient(145deg, #6366f1, #7c3aed);
  background-size: 55%, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  border-radius: 16px;
}
.chat-app-host {
  height: 100%;
  min-height: 0;
}
.chat-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #f8fafc;
  color: #0f172a;
  font-family: Tahoma, "Segoe UI", system-ui, sans-serif;
}
.chat-app-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
}
.chat-app-title {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-app-email {
  color: #e0e7ff;
  font-size: 11px;
  text-decoration: none;
  background: rgba(255,255,255,0.15);
  padding: 3px 8px;
  border-radius: 12px;
}
.chat-app-email:hover { background: rgba(255,255,255,0.28); color: #fff; }
.chat-app-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.chat-app .message {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-app .message.user {
  align-self: flex-end;
  background: #4f46e5;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-app .message.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  border-bottom-left-radius: 4px;
}
.chat-app .typing-dots { display: inline-flex; gap: 4px; }
.chat-app .typing-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: #94a3b8;
  animation: chatDot 1.2s infinite ease-in-out;
}
.chat-app .typing-dots span:nth-child(2) { animation-delay: .2s; }
.chat-app .typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes chatDot {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}
.chat-app-input {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.chat-app-field {
  flex: 1;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
.chat-app-field:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.chat-app-send {
  border: none;
  border-radius: 20px;
  padding: 10px 14px;
  background: #4f46e5;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.chat-app-send:disabled { opacity: .5; cursor: not-allowed; }
#page-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
#page-chat .page-body-full {
  flex: 1;
  min-height: 0;
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#page-chat .chat-app-host,
#page-chat .chat-app {
  height: 100%;
}
@media (max-width: 899px) {
  .chat-app-header { padding: 12px 14px; }
  .chat-app .message { font-size: 14px; }
  .chat-app-field { min-height: 44px; font-size: 16px; }
  .chat-app-send { min-height: 44px; }
}
/* Hide legacy floating widget if any left over */
#chat-widget { display: none !important; }

.chat-app-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 8px;
  flex-shrink: 0;
  background: #f8fafc;
}
.chat-app-chips button {
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}
.chat-app-chips button:hover {
  background: #e0e7ff;
}


/* Chats app — ryOS-inspired messenger */
.chats-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #0b0f17;
  color: #e8eaed;
  font-family: "Segoe UI", system-ui, sans-serif;
}
body.light .chats-app {
  background: #f4f5f7;
  color: #111;
}
.chats-top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(20, 24, 36, 0.95);
  backdrop-filter: blur(12px);
}
body.light .chats-top {
  background: rgba(255,255,255,0.92);
  border-bottom-color: rgba(0,0,0,0.08);
}
.chats-persona { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chats-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(145deg, #6366f1, #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 14px;
}
.chats-name { font-size: 13px; font-weight: 600; }
.chats-status { font-size: 11px; opacity: 0.7; display: flex; align-items: center; gap: 6px; }
.chats-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.25);
}
.chats-top-actions { display: flex; gap: 6px; align-items: center; }
.chats-mail, .chats-clear {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: inherit;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
}
body.light .chats-mail, body.light .chats-clear {
  border-color: rgba(0,0,0,0.1);
  background: #fff;
}
.chats-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.chats-row { display: flex; flex-direction: column; max-width: 92%; }
.chats-row-user { align-self: flex-end; align-items: flex-end; }
.chats-row-assistant { align-self: flex-start; align-items: flex-start; }
.chats-bubble {
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.chats-bubble-user {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chats-bubble-assistant {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom-left-radius: 4px;
}
body.light .chats-bubble-assistant {
  background: #fff;
  border-color: rgba(0,0,0,0.08);
  color: #111;
}
.chats-meta {
  font-size: 10px;
  opacity: 0.45;
  margin-top: 2px;
  padding: 0 4px;
}
.chats-typing { display: inline-flex; gap: 4px; padding: 2px 0; }
.chats-typing i {
  width: 6px; height: 6px; border-radius: 50%; background: #94a3b8;
  display: block; animation: chatsTyping 1.2s infinite ease-in-out;
}
.chats-typing i:nth-child(2) { animation-delay: .15s; }
.chats-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chatsTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.chats-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 8px;
  flex-shrink: 0;
}
.chats-suggestions button {
  border: 1px solid rgba(129,140,248,0.35);
  background: rgba(99,102,241,0.12);
  color: #c7d2fe;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
}
body.light .chats-suggestions button {
  color: #3730a3;
  background: #eef2ff;
  border-color: #c7d2fe;
}
.chats-composer {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(12, 16, 28, 0.96);
}
body.light .chats-composer {
  background: #fff;
  border-top-color: rgba(0,0,0,0.08);
}
.chats-input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: inherit;
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 14px;
  outline: none;
}
body.light .chats-input {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #111;
}
.chats-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.chats-send {
  border: none;
  border-radius: 14px;
  padding: 0 16px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.chats-send:disabled { opacity: .5; cursor: not-allowed; }
#page-chat .page-body-full { padding: 0 !important; }
#page-chat .chat-app-host, #page-chat .chats-app { height: 100%; }
.chat-app-host { height: 100%; min-height: 0; display: flex; flex-direction: column; }
@media (max-width: 899px) {
  .chats-input { font-size: 16px; min-height: 44px; }
  .chats-send { min-height: 44px; }
}


/* Advanced Chats extras */
.chats-app-advanced .chats-composer {
  align-items: flex-end;
}
.chats-app-advanced .chats-input {
  resize: none;
  min-height: 42px;
  max-height: 120px;
  line-height: 1.4;
  font-family: inherit;
}
.chats-attach {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
body.light .chats-attach {
  border-color: rgba(0,0,0,0.1);
  background: #f1f5f9;
}
.chats-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 8px;
}
.chats-quick[hidden] { display: none !important; }
.chats-quick button {
  border: 1px solid rgba(129,140,248,0.35);
  background: rgba(99,102,241,0.12);
  color: #c7d2fe;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
}
.chats-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  padding: 0 4px;
  font-size: 10px;
  opacity: 0.55;
}
.chats-copy {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 10px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  opacity: 0.8;
}
.chats-link {
  color: #a5b4fc;
  text-decoration: underline;
  word-break: break-all;
}
body.light .chats-link { color: #4338ca; }
.chats-code {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
  background: rgba(0,0,0,0.25);
  padding: 1px 5px;
  border-radius: 4px;
}
body.light .chats-code { background: #e2e8f0; }
.chats-tool-card {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  font-size: 12px;
}
.chats-tool-card span {
  display: inline-block;
  margin: 2px 4px 0 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34,197,94,0.2);
}
.chats-export {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: inherit;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
}
body.light .chats-export {
  border-color: rgba(0,0,0,0.1);
  background: #fff;
}


/* Mobile Apps folder */
.app-img.apps-folder {
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M4 8h4v4H4V8zm6 0h4v4h-4V8zm6 0h4v4h-4V8zM4 14h4v4H4v-4zm6 0h4v4h-4v-4zm6 0h4v4h-4v-4z'/%3E%3C/svg%3E"), linear-gradient(145deg, #3b82f6, #1d4ed8);
  background-size: 55%, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  border-radius: 16px;
}
.page-body-apps {
  padding: 16px 14px 24px;
}
.apps-folder-lead {
  margin: 0 0 14px;
  font-size: 13px;
  opacity: 0.7;
  color: inherit;
}
.apps-folder-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 8px;
  justify-items: center;
}
.apps-folder-grid .app-icon {
  width: 100%;
  max-width: 80px;
  background: transparent;
  border: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  cursor: pointer;
}
.apps-folder-grid .app-img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background-size: 55%, cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.apps-folder-grid .app-icon span {
  font-size: 11px;
  text-align: center;
  line-height: 1.2;
}
@media (max-width: 360px) {
  .apps-folder-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 12px;
  }
}


/* Mobile Games folder */
.app-img.games-folder {
  background: linear-gradient(145deg, #f59e0b, #ea580c);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M15 7.5V2H9v5.5l3 3 3-3zM7.5 9H2v6h5.5l3-3-3-3zM9 16.5V22h6v-5.5l-3-3-3 3zM16.5 9l-3 3 3 3H22V9h-5.5z'/%3E%3C/svg%3E"), linear-gradient(145deg, #f59e0b, #ea580c);
  background-size: 52%, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  border-radius: 16px;
}
.games-folder-grid {
  grid-template-columns: repeat(3, 1fr);
  max-width: 280px;
  margin: 0 auto;
  gap: 18px 12px;
}


/* Snake game */
.snake-icon, .sm-icon.snake-icon {
  background: linear-gradient(145deg, #22c55e, #15803d);
}
.snake-icon::after, .sm-icon.snake-icon::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17 6c-1.1 0-2 .9-2 2 0 .4.1.7.3 1L12 12.3 8.7 9c.2-.3.3-.6.3-1 0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2c.4 0 .7-.1 1-.3L12 14l4-4.3c.3.2.6.3 1 .3 1.1 0 2-.9 2-2s-.9-2-2-2zM7 14c-1.7 0-3 1.3-3 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3zm10 0c-1.7 0-3 1.3-3 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z'/%3E%3C/svg%3E");
}
.app-img.snake {
  background: linear-gradient(145deg, #22c55e, #15803d);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17 6c-1.1 0-2 .9-2 2 0 .4.1.7.3 1L12 12.3 8.7 9c.2-.3.3-.6.3-1 0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2c.4 0 .7-.1 1-.3L12 14l4-4.3c.3.2.6.3 1 .3 1.1 0 2-.9 2-2s-.9-2-2-2zM7 14c-1.7 0-3 1.3-3 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3zm10 0c-1.7 0-3 1.3-3 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z'/%3E%3C/svg%3E"), linear-gradient(145deg, #22c55e, #15803d);
  background-size: 55%, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  border-radius: 16px;
}
.snake-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #020617;
  color: #e2e8f0;
  font-family: Tahoma, "Segoe UI", system-ui, sans-serif;
  padding: 8px;
  gap: 8px;
  box-sizing: border-box;
}
.snake-hud {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  flex-shrink: 0;
}
.snake-hud b { color: #4ade80; }
.snake-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.snake-canvas {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(148,163,184,0.2);
  touch-action: none;
}
.snake-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(2, 6, 23, 0.72);
  border-radius: 10px;
  text-align: center;
  padding: 16px;
}
.snake-overlay[hidden] { display: none !important; }
.snake-overlay-title { font-size: 20px; font-weight: 700; }
.snake-overlay-sub { font-size: 12px; opacity: 0.75; }
.snake-btn {
  margin-top: 6px;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
.snake-pad {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
}
.snake-pad-mid {
  display: flex;
  gap: 6px;
  align-items: center;
}
.snake-dir {
  width: 52px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.25);
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  font-size: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.snake-dir:active { background: #334155; }
#page-snake .page-body-full {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
#page-snake .snake-app { height: 100%; }
@media (min-width: 900px) {
  .snake-pad { display: none; }
}

.tetris-icon, .sm-icon.tetris-icon {
  background: linear-gradient(145deg, #0ea5e9, #0369a1);
}
.app-img.tetris {
  border-radius: 16px;
}
.tt-desktop {
  height: 100%;
  min-height: 0;
  overflow: auto;
}
.tt-desktop .tt-device {
  max-width: 100%;
  margin: 0 auto;
}


/* Mobile settings extras */
@media (max-width: 899px) {
  .control-app {
    padding: 12px 14px 28px;
    max-width: 100%;
    box-sizing: border-box;
  }
  .control-app .cp-title {
    font-size: 18px;
    margin: 4px 0 12px;
  }
  .control-app .cp-section {
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(0,0,0,0.04);
  }
  body:not(.light) .control-app .cp-section {
    background: rgba(255,255,255,0.06);
  }
  .control-app .cp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 6px 0;
    font-size: 14px;
  }
  .control-app select,
  .control-app .proj-btn {
    min-height: 40px;
    font-size: 14px;
    border-radius: 10px;
  }
  .control-app input[type="checkbox"] {
    width: 22px;
    height: 22px;
  }
  .control-app .cp-danger {
    border-color: #f87171;
    color: #b91c1c;
  }
  #home-screen[data-layout="compact"] .app-grid {
    gap: 10px 6px;
  }
  #home-screen[data-layout="compact"] .app-img {
    width: 48px;
    height: 48px;
  }
  #home-screen[data-layout="compact"] .app-icon span {
    font-size: 10px;
  }
}
body.large-text {
  font-size: 17px;
}
body.large-text .app-icon span,
body.large-text .page-header h2 {
  font-size: 1.05em;
}
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
body.no-ui-anim .window,
body.no-ui-anim .app-page {
  transition: none !important;
}

/* ========== Android-style Settings (mobile) ========== */
@media (max-width: 899px) {
  #page-control {
    background: #121212 !important;
  }
  body.light #page-control {
    background: #f0f2f5 !important;
  }
  #page-control .page-header {
    background: #1c1c1e;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  body.light #page-control .page-header {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.08);
  }
  #page-control .page-header h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.01em;
  }

  .control-app-android {
    padding: 12px 12px max(24px, env(safe-area-inset-bottom, 0px)) !important;
    background: transparent !important;
    font-family: "Roboto", "Google Sans", -apple-system, "Segoe UI", sans-serif !important;
    color: #e8eaed !important;
  }
  body.light .control-app-android {
    color: #202124 !important;
  }

  .control-app-android .cp-title {
    display: none; /* page header already says Settings */
  }

  .control-app-android .cp-section {
    background: #1e1f22 !important;
    border: none !important;
    border-radius: 16px !important;
    padding: 4px 0 8px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    overflow: hidden;
  }
  body.light .control-app-android .cp-section {
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  }

  .control-app-android .cp-section h4 {
    margin: 0 !important;
    padding: 14px 16px 6px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    color: #8ab4f8 !important; /* Android accent blue */
  }
  body.light .control-app-android .cp-section h4 {
    color: #1a73e8 !important;
  }

  .control-app-android .cp-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 14px 16px !important;
    min-height: 52px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-sizing: border-box;
  }
  body.light .control-app-android .cp-row {
    border-bottom-color: rgba(0,0,0,0.06);
  }
  .control-app-android .cp-section .cp-row:last-of-type {
    border-bottom: none;
  }

  .control-app-android .cp-row > span {
    flex: 1;
    font-size: 15px !important;
    font-weight: 400;
    color: #e8eaed;
  }
  body.light .control-app-android .cp-row > span {
    color: #202124;
  }

  .control-app-android .cp-row select {
    flex: 0 1 auto;
    min-width: 120px;
    max-width: 55%;
    min-height: 40px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    background: #2d2e31 !important;
    color: #e8eaed !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    margin: 0 !important;
  }
  body.light .control-app-android .cp-row select {
    background: #f1f3f4 !important;
    color: #202124 !important;
    border-color: rgba(0,0,0,0.12) !important;
  }

  /* Material-style switches */
  .control-app-android .cp-toggle-row input[type="checkbox"],
  .control-app-android .cp-row input[type="checkbox"] {
    width: 52px !important;
    height: 32px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background: #5f6368 !important;
    border-radius: 999px !important;
    position: relative !important;
    cursor: pointer;
    border: none !important;
    flex-shrink: 0;
    transition: background 0.2s ease;
  }
  .control-app-android .cp-toggle-row input[type="checkbox"]::after,
  .control-app-android .cp-row input[type="checkbox"]::after {
    content: "" !important;
    position: absolute !important;
    top: 4px !important;
    left: 4px !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35) !important;
    transition: transform 0.2s ease !important;
  }
  .control-app-android .cp-toggle-row input[type="checkbox"]:checked,
  .control-app-android .cp-row input[type="checkbox"]:checked {
    background: #8ab4f8 !important;
  }
  body.light .control-app-android .cp-toggle-row input[type="checkbox"]:checked,
  body.light .control-app-android .cp-row input[type="checkbox"]:checked {
    background: #1a73e8 !important;
  }
  .control-app-android .cp-toggle-row input[type="checkbox"]:checked::after,
  .control-app-android .cp-row input[type="checkbox"]:checked::after {
    transform: translateX(20px) !important;
  }

  .control-app-android .proj-btn,
  .control-app-android .cp-test-sound,
  .control-app-android .cp-test-haptic,
  .control-app-android .cp-share,
  .control-app-android .cp-open-site {
    width: calc(100% - 32px) !important;
    margin: 8px 16px !important;
    min-height: 48px !important;
    border-radius: 24px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    border: none !important;
    background: #2d2e31 !important;
    color: #8ab4f8 !important;
    box-shadow: none !important;
  }
  body.light .control-app-android .proj-btn,
  body.light .control-app-android .cp-test-sound,
  body.light .control-app-android .cp-test-haptic,
  body.light .control-app-android .cp-share,
  body.light .control-app-android .cp-open-site {
    background: #e8f0fe !important;
    color: #1a73e8 !important;
  }
  .control-app-android .cp-danger {
    background: transparent !important;
    color: #f28b82 !important;
    border: 1px solid rgba(242, 139, 130, 0.4) !important;
  }
  body.light .control-app-android .cp-danger {
    color: #d93025 !important;
    border-color: rgba(217, 48, 37, 0.35) !important;
    background: transparent !important;
  }

  .control-app-android .cp-about,
  .control-app-android .cp-contact {
    padding: 8px 16px 12px !important;
    margin: 0 !important;
    font-size: 13px !important;
    color: #9aa0a6 !important;
    line-height: 1.4;
  }
  body.light .control-app-android .cp-about,
  body.light .control-app-android .cp-contact {
    color: #5f6368 !important;
  }

  /* Wallpaper picker inside Android settings */
  .control-app-android .cp-wall-block {
    padding: 8px 12px 12px;
  }
  .control-app-android .cp-wall-label-row {
    display: none;
  }
  .control-app-android .wall-picker {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-height: 240px;
  }
  .control-app-android .wall-thumb {
    border-radius: 12px;
  }
  .control-app-android .wall-thumb.is-active {
    border-color: #8ab4f8;
  }
  body.light .control-app-android .wall-thumb.is-active {
    border-color: #1a73e8;
  }
  .control-app-android .wall-thumb-swatch {
    height: 56px;
    border-radius: 10px;
  }
  .control-app-android .cp-wall-select-fallback {
    display: none !important;
  }
}


/* Edge: opened external site confirmation */
.edge-opened {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 24px;
  box-sizing: border-box;
  background: linear-gradient(160deg, #e8f4fc 0%, #f5f7fa 100%);
}
.edge-opened-card {
  max-width: 420px;
  width: 100%;
  background: #fff;
  border: 1px solid #c5d0dc;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: #1e293b;
}
.edge-opened-card .edge-ext-code {
  display: block;
  word-break: break-all;
  font-size: 12px;
  background: #f1f5f9;
  padding: 8px 10px;
  border-radius: 6px;
}
body:not(.light) .edge-opened {
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
}
body:not(.light) .edge-opened-card {
  background: #1e1e24;
  border-color: #334155;
  color: #e2e8f0;
}
body:not(.light) .edge-opened-card .edge-ext-code {
  background: #0f172a;
  color: #93c5fd;
}

/* Edge bookmarks + proxy (daedalOS-inspired) */
.edge-bookmarks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 8px;
  background: #f3f4f6;
  border-bottom: 1px solid #ccc;
}
.edge-bm {
  font-family: Tahoma, "Segoe UI", sans-serif;
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: #1e3a5f;
}
.edge-bm:hover {
  background: #e0e7ff;
  border-color: #93c5fd;
}
.edge-proxy {
  font-family: Tahoma, sans-serif;
  font-size: 11px;
  padding: 3px 6px;
  max-width: 110px;
  border: 1px solid #888;
  border-radius: 3px;
  background: #fff;
}
.edge-nav:disabled {
  opacity: 0.4;
  cursor: default;
}
body:not(.light) .edge-bookmarks {
  background: #252530;
  border-color: #444;
}
body:not(.light) .edge-bm {
  color: #e2e8f0;
}
body:not(.light) .edge-bm:hover {
  background: #334155;
  border-color: #64748b;
}
body:not(.light) .edge-proxy {
  background: #1e1e24;
  color: #e2e8f0;
  border-color: #555;
}


/* Mobile Microsoft Edge */
.app-img.edge {
  background: linear-gradient(145deg, #0ea5e9, #2563eb 45%, #1d4ed8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%23fff' stroke-width='2'/%3E%3Ccircle cx='12' cy='12' r='3.5' fill='%23fff'/%3E%3C/svg%3E"), linear-gradient(145deg, #0ea5e9, #2563eb 45%, #1d4ed8);
  background-size: 55%, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  border-radius: 16px;
}
#page-edge .page-body-full {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
#page-edge .edge-app {
  height: 100%;
  min-height: 0;
  border-radius: 0;
}
#page-edge .edge-toolbar {
  flex-wrap: wrap;
  gap: 4px;
}
#page-edge .edge-address {
  flex: 1 1 100%;
  min-width: 0;
  font-size: 16px;
  min-height: 40px;
}
#page-edge .edge-frame {
  width: 100%;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
#page-edge .edge-external,
#page-edge .edge-browse {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  background: #ffffff;
}
#page-edge .edge-body {
  padding: 0;
  background: #ffffff;
}
@media (max-width: 899px) {
  #page-edge .edge-nav {
    min-width: 40px;
    min-height: 40px;
    border-radius: 10px;
  }
  #page-edge .edge-frame {
    min-height: calc(100dvh - 180px);
  }
}


/* ========== Mobile Edge — desktop-style light chrome ========== */
@media (max-width: 899px) {
  #page-edge {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #ece9d8;
  }
  #page-edge[hidden] {
    display: none !important;
  }
  #page-edge .page-header {
    flex-shrink: 0;
    background: #ece9d8;
    color: #1a1a1a;
    border-bottom: 1px solid #aca899;
  }
  #page-edge .page-header h2 {
    color: #1a1a1a;
  }
  #page-edge .back-btn {
    color: #1e4a8c;
  }
  #page-edge .page-body-full,
  #page-edge #content-edge {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
  }
  #page-edge .edge-app {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    min-height: 0;
    width: 100%;
    background: #ffffff;
    color: #111;
    font-family: Tahoma, "Segoe UI", sans-serif;
  }
  #page-edge .edge-toolbar {
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
    background: #ece9d8;
    border-bottom: 1px solid #888;
  }
  #page-edge .edge-nav {
    min-width: 40px;
    min-height: 36px;
    border-radius: 3px;
    border: 1px solid #888;
    background: linear-gradient(to bottom, #fff, #e8e8e8);
    color: #111;
    font-size: 13px;
    font-family: Tahoma, sans-serif;
  }
  #page-edge .edge-nav:active {
    background: #e8f0ff;
    border-color: #316ac5;
  }
  #page-edge .edge-address {
    flex: 1 1 100%;
    order: -1;
    width: 100%;
    min-height: 36px;
    border-radius: 2px;
    border: 1px solid #7f9db9;
    background: #ffffff;
    color: #111;
    padding: 6px 10px;
    font-size: 16px;
    font-family: Consolas, "Courier New", monospace;
  }
  #page-edge .edge-proxy {
    min-height: 32px;
    border-radius: 2px;
    background: #fff;
    color: #111;
    border: 1px solid #888;
    font-family: Tahoma, sans-serif;
  }
  #page-edge .edge-bookmarks {
    flex-shrink: 0;
    overflow-x: auto;
    white-space: nowrap;
    padding: 4px 8px;
    background: #f0eee1;
    border-bottom: 1px solid #c0c0c0;
  }
  #page-edge .edge-bm {
    display: inline-block;
    margin-right: 4px;
    padding: 4px 8px;
    border-radius: 2px;
    border: 1px solid #aca899;
    background: linear-gradient(to bottom, #fff, #ece9d8);
    color: #111;
    font-size: 11px;
    font-family: Tahoma, sans-serif;
  }
  #page-edge .edge-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
  }
  #page-edge .edge-browse,
  #page-edge .edge-external {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff !important;
  }
  #page-edge .edge-browse::before {
    background: #f3f3f3 !important;
  }
  #page-edge .edge-frame {
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
  }
  #page-edge .edge-status {
    flex-shrink: 0;
    background: #ece9d8;
    color: #333;
    border-top: 1px solid #aaa;
    padding: 4px 8px;
    padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
    font-size: 11px;
    font-family: Tahoma, sans-serif;
  }
  #page-edge .edge-frame-note {
    flex-shrink: 0;
    background: #f5f5f0;
    color: #444;
  }
}

/* ========== Mobile UI icon polish 20260817 ========== */
@media (max-width: 899px) {
  .home-screen {
    padding: 6px 14px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-header {
    padding: 12px 0 16px;
  }
  .mobile-avatar {
    width: 84px;
    height: 84px;
    margin-bottom: 10px;
  }
  .mobile-header h1 {
    font-size: 22px;
    letter-spacing: -0.02em;
  }
  .mobile-header .subtitle {
    font-size: 13px;
    opacity: 0.85;
  }

  .app-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 8px;
    padding: 4px 2px 20px;
    align-content: start;
  }

  .app-icon {
    gap: 5px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-width: 0;
  }
  .app-icon:active .app-img {
    transform: scale(0.92);
    filter: brightness(1.08);
  }
  .app-icon span {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.15;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    opacity: 0.95;
  }

  .app-img {
    width: 56px;
    height: 56px;
    border-radius: 15px;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.18) inset,
      0 4px 12px rgba(0, 0, 0, 0.28);
    background-size: 52% !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    transition: transform 0.12s ease, filter 0.12s ease;
  }

  /* Consistent modern icons */
  .app-img.edge {
    background-color: transparent !important;
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c1.3 0 2.5-.3 3.6-.7-2.4-.6-4.2-2.8-4.2-5.3 0-3 2.5-5.5 5.5-5.5.6 0 1.2.1 1.7.3C17.3 5.5 14.9 2 12 2zm7.5 9.5c-2.5 0-4.5 2-4.5 4.5s2 4.5 4.5 4.5 4.5-2 4.5-4.5-2-4.5-4.5-4.5z'/%3E%3C/svg%3E"),
      linear-gradient(145deg, #38bdf8, #2563eb 55%, #1d4ed8) !important;
    background-size: 54%, cover !important;
  }
  .app-img.chat {
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M4 4h16a2 2 0 012 2v9a2 2 0 01-2 2H9l-5 4v-4H4a2 2 0 01-2-2V6a2 2 0 012-2z'/%3E%3C/svg%3E"),
      linear-gradient(145deg, #34d399, #059669) !important;
    background-color: transparent !important;
    background-size: 52%, cover !important;
  }
  .app-img.apps-folder {
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M4 4h6v6H4V4zm10 0h6v6h-6V4zM4 14h6v6H4v-6zm10 0h6v6h-6v-6z'/%3E%3C/svg%3E"),
      linear-gradient(145deg, #94a3b8, #475569) !important;
    background-size: 50%, cover !important;
  }
  .app-img.games-folder {
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M15 7.5V2H9v5.5l3 3 3-3zM7.5 9H2v6h5.5l3-3-3-3zM9 16.5V22h6v-5.5l-3-3-3 3zM16.5 9l-3 3 3 3H22V9h-5.5z'/%3E%3C/svg%3E"),
      linear-gradient(145deg, #fbbf24, #ea580c) !important;
    background-size: 52%, cover !important;
  }
  .app-img.control {
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M19.14 12.94c.04-.31.06-.63.06-.94s-.02-.63-.06-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.49.49 0 00-.59-.22l-2.39.96a7.2 7.2 0 00-1.62-.94l-.36-2.54A.48.48 0 0014 2h-4a.48.48 0 00-.47.4l-.36 2.54c-.59.24-1.13.55-1.62.94l-2.39-.96a.49.49 0 00-.59.22L2.65 8.87a.49.49 0 00.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94L2.77 14.5a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.3.59.22l2.39-.96c.5.39 1.04.7 1.62.94l.36 2.54c.05.22.24.4.47.4h4c.23 0 .42-.18.47-.4l.36-2.54c.58-.24 1.12-.55 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32a.49.49 0 00-.12-.61l-2.03-1.58zM12 15.5A3.5 3.5 0 1112 8.5a3.5 3.5 0 010 7z'/%3E%3C/svg%3E"),
      linear-gradient(145deg, #64748b, #334155) !important;
    background-size: 54%, cover !important;
  }
  .app-img.device {
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17 1H7a2 2 0 00-2 2v18a2 2 0 002 2h10a2 2 0 002-2V3a2 2 0 00-2-2zm0 18H7V5h10v14z'/%3E%3C/svg%3E"),
      linear-gradient(145deg, #22d3ee, #0284c7) !important;
    background-size: 48%, cover !important;
  }

  .dock {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    margin: 0 10px 10px;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }
  body.light .dock {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(0, 0, 0, 0.08);
  }
  .dock .app-icon {
    flex: 0 0 auto;
  }
  .dock .app-img {
    width: 48px;
    height: 48px;
    border-radius: 13px;
  }
  .theme-toggle-mobile {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    flex-shrink: 0;
  }

  /* Folder grids */
  .apps-folder-grid,
  .games-folder-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 12px;
    padding: 8px 4px 24px;
    max-width: 100%;
    margin: 0 auto;
  }
  .apps-folder-lead {
    text-align: center;
    opacity: 0.75;
    font-size: 13px;
    margin: 4px 0 12px;
  }

  /* Page headers cleaner */
  .page-header {
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    min-height: 48px;
  }
  .back-btn {
    min-width: 44px;
    min-height: 40px;
    font-size: 22px;
  }

  /* Compact home layout preference */
  #home-screen[data-layout="compact"] .app-grid {
    gap: 10px 6px;
  }
  #home-screen[data-layout="compact"] .app-img {
    width: 48px;
    height: 48px;
    border-radius: 13px;
  }
  #home-screen[data-layout="compact"] .app-icon span {
    font-size: 10px;
  }
}
