/* Frutiger Aero Windows 7 desktop. Design spec: DESIGN.md.
   Vanilla CSS, system fonts only, images come only from assets/. */

/* ---------- Tokens (light is the default) ---------- */
:root {
  color-scheme: light;
  --frame: rgba(150, 215, 235, 0.72);
  --frame-off: rgba(205, 232, 242, 0.55);
  --title: #06263f;
  --title-off: #3f6179;
  --title-glow: rgba(255, 255, 255, 0.95);
  --body: #ffffff;
  --text: #16212b;
  --muted: #5b7385;
  --accent: #1e90ff;
  --link: #0a62c9;
  --heading: #0a4a8f;
  --green: #7ac943;
  --sel: #d6f0ff;
  --border: #6fa6c4;
  --red: #c75050;
  --soft: #dcebf4;
  --bar-bg: #eef6fb;
  --paper: #ffffff;
  --btn-top: #f7fbff;
  --btn-bot: #cfe3f2;
  --btn-gloss: rgba(255, 255, 255, 0.75);
  --btn-text: #16212b;
  --btn-border: #6c8aa0;
  --pri-top: #eaf7ff;
  --pri-bot: #a5d4f3;
  --shadow: 0 10px 28px rgba(0, 40, 80, 0.4);
  --shadow-off: 0 4px 12px rgba(0, 40, 80, 0.22);
  --tb-top: rgba(60, 140, 190, 0.9);
  --tb-bot: rgba(18, 78, 128, 0.94);
  --font: "Segoe UI", Frutiger, Tahoma, Arial, sans-serif;
  --mono: Consolas, "Lucida Console", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --frame: rgba(20, 60, 85, 0.82);
    --frame-off: rgba(26, 50, 66, 0.7);
    --title: #e6f6ff;
    --title-off: #9db6c6;
    --title-glow: rgba(120, 220, 255, 0.55);
    --body: #14212b;
    --text: #e6eef3;
    --muted: #8fa8b8;
    --accent: #4db8ff;
    --link: #4db8ff;
    --heading: #9fdcff;
    --green: #8fdc5a;
    --sel: #1b4668;
    --border: #2f5a73;
    --soft: #1d3140;
    --bar-bg: #101c25;
    --paper: #14212b;
    --btn-top: #3d5568;
    --btn-bot: #223441;
    --btn-gloss: rgba(255, 255, 255, 0.16);
    --btn-text: #e6eef3;
    --pri-top: #3f6a8c;
    --pri-bot: #1f425e;
    --shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
    --shadow-off: 0 4px 12px rgba(0, 0, 0, 0.4);
    --tb-top: rgba(14, 58, 82, 0.92);
    --tb-bot: rgba(4, 20, 36, 0.96);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0a2a43;
  color: var(--text);
  font: 14px/1.5 var(--font);
}

button { font: inherit; color: inherit; }
img { -webkit-user-drag: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Wallpaper: assets/beta-fish.png, darkened in dark mode ---------- */
#desktop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  background: url("assets/beta-fish.png") center / cover;
}
@media (prefers-color-scheme: dark) {
  #desktop {
    background:
      linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
      url("assets/beta-fish.png") center / cover;
  }
}

/* ---------- Desktop icons ---------- */
#icons {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 8px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  max-height: calc(100vh - 56px);
  -webkit-user-select: none;
  user-select: none;
}
.dicon {
  width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px 4px;
  margin: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #fff;
  font: 12px/1.2 var(--font);
  text-align: center;
  text-decoration: none;
  text-shadow: 0 1px 3px rgba(0, 20, 50, 0.9), 0 0 2px rgba(0, 20, 50, 0.9);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  -webkit-user-select: none;
  user-select: none;
}
.dicon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 30, 60, 0.45));
}
.dicon span { max-width: 100%; overflow-wrap: anywhere; }
.dicon:hover,
.dicon:focus-visible {
  background: linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.1));
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.35);
  outline: none;
}
.dicon:active { background: rgba(120, 200, 255, 0.35); }

/* ---------- Gadgets ---------- */
#gadgets {
  position: absolute;
  z-index: 1;
  top: 14px;
  right: 14px;
  width: 172px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
.g-clock, .g-cal, .g-wx {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 6px 16px rgba(0, 30, 60, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.g-clock {
  padding: 12px;
  background: linear-gradient(rgba(255, 255, 255, 0.16) 0 45%, transparent 45%), rgba(8, 30, 48, 0.6);
}
.dial {
  position: relative;
  width: 146px;
  height: 146px;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background-color: #dff1fb;
  background-image:
    radial-gradient(circle closest-side, #f4fbff 0 82%, transparent 83%),
    repeating-conic-gradient(from -1deg, #06263f 0 2deg, transparent 2deg 30deg);
  box-shadow: inset 0 0 12px rgba(0, 80, 140, 0.35), 0 0 0 3px rgba(8, 30, 48, 0.55);
}
.dial::after { /* gloss, hard edge at the half */
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 3%;
  height: 46%;
  border-radius: 50% 50% 45% 45% / 70% 70% 30% 30%;
  background: linear-gradient(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.12));
  pointer-events: none;
}
#h-hand, #m-hand, #s-hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  display: block;
  background: #06263f;
  border-radius: 3px;
  transform-origin: 50% 100%;
}
#h-hand { width: 5px; height: 34px; margin-left: -2.5px; }
#m-hand { width: 3px; height: 50px; margin-left: -1.5px; background: #0a4a8f; }
/* thin, under the cap; no transition, so it never spins back at 60 s */
#s-hand { width: 1px; height: 58px; margin-left: -0.5px; background: #d62f2f; border-radius: 0; }
.dial u {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  text-decoration: none;
  background: radial-gradient(circle at 35% 30%, #fff, #7fc4ee 45%, #0a4a8f);
  box-shadow: 0 1px 2px rgba(0, 20, 50, 0.6);
}

.g-cal {
  position: relative;
  background: var(--body);
  color: var(--text);
}
.rings {
  position: absolute;
  z-index: 2;
  top: -7px;
  left: 12px;
  right: 12px;
  height: 18px;
  background: repeating-linear-gradient(90deg,
    transparent 0 4px, #3b4a57 4px 6px, #e8eef2 6px 8px, #8fa0ad 8px 10px, transparent 10px 15px);
  border-radius: 4px;
}
.mon {
  padding: 14px 6px 5px;
  border-radius: 7px 7px 0 0;
  text-align: center;
  font: 700 11px/1.3 var(--font);
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(rgba(255, 255, 255, 0.3) 0 48%, transparent 48%), linear-gradient(#2a9be3, #0a5fb0);
  text-shadow: 0 1px 1px rgba(0, 30, 70, 0.6);
}
.g-cal .grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  padding: 5px 7px 8px;
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
}
.g-cal .grid b { color: var(--link); font-weight: 700; }
.g-cal .grid span { border-radius: 3px; }
.g-cal .grid span.today {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(rgba(255, 255, 255, 0.3) 0 48%, transparent 48%), linear-gradient(#1f86d6, #0a5fb0);
}

.g-wx {
  padding: 8px 8px 4px;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 30, 70, 0.6);
  background: linear-gradient(rgba(255, 255, 255, 0.18) 0 42%, transparent 42%), linear-gradient(#2a8bd0, #0b4f8f);
}
.g-wx i { font-style: normal; }
.g-wx .now { display: flex; align-items: center; gap: 6px; }
.g-wx .now > i { flex: none; width: 56px; text-align: center; font-size: 46px; line-height: 1; color: #ffd84a; }
.g-wx .now > div { flex: 1; text-align: right; font-size: 11px; line-height: 1.3; }
.g-wx .now b { display: block; font: 700 28px/1.1 var(--font); }
.g-wx .now span { display: block; }
.g-wx .days { display: flex; gap: 3px; margin-top: 6px; }
.g-wx .days div {
  flex: 1;
  padding: 3px 0;
  border-radius: 3px;
  text-align: center;
  font-size: 10px;
  line-height: 1.35;
  background: rgba(0, 30, 70, 0.28);
}
.g-wx .days u { display: block; text-decoration: none; }
.g-wx .days i { display: block; font-size: 16px; line-height: 1.2; color: #e8f4fc; }
.g-wx p { margin: 4px 0 0; font-size: 9px; line-height: 1.4; opacity: 0.8; }

/* ---------- Windows ---------- */
#wins { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.win {
  position: absolute;
  display: flex;
  flex-direction: column;
  max-width: calc(100vw - 8px);
  max-height: calc(100vh - 48px);
  padding: 0 8px 8px;
  pointer-events: auto;
  background: var(--frame);
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.bar {
  position: relative;
  flex: none;
  height: 30px;
  margin: 0 -8px;
  padding: 0 6px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 7px 7px 0 0;
  cursor: move;
  -webkit-user-select: none;
  user-select: none;
  /* no backdrop-filter: while a window fades (motion.css) it is a backdrop root, so a blur here would sample only
     the window itself and the bar's glass would change in one frame when the fade ends. Without it the bar looks the same either way. */
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.5) 0, rgba(255, 255, 255, 0.18) 49%,
    rgba(40, 130, 180, 0.12) 50%, rgba(255, 255, 255, 0.22) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.bar::before { /* diagonal sheen over the left half */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(112deg, rgba(255, 255, 255, 0.42) 0, rgba(255, 255, 255, 0.12) 48%, transparent 49%);
}
.bar > * { position: relative; }
.bar img { width: 16px; height: 16px; flex: none; }
.ttl {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font: 12px/30px var(--font);
  color: var(--title);
  text-shadow: 0 0 8px var(--title-glow), 0 0 3px var(--title-glow);
}
.ctl { flex: none; display: flex; gap: 2px; align-self: flex-start; margin-top: 1px; }
.ctl button {
  width: 28px;
  height: 20px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  color: var(--title);
  cursor: pointer;
  border: 1px solid rgba(0, 30, 60, 0.55);
  border-radius: 5px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.7) 0 46%, transparent 46%),
    linear-gradient(rgba(190, 225, 242, 0.7), rgba(120, 175, 205, 0.7));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}
.ctl button:hover { box-shadow: inset 0 0 6px 1px rgba(77, 184, 255, 0.8); }
.ctl .x {
  width: 42px;
  color: #fff;
  text-shadow: 0 1px 1px rgba(80, 0, 0, 0.7);
  background-color: var(--red);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.55) 0 46%, transparent 46%),
    linear-gradient(#d86a6a, #b03a3a);
}
.ctl .x:hover {
  background-color: #e81123;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.5) 0 46%, transparent 46%),
    linear-gradient(#f2535f, #e81123);
  box-shadow: inset 0 0 6px 1px rgba(255, 200, 200, 0.7);
}

.body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  -webkit-user-select: text;
  user-select: text;
  background: var(--body);
  color: var(--text);
  border: 1px solid rgba(0, 40, 80, 0.5);
  border-radius: 0 0 3px 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.body > * { flex-shrink: 0; }
.body p { margin: 0 0 0.6em; }
.body a { color: var(--link); }
.body a:hover { text-decoration: none; }
.body a.btn { color: var(--btn-text); text-decoration: none; }

/* inactive: lighter shadow, washed title bar */
.win.inactive { background: var(--frame-off); box-shadow: var(--shadow-off), inset 0 0 0 1px rgba(255, 255, 255, 0.45); }
.win.inactive .bar { background: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)); }
.win.inactive .bar::before { opacity: 0.5; }
.win.inactive .bar img { opacity: 0.65; }
.win.inactive .ttl { color: var(--title-off); text-shadow: 0 0 4px var(--title-glow); }
.win.inactive .ctl button { opacity: 0.6; }
.win.inactive .video { pointer-events: none; } /* the click reaches the window and raises it */

.win.maxed {
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: calc(100% - 40px) !important;
  max-width: none;
  max-height: none;
  border-radius: 0;
}
.win.maxed .bar { cursor: default; }

/* ---------- Buttons ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 16px;
  font: 13px/1.4 var(--font);
  color: var(--btn-text);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--btn-border);
  border-radius: 4px;
  background:
    linear-gradient(var(--btn-gloss) 0 46%, transparent 46%),
    linear-gradient(var(--btn-top), var(--btn-bot));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.btn img { width: 16px; height: 16px; }
.btn:hover {
  border-color: var(--accent);
  box-shadow: inset 0 0 8px 2px rgba(77, 184, 255, 0.45);
}
.btn:active { background: linear-gradient(var(--btn-bot), var(--btn-top)); }
.btn.primary {
  border: 2px solid var(--accent);
  padding: 2px 18px;
  font-weight: 600;
  background:
    linear-gradient(rgba(255, 255, 255, 0.9) 0 46%, transparent 46%),
    linear-gradient(var(--pri-top), var(--pri-bot));
}
@media (prefers-color-scheme: dark) {
  .btn.primary { background: linear-gradient(rgba(255, 255, 255, 0.28) 0 46%, transparent 46%), linear-gradient(var(--pri-top), var(--pri-bot)); }
}

/* ---------- Welcome ---------- */
.id {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(#f0faff, var(--body));
  border-bottom: 1px solid var(--soft);
}
@media (prefers-color-scheme: dark) { .id { background: linear-gradient(#1d3547, var(--body)); } }
.id h1 { margin: 0; font: 300 28px/1.2 var(--font); color: var(--heading); }
.id p { margin: 2px 0 0; color: var(--muted); }
.avatar {
  position: relative;
  flex: none;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid #fff;
  color: #fff;
  font: 300 30px/1 var(--font);
  text-shadow: 0 1px 2px rgba(0, 30, 70, 0.6);
  background: radial-gradient(circle at 50% 120%, #7fd0f5, #0a6fc0 70%);
  box-shadow: 0 2px 8px rgba(0, 40, 80, 0.45), 0 0 0 1px rgba(0, 60, 120, 0.5);
}
.avatar::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 2%;
  height: 46%;
  border-radius: 50%;
  background: linear-gradient(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.05));
}
.pad { padding: 16px 20px; }
.pad > p:last-child, .pad > .btns:last-child { margin-bottom: 0; }

/* status bar */
.status {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 22px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--muted);
  background: var(--bar-bg);
  border-top: 1px solid var(--border);
}

/* ---------- Notepad ---------- */
.menu {
  display: flex;
  padding: 2px 4px;
  font-size: 12px;
  background: var(--bar-bg);
  border-bottom: 1px solid var(--soft);
}
.menu span { padding: 1px 9px; border: 1px solid transparent; border-radius: 2px; cursor: default; }
.menu span:hover { background: var(--sel); border-color: var(--accent); }
.paper {
  flex: 1;
  background: var(--paper);
  line-height: 1.6;
  -webkit-user-select: text;
  user-select: text;
}
.mono { font-family: var(--mono); font-size: 13px; }

/* ---------- Explorer ---------- */
.addr {
  margin: 8px 10px 0;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text);
  background: linear-gradient(#fbfdff, var(--bar-bg));
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: inset 0 1px 2px rgba(0, 60, 100, 0.15);
}
@media (prefers-color-scheme: dark) { .addr { background: linear-gradient(#192b38, var(--bar-bg)); } }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px 10px;
  text-align: center;
  font-size: 13px;
  line-height: 1.3;
  border: 1px solid transparent;
  border-radius: 3px;
}
.tile:hover { background: var(--sel); border-color: var(--accent); border-radius: 2px; }
.tile img { width: 48px; height: 48px; object-fit: contain; }
.badge {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font: 700 18px/1 var(--font);
  font-style: normal;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 30, 70, 0.8);
  border: 1px solid rgba(0, 50, 110, 0.6);
  border-radius: 12px;
  background: linear-gradient(rgba(255, 255, 255, 0.3) 0 45%, transparent 45%), linear-gradient(#2a8fd8, #06509c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 4px rgba(0, 40, 80, 0.3);
}

/* ---------- Control Panel ---------- */
.cp h2 { margin: 0 0 8px; font: 300 22px/1.3 var(--font); color: var(--heading); }
.cp dl { margin: 0; }
.cp dt { margin-top: 14px; font-size: 15px; color: var(--link); }
.cp dt::before { content: "\25B8\00a0"; color: var(--accent); }
.cp dd { margin: 0 0 0 20px; font-size: 13px; color: var(--muted); }

/* ---------- PowerShell ---------- */
.win.dark-win { height: 420px; } /* fixed size; .maxed and the phone rules still win */
.dark-win .body { background: #0c0c0c; color: #cccccc; overflow: hidden; } /* .term scrolls, not the body */
.term {
  background: #0c0c0c;
  color: #cccccc;
  line-height: 1.45;
  -webkit-user-select: text;
  user-select: text;
}
.dark-win .term {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none; /* hidden, still scrolls (wheel, touch, keys, script) */
}
.dark-win .term::-webkit-scrollbar { display: none; }
.term p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.term b { color: #61d6d6; font-weight: 700; }
.term .dim { color: #9a9a9a; }
.term a { color: #4db8ff; text-decoration: underline; }
.term a:hover { color: #9fdcff; }
.term .prompt { display: flex; align-items: baseline; white-space: pre; }
.term .prompt > span:first-child { flex: none; }
.cursor {
  display: inline-block;
  flex: none;
  width: 0.6em;
  height: 1.05em;
  vertical-align: text-bottom;
  background: #cccccc;
  pointer-events: none;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.term .prompt:focus-within .cursor { visibility: hidden; } /* keeps its width, so the text never shifts */
.term input.cmd {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: inherit;
  font: inherit;
  caret-color: #cccccc;
  -webkit-appearance: none;
  appearance: none;
}

/* ---------- Compose ---------- */
.fields { padding: 4px 14px; background: var(--bar-bg); border-bottom: 1px solid var(--border); }
.fields > div { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--soft); }
.fields > div:last-child { border-bottom: 0; }
.fields label { flex: none; width: 58px; font-size: 13px; color: var(--muted); }

/* ---------- Misc content ---------- */
.dim { color: var(--muted); }
.video { display: block; flex: none; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; background: #000; }

/* ---------- Start menu ---------- */
#start {
  position: fixed;
  z-index: 99;
  left: 4px;
  bottom: 40px;
  width: 300px;
  padding: 8px 8px 0;
  -webkit-user-select: none;
  user-select: none;
  background: var(--frame);
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
#start ul {
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--body);
  border: 1px solid var(--border);
  border-radius: 5px;
}
#start li button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  text-align: left;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
}
#start li button img { width: 32px; height: 32px; object-fit: contain; }
#start li button:hover,
#start li button:focus-visible {
  outline: none;
  background: linear-gradient(rgba(255, 255, 255, 0.5) 0 46%, transparent 46%), var(--sel);
  border-color: var(--accent);
}
#start .links { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 8px 12px 76px; }
#start .links a { font-size: 13px; color: var(--title); text-shadow: 0 0 6px var(--title-glow); }
#start .links a:hover { text-decoration: none; }

/* ---------- Taskbar ---------- */
#taskbar {
  position: fixed;
  z-index: 100;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  display: flex;
  align-items: center;
  -webkit-user-select: none;
  user-select: none;
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  background:
    linear-gradient(rgba(255, 255, 255, 0.22) 0 50%, transparent 50%),
    linear-gradient(var(--tb-top), var(--tb-bot));
  box-shadow: 0 -2px 10px rgba(0, 30, 60, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
#orb {
  position: relative;
  z-index: 2;
  flex: none;
  align-self: center;
  width: 48px;
  height: 48px;
  margin: 0 2px 0 4px;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 50%;
}
#orb img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(80, 200, 255, 0.55));
  transition: filter 0.15s;
}
#orb:hover img,
#orb[aria-expanded="true"] img { filter: brightness(1.12) drop-shadow(0 0 9px rgba(120, 225, 255, 0.95)); }
#orb:focus-visible { outline: 2px solid #fff; outline-offset: -8px; }

.pins { flex: none; display: flex; align-items: center; gap: 4px; margin-left: 4px; }
.pin, .task {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: linear-gradient(rgba(255, 255, 255, 0.2) 0 48%, rgba(255, 255, 255, 0.05) 50%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: background 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.pin { width: 44px; }
.pin img { width: 28px; height: 28px; object-fit: contain; }
.pin:hover, .task:hover {
  border-color: rgba(130, 230, 255, 0.95);
  box-shadow: 0 0 8px rgba(77, 200, 255, 0.85), inset 0 0 10px rgba(120, 225, 255, 0.5);
}
/* dead pins (no window, no link): plain cursor, no glow */
.pin:not([data-open]):not([href]) { cursor: default; }
.pin:not([data-open]):not([href]):hover {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.pin.active, .task.active {
  border-color: rgba(255, 255, 255, 0.65);
  background: linear-gradient(rgba(255, 255, 255, 0.42) 0 48%, rgba(255, 255, 255, 0.2) 50%);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.4);
}
.pin:focus-visible, .task:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

#tasks { flex: 1; min-width: 0; display: flex; gap: 4px; margin-left: 6px; overflow: hidden; }
.task {
  flex: 0 1 168px;
  min-width: 0;
  justify-content: flex-start;
  gap: 6px;
  padding: 0 8px;
  color: #fff;
  font: 12px/1 var(--font);
  text-shadow: 0 1px 2px rgba(0, 20, 50, 0.85);
}
.task img { width: 20px; height: 20px; flex: none; object-fit: contain; }
.task span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.tray {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 0 12px 0 10px;
  color: #fff;
  font-size: 12px;
  text-shadow: 0 1px 2px rgba(0, 20, 50, 0.85);
  border-left: 1px solid rgba(255, 255, 255, 0.28);
}
.tray span { font-size: 11px; font-weight: 600; letter-spacing: 0.03em; }
#clock { display: block; text-align: center; font-size: 12px; line-height: 1.25; white-space: nowrap; }

/* ---------- Phones ---------- */
@media (max-width: 700px) {
  #gadgets { display: none; }
  #icons {
    right: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 2px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
  }
  .dicon { width: auto; }
  .win {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 40px !important;
    width: 100% !important;
    max-width: 100%;
    max-height: calc(100vh - 40px);
    border-radius: 0;
  }
  .win.maxed { top: 0 !important; height: auto !important; max-height: none; }
  .bar { cursor: default; border-radius: 0; }
  .pin { width: 36px; }
  .pin[tabindex="-1"] { display: none; }
  .pins { gap: 2px; margin-left: 0; }
  .task { flex: 0 1 44px; justify-content: center; padding: 0; }
  .task span { display: none; }
  .tray { padding: 0 8px 0 6px; gap: 6px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
