/* Theme-specific interface personalities and decorative motifs. */
.theme-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: .22;
}

.theme-atmosphere svg {
  position: absolute;
  width: min(48vw, 520px);
  height: auto;
  color: var(--color-primary);
}

.theme-atmosphere svg:first-child {
  top: 2%;
  right: -5%;
}

.theme-atmosphere svg:last-child {
  bottom: 2%;
  left: -8%;
  transform: rotate(180deg);
  opacity: .55;
}

#workspace,
main,
aside,
header,
footer,
.mobile-dock {
  position: relative;
  z-index: 1;
}

/* Previews show a miniature interface instead of three disconnected color chips. */
.theme-swatch {
  position: relative;
  isolation: isolate;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 8px 1fr 1fr;
  gap: 3px;
}

.theme-swatch::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 8px;
  background: color-mix(in srgb, var(--swatch-primary) 68%, white);
}

.theme-swatch i {
  border-radius: 3px;
}

.theme-swatch i:first-child {
  grid-row: 2 / 4;
}

.theme-option {
  min-height: 82px;
}

.theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2em;
}

.theme-copy small {
  line-height: 1.45;
}

/* Windows 11: centered, airy acrylic surfaces and pill controls. */
body[data-mood="win11"] #workspace {
  max-width: 1280px;
}

body[data-mood="win11"] aside,
body[data-mood="win11"] header,
body[data-mood="win11"] .mobile-dock {
  box-shadow: 0 12px 38px #31587a12;
}

body[data-mood="win11"] .sidebar-link,
body[data-mood="win11"] button {
  border-radius: 12px;
}

body[data-mood="win11"] #todayView section {
  box-shadow: 0 10px 30px #42658312, inset 0 1px #ffffffb5;
}

/* Windows 10: square geometry, colorful live-tile accents and a sharp nav rail. */
body[data-mood="win10"] .sidebar-link.active {
  border-radius: 2px;
}

body[data-mood="win10"] #todayView>div:nth-child(2)>div {
  border-radius: 3px !important;
  border-left: 4px solid var(--color-primary);
}

body[data-mood="win10"] #todayView section {
  border-radius: 4px !important;
}

/* Aero: luminous glass, blue edge-light and a softly animated highlight. */
body[data-mood="aero"] #workspace {
  position: relative;
}

body[data-mood="aero"] .sidebar-link.active {
  background: linear-gradient(#fff9, #a7dcf64d) !important;
  box-shadow: inset 0 1px #fff, 0 0 12px #5db5e044;
}

body[data-mood="aero"] #todayView section {
  box-shadow: 0 12px 34px #286a8a18, inset 0 1px #fff;
}

/* XP: familiar blue title bars, rounded panels and green start-button styling. */
body[data-mood="xp"] aside {
  border-top: 5px solid #4d9bea;
}

body[data-mood="xp"] #todayView h1 {
  text-shadow: 0 1px #fff;
}

body[data-mood="xp"] #captureBtn {
  background: linear-gradient(#78c965, #238c2d) !important;
  border: 1px solid #23792a;
}

body[data-mood="xp"] .sidebar-link.active {
  border-radius: 5px !important;
  box-shadow: inset 0 1px #fff;
}

/* Nokia X: recognizable colorful square-tile launcher, not a recolored desktop. */
body[data-mood="nokia"] aside {
  background: #f5f6f4 !important;
}

body[data-mood="nokia"] aside nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

body[data-mood="nokia"] aside nav .sidebar-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  min-height: 76px;
  padding: 10px !important;
  border: 0;
  border-radius: 2px;
  background: #139e9a;
  color: white !important;
  font-size: 11px;
}

body[data-mood="nokia"] aside nav .sidebar-link:nth-child(4n + 1) {
  background: #e84a58;
}

body[data-mood="nokia"] aside nav .sidebar-link:nth-child(4n + 2) {
  background: #169f9a;
}

body[data-mood="nokia"] aside nav .sidebar-link:nth-child(4n + 3) {
  background: #4c72c9;
}

body[data-mood="nokia"] aside nav .sidebar-link:nth-child(4n) {
  background: #e0a62c;
}

body[data-mood="nokia"] aside nav .sidebar-link.active {
  outline: 2px solid #26363a;
  outline-offset: -4px;
}

body[data-mood="nokia"] aside nav .sidebar-link .nav-icon {
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 3px;
  opacity: .85;
}

body[data-mood="nokia"] aside nav .sidebar-link .ml-auto {
  display: none;
}

body[data-mood="nokia"] #todayView>div:nth-child(2)>div {
  border-radius: 2px !important;
  box-shadow: inset 0 -4px #00000012;
}

body[data-mood="nokia"] #todayView>div:nth-child(3)>div>section {
  border-radius: 2px !important;
}

body[data-mood="nokia"] #captureBtn {
  border-radius: 2px !important;
  background: #e84a58 !important;
}

/* Galaxy and other space-inspired looks receive a real starfield motif. */
body[data-mood="galaxy"] .theme-atmosphere,
body[data-mood="moon"] .theme-atmosphere,
body[data-mood="aurora"] .theme-atmosphere {
  opacity: .32;
}

body[data-mood="galaxy"] #todayView section {
  backdrop-filter: blur(10px);
}

/* Natural themes get a botanical watermark; waterfall and beach use flowing waves. */
body[data-mood="nature"] .theme-atmosphere,
body[data-mood="forest"] .theme-atmosphere,
body[data-mood="garden"] .theme-atmosphere,
body[data-mood="village"] .theme-atmosphere {
  opacity: .2;
}

body[data-mood="nature"] #todayView section,
body[data-mood="forest"] #todayView section,
body[data-mood="garden"] #todayView section {
  box-shadow: 0 8px 25px #365f3510;
}

body[data-mood="waterfall"] .theme-atmosphere,
body[data-mood="beach"] .theme-atmosphere,
body[data-mood="ocean"] .theme-atmosphere,
body[data-mood="oceanic"] .theme-atmosphere {
  opacity: .16;
}

/* Workbench looks use a quiet grid and denser, technical components. */
body[data-mood="tech"] #workspace,
body[data-mood="programmer"] #workspace,
body[data-mood="blueprint"] #workspace,
body[data-mood="physics"] #workspace,
body[data-mood="maths"] #workspace {
  background-image: linear-gradient(color-mix(in srgb, var(--color-primary) 5%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--color-primary) 5%, transparent) 1px, transparent 1px);
  background-size: 28px 28px;
}

body[data-mood="programmer"] .font-mono,
body[data-mood="hacker"] .font-mono {
  font-family: var(--font-mono);
}

body[data-mood="professional"] #todayView section {
  box-shadow: 0 4px 15px #20374a0b;
}

body[data-mood="doctor"] #todayView section {
  border-top: 2px solid color-mix(in srgb, var(--color-primary) 32%, white);
}

body[data-mood="teacher"] #todayView section {
  box-shadow: 0 3px 0 #8f642012;
}

/* Pixel, retro, and block worlds use deliberate geometry and tactile edges. */
body[data-mood="pixel"] #todayView section,
body[data-mood="pixel"] #alternateView section,
body[data-mood="pixel"] .theme-option {
  border-radius: 4px !important;
  box-shadow: 3px 3px 0 #08081455;
}

body[data-mood="minecraft"] #todayView section,
body[data-mood="minecraft"] #alternateView section {
  border-radius: 5px !important;
  box-shadow: 0 4px 0 #62734a35;
}

body[data-mood="roblox"] #todayView section {
  border-radius: 9px !important;
  box-shadow: 0 5px 0 #303b4c19;
}

body[data-mood="retrobw"] {
  filter: grayscale(1);
}

body[data-mood="minimal"] #todayView section,
body[data-mood="minimalicon"] #todayView section,
body[data-mood="textonly"] #todayView section {
  box-shadow: none !important;
}

body[data-mood="textonly"] .theme-icon {
  display: none;
}

body[data-mood="largeicon"] .theme-icon {
  font-size: 1.2em;
}

/* Decorative theme forms remain behind content, never compete with controls. */
body[data-motif="leaf"] .theme-atmosphere svg {
  width: min(52vw, 570px);
}

body[data-motif="wave"] .theme-atmosphere svg {
  width: min(58vw, 640px);
}

body[data-motif="star"] .theme-atmosphere svg {
  width: min(56vw, 590px);
}

body[data-motif="window"] .theme-atmosphere svg {
  width: min(44vw, 480px);
}

@media(max-width:640px) {
  .theme-atmosphere svg {
    width: 72vw !important;
    opacity: .65;
  }

  body[data-mood="nokia"] aside nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media(prefers-reduced-motion:reduce) {

  .theme-atmosphere *,
  .theme-option {
    animation: none !important;
    transition: none !important;
  }
}

/* Distinct scenic surfaces: layered landscape art stays behind the working UI. */
.theme-scenery { position:fixed; inset:0; z-index:0; overflow:hidden; pointer-events:none; }
.theme-scenery::after { content:""; position:absolute; inset:auto 0 0; height:31vh; background:linear-gradient(0deg,#d7e9d5ad,transparent); }
.landscape-art { position:absolute; inset:auto 0 0; width:100%; height:min(43vh,420px); min-height:250px; filter:saturate(.88); }
.scenery-forest .landscape-art { filter:hue-rotate(13deg) saturate(.76) brightness(.77); }
.scenery-village .landscape-art { filter:hue-rotate(-12deg) saturate(.72) brightness(1.03); }
.scenery-home .landscape-art { filter:saturate(.65) brightness(1.08); }
.scenery-wellness .landscape-art { filter:hue-rotate(8deg) saturate(.58) brightness(1.08); }
.scenery-waterfall .landscape-art { height:min(53vh,510px); filter:saturate(1.14); }
.waterfall-shell { background:linear-gradient(180deg,#ccebf0 0%,#eaf8f6 46%,#d9efdf 100%)!important; }
.nature-shell:not(.waterfall-shell) { background:linear-gradient(180deg,#e3f1dc 0%,#f6f7ee 53%,#e8efdf 100%)!important; }
.waterfall-flow { animation:waterfall-flow 2.6s ease-in-out infinite alternate; }
@keyframes waterfall-flow { from { opacity:.7; transform:translateY(-2px); } to { opacity:1; transform:translateY(5px); } }

/* Nokia X becomes a compact, touch-first tile launcher rather than a desktop sidebar. */
body[data-mood="nokia"] { background:linear-gradient(155deg,#f1f5f3,#e4ece8 70%,#f7f7f4); }
body[data-mood="nokia"] aside { display:none!important; }
body[data-mood="nokia"] main { margin-left:0!important; padding-bottom:32px; }
body[data-mood="nokia"] header { height:48px!important; padding-inline:18px!important; background:#f8faf9!important; border-bottom:2px solid #e84a58!important; }
body[data-mood="nokia"] header #searchBtn, body[data-mood="nokia"] header #verifyBtn, body[data-mood="nokia"] header #notificationBtn, body[data-mood="nokia"] header #commandBtn { display:none!important; }
body[data-mood="nokia"] #workspace { max-width:820px; padding-top:0!important; }
body[data-mood="nokia"] .nokia-launcher { max-width:520px; margin:0 auto 28px; padding:0 16px 18px; background:#f7f8f7; border:1px solid #d6dfda; border-top:0; box-shadow:0 12px 35px #1d403119; }
.nokia-status { height:34px; display:flex; align-items:center; justify-content:space-between; font:600 10px var(--font-mono); color:#53645d; border-bottom:1px solid #e3e8e4; }
.nokia-welcome { padding:20px 4px 16px; }
.nokia-eyebrow { color:#168e85; font-size:9px; font-weight:800; letter-spacing:1.5px; }
.nokia-welcome h2 { margin:6px 0 2px; color:#27342f; font:800 26px/1.08 var(--font-heading); letter-spacing:-1px; }
.nokia-welcome h2 span { color:#e84a58; }
.nokia-welcome p { margin:5px 0 0; color:#87938c; font-size:11px; }
.nokia-tiles { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.nokia-tile { min-height:72px; border:0; border-radius:2px; color:#fff; padding:11px 13px; display:flex; align-items:center; gap:12px; text-align:left; font-size:12px; font-weight:700; box-shadow:inset 0 -4px #00000012; transition:filter .16s,transform .16s; }
.nokia-tile:hover { filter:brightness(1.08); transform:translateY(-2px); }
.nokia-tile-icon { display:grid; place-items:center; width:34px; height:34px; border:1px solid #ffffff70; border-radius:2px; font-size:20px; }
.nokia-tile.tile-0,.nokia-tile.tile-4 { background:#e84a58; }
.nokia-tile.tile-1,.nokia-tile.tile-5 { background:#139e9a; }
.nokia-tile.tile-2,.nokia-tile.tile-capture { background:#4c72c9; }
.nokia-tile.tile-3,.nokia-tile.tile-6 { background:#e0a62c; }
.nokia-tile.tile-7 { background:#788f4c; }.nokia-tile.tile-8 { background:#66747c; }
body[data-mood="nokia"] #todayView>div:nth-child(2) { grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:8px!important; }
body[data-mood="nokia"] #todayView>div:nth-child(2)>div { position:relative; min-height:92px; display:flex; flex-direction:column; justify-content:center; border:0!important; border-radius:2px!important; background:#fff!important; box-shadow:inset 5px 0 var(--tile-color,#e84a58),0 3px 8px #29443912; padding:12px 14px!important; }
body[data-mood="nokia"] #todayView>div:nth-child(2)>div:nth-child(2) { --tile-color:#139e9a; } body[data-mood="nokia"] #todayView>div:nth-child(2)>div:nth-child(3) { --tile-color:#e0a62c; } body[data-mood="nokia"] #todayView>div:nth-child(2)>div:nth-child(4) { --tile-color:#4c72c9; }
body[data-mood="nokia"] #todayView>div:nth-child(2)>div span:first-child { font-size:9px!important; }
body[data-mood="nokia"] #todayView>div:nth-child(2)>div .mt-2 { font-size:20px!important; }
body[data-mood="nokia"] #todayView .grid-cols-1.xl\\:grid-cols-\\[minmax\\(0\\,1\\.65fr\\)_minmax\\(270px\\,\\.85fr\\)\\] { display:block!important; }
body[data-mood="nokia"] #todayView>div:nth-child(3)>div>section { border-radius:2px!important; box-shadow:0 3px 12px #30443912; }
body[data-mood="nokia"] #taskList label { display:grid; grid-template-columns:18px 1fr; background:#f6f8f6; margin:6px 0; padding:10px!important; border:0!important; font-size:11px!important; }
body[data-mood="nokia"] #taskList label>span:last-child { display:none; }
body[data-mood="nokia"] #taskList label>span:nth-child(2) { overflow:hidden; display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; }
body[data-mood="nokia"] .mobile-dock { display:none!important; }

/* Windows themes get a wallpaper desktop, app windows, Start menu, and real taskbar. */
body.desktop-shell { background-image:radial-gradient(ellipse at 48% 14%,#ffffffbf,transparent 33%),linear-gradient(145deg,#d7eafa,#bfd8ef)!important; background-attachment:fixed; }
body.desktop-shell main { padding-bottom:74px; }
body.desktop-shell aside { top:18px!important; bottom:74px!important; left:18px!important; border:1px solid #ffffff9c!important; border-radius:16px!important; box-shadow:0 14px 40px #19476a29; }
body.desktop-shell header { margin:18px 18px 0; border:1px solid #ffffffa6!important; border-radius:14px; box-shadow:0 8px 28px #224f701c; }
body.desktop-shell #workspace { max-width:1240px; }
body.desktop-shell #todayView section, body.desktop-shell #alternateView section { box-shadow:0 12px 35px #1d4e7014,inset 0 1px #fff; }
.desktop-taskbar { position:fixed; z-index:60; inset:auto 0 0; height:58px; display:flex; align-items:center; justify-content:center; gap:10px; border-top:1px solid #ffffff94; background:#e9f4f5d9; backdrop-filter:blur(24px); box-shadow:0 -8px 28px #1743671c; }
.desktop-start,.taskbar-pins button { display:grid; place-items:center; width:42px; height:40px; border:0; border-radius:10px; background:transparent; color:#176eae; font-size:21px; }
.desktop-start:hover,.taskbar-pins button:hover { background:#ffffffad; }
.taskbar-pins { display:flex; gap:4px; }
.taskbar-pins button { font-size:17px; }
.taskbar-clock { position:absolute; right:22px; color:#304960; font-size:10px; font-weight:600; }
.desktop-start-menu { position:fixed; z-index:59; bottom:68px; left:50%; width:min(430px,calc(100vw - 24px)); padding:18px; border:1px solid #ffffffbb; border-radius:16px; background:#f6f9fbea; box-shadow:0 22px 70px #102d4a40; backdrop-filter:blur(28px); opacity:0; pointer-events:none; transform:translate(-50%,14px) scale(.98); transition:opacity .18s,transform .18s; }
.desktop-start-menu.is-open { opacity:1; pointer-events:auto; transform:translate(-50%,0) scale(1); }
.start-user { display:flex; align-items:center; gap:10px; padding:4px 4px 15px; font-size:12px; font-weight:700; color:#243c50; }
.start-avatar { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:#1978bf; color:white; }
.start-label { padding:8px 3px; font-size:10px; text-transform:uppercase; letter-spacing:1px; color:#718394; font-weight:800; }
.start-apps { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; }
.start-apps button { display:flex; align-items:center; gap:8px; padding:10px 8px; border:0; border-radius:9px; background:transparent; color:#29445a; text-align:left; font-size:11px; }
.start-apps button:hover,.start-all:hover { background:#ddecf8; }
.start-apps button span { display:grid; place-items:center; width:25px; height:25px; border-radius:7px; background:#deeffc; color:#0878d4; font-size:16px; }
.start-all { width:100%; display:flex; align-items:center; gap:8px; margin-top:13px; padding:11px; border:0; border-top:1px solid #dce5eb; background:transparent; color:#36516a; text-align:left; font-size:11px; }
.start-all span { margin-left:auto; }
.taskbar-win10 { justify-content:flex-start; padding-left:12px; background:#172c42ed; border-color:#324c65; }
.taskbar-win10 .desktop-start,.taskbar-win10 .taskbar-pins button,.taskbar-win10 .taskbar-clock { color:#fff; }
.taskbar-win10 .desktop-start { background:#0078d4; border-radius:2px; }
.start-win10 { left:12px; bottom:58px; width:min(360px,calc(100vw - 24px)); max-height:calc(100vh - 82px); overflow-y:auto; box-sizing:border-box; transform:translate(0,14px) scale(.98); border-radius:2px; background:#17334dF5; border-color:#34516a; }
.start-win10.is-open { transform:translate(0,0) scale(1); }
.start-win10 .start-user,.start-win10 .start-label,.start-win10 .start-apps button,.start-win10 .start-all { color:#edf6ff; }
.start-win10 .start-apps button span { color:white; background:#0878d4; border-radius:2px; }
.start-win10 .start-apps button:hover,.start-win10 .start-all:hover { background:#ffffff20; }
.taskbar-aero { background:linear-gradient(#effaffd9,#83c7e8d9); border-color:#ffffff; }
.taskbar-aero .desktop-start { color:#0c7cb3; text-shadow:0 0 14px #fff; }
.start-aero { background:linear-gradient(145deg,#f5fcffeF,#b6e0f4ee); border-color:#fff; }
.taskbar-xp { justify-content:flex-start; padding-left:12px; background:linear-gradient(#4eab3c,#267823); border-top:2px solid #a0d68c; }
.taskbar-xp .desktop-start { width:88px; background:linear-gradient(#86d867,#35972e); color:white; border-radius:20px; font-style:italic; font-weight:800; }
.start-xp { left:12px; bottom:58px; width:355px; border-radius:8px 8px 0 0; background:linear-gradient(100deg,#e9f4ff,#fff); border-color:#83b4df; }

@media(max-width:700px) {
  .desktop-taskbar { height:50px; }
  .taskbar-clock { right:8px; font-size:9px; }
  body.desktop-shell aside { display:none!important; }
  body.desktop-shell main { margin-left:0!important; padding-bottom:62px; }
  body.desktop-shell header { margin:0; border-radius:0; }
  .desktop-start-menu { bottom:56px; }
  .start-win10,.start-xp { left:8px; }
  .landscape-art { height:290px; opacity:.8; }
}
@media(prefers-reduced-motion:reduce) {
  .waterfall-flow { animation:none; }
  .desktop-start-menu,.nokia-tile { transition:none; }
}

/* Keep every desktop-inspired theme usable inside narrow embedded previews. */
.desktop-start-menu {
  box-sizing: border-box;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 82px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.start-apps,
.start-apps button {
  min-width: 0;
}

.start-apps button {
  overflow-wrap: anywhere;
}

.start-apps button span {
  flex: 0 0 25px;
}

.start-xp {
  width: min(355px, calc(100vw - 24px));
}

@media (max-width: 390px) {
  .desktop-taskbar {
    justify-content: flex-start;
    gap: 3px;
    padding-inline: 6px 72px;
  }

  .desktop-start,
  .taskbar-pins button {
    width: 34px;
    height: 38px;
    flex: 0 0 34px;
  }

  .taskbar-pins {
    gap: 1px;
  }

  .taskbar-clock {
    right: 6px;
    font-size: 8px;
    white-space: nowrap;
  }

  .desktop-start-menu {
    left: 8px;
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 72px);
    padding: 14px;
    transform: translateY(14px) scale(.98);
  }

  .desktop-start-menu.is-open {
    transform: translateY(0) scale(1);
  }

  .start-win10,
  .start-xp {
    left: 8px;
    width: calc(100vw - 16px);
  }

  .start-win10 {
    max-height: calc(100dvh - 72px);
  }

  .start-apps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-height: 520px) {
  .desktop-start-menu {
    max-height: calc(100dvh - 66px);
    padding-block: 10px;
  }

  .start-user {
    padding-bottom: 8px;
  }

  .start-label {
    padding-block: 5px;
  }

  .start-all {
    margin-top: 6px;
    padding-block: 8px;
  }
}

/* Decor should never create sideways scrolling in a theme preview. */
.theme-scenery,
.theme-atmosphere {
  max-width: 100vw;
}
.landscape-art {
  max-width: 100%;
}
