/* The shell: desktop, windows, taskbar, menus and the standard controls.
   Colours are variables so Display Properties can swap the scheme at runtime. */
/* A pixel rebuild of MS Sans Serif, as converted by 98.css; see THIRD-PARTY.txt. */
@font-face { font-family: "Pixelated MS Sans Serif"; src: url(../fonts/ms_sans_serif.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pixelated MS Sans Serif"; src: url(../fonts/ms_sans_serif_bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
:root {
  color-scheme: light;
  --desktop: #008080;
  --pattern: none;
  --wallpaper: none;
  --face: #c0c0c0;
  --light: #dfdfdf;
  --hilite: #ffffff;
  --shadow: #808080;
  --dark: #0a0a0a;
  --ink: #000000;
  --title: #000080;
  --title-off: #808080;
  --title-ink: #ffffff;
  --title-ink-off: #c0c0c0;
  --select: #000080;
  --select-ink: #ffffff;
  --paper: #ffffff;
  --tip: #ffffe1;
  --link: #0000ff;

  --font-ui: "Pixelated MS Sans Serif", Tahoma, "MS Sans Serif", "Microsoft Sans Serif", "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-pixel: "DotGothic16", "MS Gothic", "Osaka", monospace;
  --font-dos: "VT323", "Lucida Console", "Courier New", monospace;

  --raised: inset -1px -1px var(--dark), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px var(--hilite);
  --raised-btn: inset -1px -1px var(--dark), inset 1px 1px var(--hilite), inset -2px -2px var(--shadow), inset 2px 2px var(--light);
  --sunken: inset -1px -1px var(--hilite), inset 1px 1px var(--shadow), inset -2px -2px var(--light), inset 2px 2px var(--dark);
  --thin-in: inset 1px 1px var(--shadow), inset -1px -1px var(--hilite);
  --thin-out: inset -1px -1px var(--shadow), inset 1px 1px var(--hilite);
  --etched: inset -1px -1px var(--hilite), inset 1px 1px var(--shadow), inset -2px -2px var(--shadow), inset 2px 2px var(--hilite);
  --tb-h: 32px;

  --arrow: url(../img/cursors/arrow.svg) 0 0, default;
  --ibeam: url(../img/cursors/ibeam.svg) 3 8, text;
  --busy: url(../img/cursors/busy.svg) 0 0, progress;
  --wait: url(../img/cursors/wait.svg) 6 10, wait;
  --ns: url(../img/cursors/ns.svg) 4 9, ns-resize;
  --ew: url(../img/cursors/ew.svg) 9 4, ew-resize;
  --nwse: url(../img/cursors/nwse.svg) 7 7, nwse-resize;
  --nesw: url(../img/cursors/nesw.svg) 7 7, nesw-resize;
  --move: url(../img/cursors/move.svg) 9 9, move;
  --help: url(../img/cursors/help.svg) 0 0, help;
  --cross: url(../img/cursors/cross.svg) 9 9, crosshair;
  --pen: url(../img/cursors/pen.svg) 0 17, default;
  --no: url(../img/cursors/no.svg) 10 10, not-allowed;
  --up: url(../img/cursors/up.svg) 4 0, default;
  --hand: url(../img/cursors/hand.svg) 5 0, pointer;
}
html { cursor: var(--arrow); }
a:any-link { cursor: var(--hand); }
/* Firefox gives form controls their own cursor: default, which skips the inherited arrow */
button, select, input { cursor: var(--arrow); }
input:not([type=checkbox], [type=radio], [type=range], [type=button], [type=submit]), textarea, [contenteditable] { cursor: var(--ibeam); }
body.busy, body.busy * { cursor: var(--busy) !important; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; }
input, textarea, [contenteditable] { user-select: text; -webkit-user-select: text; }
html { background: var(--desktop); }
body {
  margin: 0;
  background: var(--desktop);
  color: var(--ink);
  font: 11px/1.35 var(--font-ui);
  user-select: none; -webkit-user-select: none; /* UI chrome isn't text; reading panes opt back in with user-select: text */
  -webkit-font-smoothing: none;
  font-smooth: never;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
svg { display: block; }
button { font: inherit; color: inherit; }
a { color: var(--link); }
:focus { outline: none; }
:focus-visible { outline: 1px dotted var(--ink); outline-offset: -4px; }
.win:focus-visible { outline: none; } /* windows show focus by their title bar, never a focus rect */
:is(input, textarea).field:focus-visible { outline: none; } /* text boxes show focus by their caret */
.noscript { position: fixed; inset: 0; display: grid; place-items: center; color: #fff; padding: 16px; text-align: center; }

/* ---------- scrollbars ---------- */
* { scrollbar-color: var(--face) var(--light); }
@supports selector(::-webkit-scrollbar) {
  * { scrollbar-color: auto; }
  ::-webkit-scrollbar { width: 16px; height: 16px; }
  ::-webkit-scrollbar-track { background: repeating-conic-gradient(var(--face) 0 25%, var(--hilite) 0 50%) 0 0 / 2px 2px; }
  ::-webkit-scrollbar-thumb { background: var(--face); box-shadow: var(--raised); }
  ::-webkit-scrollbar-corner { background: var(--face); }
  ::-webkit-scrollbar-button { display: block; width: 16px; height: 16px; background-color: var(--face); box-shadow: var(--raised); background-repeat: no-repeat; background-position: center; }
  ::-webkit-scrollbar-button:active { box-shadow: inset 0 0 0 1px var(--shadow); }
  ::-webkit-scrollbar-button:vertical:start:increment, ::-webkit-scrollbar-button:vertical:end:decrement,
  ::-webkit-scrollbar-button:horizontal:start:increment, ::-webkit-scrollbar-button:horizontal:end:decrement { display: none; }
  ::-webkit-scrollbar-button:vertical:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='4' shape-rendering='crispEdges'%3E%3Cpath d='M3 0h1v1h1v1h1v1h1v1H0V3h1V2h1V1h1z'/%3E%3C/svg%3E"); }
  ::-webkit-scrollbar-button:vertical:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='4' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h7v1H6v1H5v1H4v1H3V3H2V2H1V1H0z'/%3E%3C/svg%3E"); }
  ::-webkit-scrollbar-button:horizontal:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='7' shape-rendering='crispEdges'%3E%3Cpath d='M3 0h1v7H3V6H2V5H1V4H0V3h1V2h1V1h1z'/%3E%3C/svg%3E"); }
  ::-webkit-scrollbar-button:horizontal:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='7' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h1v1h1v1h1v1H3v1H2v1H1v1H0z'/%3E%3C/svg%3E"); }
}

/* ---------- desktop ---------- */
.desktop {
  position: fixed; inset: 0 0 calc(var(--tb-h) + env(safe-area-inset-bottom, 0px)) 0;
  background-color: var(--desktop);
  background-image: var(--wallpaper), var(--pattern);
  background-size: var(--wallpaper-size, cover), auto;
  background-position: center, 0 0;
  background-repeat: var(--wallpaper-repeat, no-repeat), repeat;
  image-rendering: pixelated;
  overflow: hidden;
}
/* Fewer colours: only the wallpaper layer is filtered, so windows don't pay for it. */
[data-depth="16"] .desktop::before, [data-depth="256"] .desktop::before,
.dp-screen[data-depth="16"]::before, .dp-screen[data-depth="256"]::before {
  content: ''; position: absolute; inset: 0; background: inherit; filter: url(#f-16);
}
[data-depth="256"] .desktop::before, .dp-screen[data-depth="256"]::before { filter: url(#f-256); }
.icons { position: absolute; inset: 0; }
.icon {
  position: absolute; width: 86px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 2px 0; border: 0; background: none; cursor: var(--arrow);
  color: #fff; text-align: center; font-size: 12px; line-height: 1.2;
  touch-action: none;
}
.icon svg, .icon img { width: 32px; height: 32px; }
.icon span { padding: 1px 2px; max-width: 86px; overflow-wrap: break-word; background: var(--desktop); }
.icon.sel svg { filter: brightness(.55) sepia(1) hue-rotate(185deg) saturate(5); }
.icon.sel span { background: var(--select); color: var(--select-ink); }
.icon:focus-visible { outline: none; }
.icon:focus-visible span { outline: 1px dotted #fff; outline-offset: 0; }
.icon.ghost { opacity: .6; pointer-events: none; z-index: 5; }
.icon .lnk { position: absolute; left: 22px; top: 23px; width: 11px; height: 11px; background: #fff; box-shadow: inset 0 0 0 1px #000; }
.icon .lnk::after { content: ""; position: absolute; inset: 2px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Cpath d='M3 0h4v4H6V2H5v1H4v1H3v1H2v1H0V5h1V4h1V3h1V2h1V1H3z'/%3E%3C/svg%3E") no-repeat; }

.windows { position: absolute; inset: 0; pointer-events: none; }
/* 98's Channel Bar (js/desktop.js): a column of channel buttons at the top right of the desktop */
.channelbar { position: absolute; top: 12px; right: 12px; width: 132px; display: flex; flex-direction: column; gap: 3px; padding: 4px; background: #0008; border: 1px solid #fff6; border-radius: 4px; }
.ch-head { color: #fff; font-weight: bold; text-align: center; padding: 2px 0 4px; }
.ch-btn { height: 26px; border: 1px solid #0006; border-radius: 3px; color: #fff; font: bold 11px var(--font-ui); text-shadow: 1px 1px #0008; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: var(--arrow); }
.ch-btn:hover { filter: brightness(1.15); }
.ch-btn.c1 { background: linear-gradient(#ff5c8a, #b0003a); }
.ch-btn.c2 { background: linear-gradient(#5aa0ff, #0b3fa8); }
.ch-btn.c3 { background: linear-gradient(#7ad35a, #1d7a10); }
.ch-btn.c4 { background: linear-gradient(#ffb347, #b85f00); }
.ch-btn.c5 { background: linear-gradient(#b67cff, #5410a8); }
.ch-btn.c6 { background: linear-gradient(#4fd9d9, #00707a); }
@media (max-width: 640px) { .channelbar { display: none; } }
.windows > * { pointer-events: auto; }

/* ---------- window chrome ---------- */
.win {
  position: absolute;
  display: flex; flex-direction: column;
  background: var(--face);
  box-shadow: var(--raised);
  padding: 3px;
  min-width: 120px;
}
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; }
.win.max .resize { display: none; }
.win.min { display: none; }
.win.zooming { opacity: 0; }
.zoom-caption { position: fixed; z-index: 100000; pointer-events: none; background: var(--title); }
.titlebar {
  display: flex; align-items: center; gap: 3px;
  background: var(--title-off); color: var(--title-ink-off);
  padding: 2px 2px 2px 3px; height: 18px; flex: none;
  touch-action: none; user-select: none;
}
.win.active > .titlebar { background: var(--title); color: var(--title-ink); }
.titlebar > svg { width: 16px; height: 16px; flex: none; }
.titlebar .t { font-weight: bold; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; font-size: 11px; }
.tbtns { display: flex; flex: none; }
.tbtn {
  width: 16px; height: 14px; padding: 0;
  background: var(--face); box-shadow: var(--raised-btn); border: 0;
  display: grid; place-items: center; cursor: var(--arrow); color: var(--ink);
}
.tbtn:active:not(:disabled) { box-shadow: var(--sunken); }
.tbtn:active:not(:disabled) svg { transform: translate(1px, 1px); }
.tbtn:disabled { color: var(--shadow); }
.tbtn:disabled svg { filter: drop-shadow(1px 1px 0 var(--hilite)); }
.tbtn svg { width: 8px; height: 8px; fill: currentColor; }
.tbtn.x { margin-left: 2px; }
.tbtn.help { font: bold 11px/1 var(--font-ui); }
.win-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.win.autosize .win-body { flex: none; }
.resize { position: absolute; z-index: 2; touch-action: none; }
.resize.n { top: -2px; left: 6px; right: 6px; height: 5px; cursor: var(--ns); }
.resize.s { bottom: -2px; left: 6px; right: 6px; height: 5px; cursor: var(--ns); }
.resize.e { right: -2px; top: 6px; bottom: 6px; width: 5px; cursor: var(--ew); }
.resize.w { left: -2px; top: 6px; bottom: 6px; width: 5px; cursor: var(--ew); }
.resize.ne { right: -2px; top: -2px; width: 10px; height: 10px; cursor: var(--nesw); }
.resize.sw { left: -2px; bottom: -2px; width: 10px; height: 10px; cursor: var(--nesw); }
.resize.nw { left: -2px; top: -2px; width: 10px; height: 10px; cursor: var(--nwse); }
.resize.se { right: -2px; bottom: -2px; width: 12px; height: 12px; cursor: var(--nwse); }

/* The drag rectangle: a dithered frame inverted over whatever is underneath,
   like Win95 with "Show window contents while dragging" turned off. */
.drag-outline.snap { padding: 6px; }
/* From XP on the window drags itself; the top-edge maximize shows as a translucent frame. */
.snap-preview { position: fixed; z-index: 99999; pointer-events: none; box-sizing: border-box; border: 1px solid rgba(255, 255, 255, .7); border-radius: 6px; background: rgba(160, 200, 255, .3); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }
.marquee { position: fixed; z-index: 100000; pointer-events: none; border: 1px dotted #fff; mix-blend-mode: difference; }
.drag-outline {
  position: fixed; z-index: 100000; pointer-events: none;
  padding: 4px;
  background: repeating-conic-gradient(#fff 0 25%, transparent 0 50%) 0 0 / 2px 2px;
  mix-blend-mode: difference;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
body.dragging, body.dragging * { cursor: inherit; }
body.dragging iframe { pointer-events: none; }

.statusbar { display: flex; gap: 2px; padding-top: 2px; flex: none; }
.statusbar > span, .statusbar > div { box-shadow: var(--thin-in); padding: 1px 4px; height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.statusbar > :first-child { flex: 1; min-width: 0; }
.statusbar svg { width: 16px; height: 16px; flex: none; }
.grip { width: 14px; flex: none; box-shadow: none !important; padding: 0 !important; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' shape-rendering='crispEdges'%3E%3Cpath fill='%23fff' d='M10 0h1v1h-1zM9 1h1v1H9zM8 2h1v1H8zM7 3h1v1H7zM6 4h1v1H6zM5 5h1v1H5zM4 6h1v1H4zM3 7h1v1H3zM2 8h1v1H2zM1 9h1v1H1zM0 10h1v1H0zM10 4h1v1h-1zM9 5h1v1H9zM8 6h1v1H8zM7 7h1v1H7zM6 8h1v1H6zM5 9h1v1H5zM4 10h1v1H4zM10 8h1v1h-1zM9 9h1v1H9zM8 10h1v1H8z'/%3E%3Cpath fill='%23808080' d='M11 0h1v2h-1zM10 1h1v1h-1zM9 2h2v1H9zM8 3h2v1H8zM7 4h2v1H7zM6 5h2v1H6zM5 6h2v1H5zM4 7h2v1H4zM3 8h2v1H3zM2 9h2v1H2zM1 10h2v1H1zM11 4h1v2h-1zM10 5h1v1h-1zM9 6h2v1H9zM8 7h2v1H8zM7 8h2v1H7zM6 9h2v1H6zM5 10h2v1H5zM11 8h1v2h-1zM10 9h1v1h-1zM9 10h2v1H9z'/%3E%3C/svg%3E") no-repeat right bottom; }

/* ---------- menus ---------- */
.menubar { display: flex; flex-wrap: wrap; padding: 1px 0; flex: none; }
.menubar > button {
  border: 0; background: none; padding: 1px 6px 2px; cursor: var(--arrow); color: var(--ink);
}
.menubar > button.open { box-shadow: var(--thin-in); padding: 2px 5px 1px 7px; }
.menubar > button:focus-visible { outline: 1px dotted var(--ink); outline-offset: -2px; }

.menu {
  position: fixed; z-index: 50000;
  background: var(--face); box-shadow: var(--raised);
  padding: 3px; min-width: 120px; margin: 0; list-style: none;
  user-select: none;
}
.menu-items { list-style: none; margin: 0; padding: 0; }
.menu li { display: block; }
.menu .mi {
  display: grid; grid-template-columns: 18px 1fr auto 14px; align-items: center;
  width: 100%; border: 0; background: none; text-align: left; cursor: var(--arrow);
  padding: 2px 4px 3px 2px; white-space: nowrap; color: var(--ink); gap: 4px; text-decoration: none;
}
.menu .mi .ic { width: 16px; height: 16px; display: grid; place-items: center; }
.menu .mi .ic svg, .menu .mi .ic img { width: 16px; height: 16px; }
.menu .mi .key { padding-left: 20px; }
.menu .mi .sub { width: 4px; height: 7px; justify-self: end; margin-right: 2px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.menu .mi.hot { background: var(--select); color: var(--select-ink); }
.menu .mi[aria-disabled="true"] { color: var(--shadow); text-shadow: 1px 1px var(--hilite); }
.menu .mi[aria-disabled="true"].hot { background: var(--select); color: var(--shadow); text-shadow: none; }
.menu .mi .chk { width: 7px; height: 7px; background: currentColor; justify-self: center; }
.menu .mi .chk.tick { clip-path: polygon(0 40%, 30% 70%, 100% 0, 100% 30%, 30% 100%, 0 70%); }
.menu .mi .chk.dot { width: 6px; height: 6px; border-radius: 50%; }
.menu hr { border: 0; height: 2px; margin: 3px 1px; box-shadow: inset 0 1px var(--shadow), inset 0 -1px var(--hilite); }

/* start menu: the banner down the side, big icons */
.menu.startmenu { display: flex; padding: 3px; min-width: 0; }
.startmenu .side {
  width: 21px; flex: none;
  background: var(--shadow);
  color: var(--face);
  writing-mode: vertical-rl; transform: rotate(180deg);
  font: bold 18px/21px var(--font-ui); padding: 6px 0; letter-spacing: .02em; white-space: nowrap;
}
.startmenu .side b { color: var(--hilite); font-weight: 900; }
.startmenu ul { list-style: none; margin: 0; padding: 0; min-width: 170px; }
.startmenu .mi { grid-template-columns: 30px 1fr auto 14px; padding: 3px 4px 3px 4px; min-height: 32px; gap: 6px; }
.startmenu .mi .ic { width: 26px; height: 26px; }
.startmenu .mi .ic svg { width: 24px; height: 24px; }
.startmenu .mi .ic img { width: 26px; height: 26px; box-shadow: var(--thin-in); image-rendering: auto; }
.startmenu .mi.account { min-height: 40px; }
.startmenu .mi.account .ic { width: 30px; height: 30px; }
.startmenu .mi.account .ic img { width: 30px; height: 30px; }
.startmenu .mi.account small { display: block; font-size: 11px; opacity: .8; }

/* ---------- taskbar ---------- */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40000;
  height: calc(var(--tb-h) + env(safe-area-inset-bottom, 0px));
  background: var(--face);
  box-shadow: inset 0 1px var(--light), inset 0 2px var(--hilite);
  padding: 4px 2px calc(2px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 4px; align-items: stretch;
}
.taskbar .start {
  display: flex; align-items: center; gap: 3px;
  font-weight: bold; padding: 2px 5px 2px 4px;
  background: var(--face); box-shadow: var(--raised-btn); border: 0; cursor: var(--arrow); color: var(--ink);
}
.taskbar .start[aria-expanded="true"] { box-shadow: var(--sunken); padding: 3px 4px 1px 5px; }
.taskbar .start[aria-expanded="true"] span { outline: 1px dotted var(--ink); }
.taskbar .start svg { width: 20px; height: 18px; }
.quick { display: flex; align-items: center; gap: 1px; padding: 0 4px 0 6px; flex: none; box-shadow: inset 1px 0 var(--shadow), inset 2px 0 var(--hilite), inset -1px 0 var(--shadow), inset -2px 0 var(--hilite); }
.quick:empty { display: none; }
.quick button { touch-action: none; width: 22px; height: 22px; padding: 0; border: 0; background: var(--face); display: grid; place-items: center; cursor: var(--arrow); }
.quick button:hover { box-shadow: inset 1px 1px var(--hilite), inset -1px -1px var(--shadow); }
.quick button:active { box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--hilite); }
.quick svg { width: 16px; height: 16px; }
.tasks { flex: 1; min-width: 0; display: flex; gap: 3px; overflow: hidden; }
.task {
  flex: 0 1 160px; min-width: 0;
  display: flex; align-items: center; gap: 4px; padding: 0 5px;
  background: var(--face); box-shadow: var(--raised-btn); color: var(--ink); border: 0; cursor: var(--arrow);
  white-space: nowrap; text-align: left;
}
.task svg { width: 16px; height: 16px; flex: none; }
.task span { overflow: hidden; text-overflow: ellipsis; }
.task.on { box-shadow: var(--sunken); background: repeating-conic-gradient(var(--face) 0 25%, var(--hilite) 0 50%) 0 0 / 2px 2px; font-weight: bold; padding: 1px 4px 0 6px; }
.tray {
  padding: 0 8px 0 6px; display: flex; align-items: center; gap: 6px; flex: none;
  box-shadow: var(--thin-in);
  font-variant-numeric: tabular-nums; white-space: nowrap; cursor: var(--arrow);
}
.tray svg { width: 16px; height: 16px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 75px; height: 23px; padding: 0 10px;
  background: var(--face); box-shadow: var(--raised-btn);
  color: var(--ink); text-decoration: none; border: 0; cursor: var(--arrow); white-space: nowrap;
}
.btn.default { box-shadow: inset 0 0 0 1px var(--dark), inset -2px -2px var(--dark), inset 2px 2px var(--hilite), inset -3px -3px var(--shadow), inset 3px 3px var(--light); }
.btn:active:not(:disabled) { box-shadow: inset 0 0 0 1px var(--dark), inset 1px 1px 0 1px var(--shadow); padding: 1px 9px 0 11px; }
.btn:focus-visible { outline: 1px dotted var(--ink); outline-offset: -5px; }
.btn:disabled { color: var(--shadow); text-shadow: 1px 1px var(--hilite); }
.btn svg { width: 16px; height: 16px; margin-right: 6px; }
.btn u, .mi u, .menubar u, label u { text-decoration: underline; }

.field, input.field, select.field, textarea.field {
  background: var(--paper); box-shadow: var(--sunken); border: 0;
  font: inherit; color: var(--ink); padding: 3px 4px; height: 21px; border-radius: 0;
}
textarea.field { height: auto; resize: none; }
select.field { appearance: none; -webkit-appearance: none; padding-right: 20px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' shape-rendering='crispEdges'%3E%3Cpath fill='%23c0c0c0' d='M0 0h16v17H0z'/%3E%3Cpath fill='%23fff' d='M1 1h14v1H1zM1 1h1v14H1z'/%3E%3Cpath fill='%23808080' d='M1 15h14v1H1zM14 1h1v15h-1z'/%3E%3Cpath fill='%23000' d='M0 16h16v1H0zM15 0h1v17h-1zM4 7h7v1H4zM5 8h5v1H5zM6 9h3v1H6zM7 10h1v1H7z'/%3E%3C/svg%3E") no-repeat right 2px center; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); margin: 0 6px 0 0; }
.group {
  border: 0; margin: 0; padding: 12px 10px 10px;
  box-shadow: var(--etched); min-width: 0;
}
.group > legend { padding: 0 3px; margin-left: -3px; background: var(--face); }
.listbox { background: var(--paper); box-shadow: var(--sunken); padding: 2px; overflow: auto; }
.listbox .opt { padding: 1px 3px; cursor: var(--arrow); white-space: nowrap; }
.listbox .opt.sel { background: var(--select); color: var(--select-ink); }
.listbox:focus-visible .opt.sel { outline: 1px dotted #fff; outline-offset: -1px; }

.tabs { display: flex; padding-left: 2px; position: relative; z-index: 1; }
.tabs button {
  border: 0; background: var(--face); padding: 3px 8px 2px; cursor: var(--arrow); margin-top: 2px;
  box-shadow: inset 1px 1px var(--hilite), inset -1px 0 var(--dark), inset -2px 0 var(--shadow), inset 2px 2px var(--light);
  border-radius: 3px 3px 0 0;
}
.tabs button[aria-selected="true"] { margin: 0 -2px -1px; padding: 4px 10px 4px; z-index: 1; }
.tabs button:focus-visible { outline: 1px dotted var(--ink); outline-offset: -4px; }
.tabpanel { box-shadow: var(--raised); padding: 12px; background: var(--face); flex: 1; min-height: 0; }

/* dialogs */
.dlg { padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 12px; }
.dlg .row { display: flex; gap: 12px; align-items: flex-start; }
.dlg .row > svg { width: 32px; height: 32px; flex: none; }
.dlg .msg { padding-top: 6px; max-width: 360px; white-space: pre-line; }
.dlg .btns { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.dlg .btns.right { justify-content: flex-end; }

/* Night light and brightness (desktop.js applyQS) */
.tint { position: fixed; inset: 0; z-index: 89999; pointer-events: none; mix-blend-mode: multiply; }

/* ---------- boot & shutdown ---------- */
.screen { position: fixed; inset: 0; z-index: 90000; }
.screen.post { background: #000; color: #aaa; font: 20px/1.2 var(--font-dos); padding: 16px; }
/* Boot screens, one look per era (desktop.js bootParts) */
.screen.splash { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; background: #000; color: #fff; cursor: var(--wait); }
.splash .skip { position: absolute; top: 16px; font: 12px Arial, sans-serif; opacity: .55; }
.splash .copy { position: absolute; bottom: 24px; font: 12px Arial, sans-serif; }
.screen.splash.b-9x {
  gap: 0;
  background:
    radial-gradient(ellipse 18% 9% at 18% 22%, #fff 0 60%, transparent 100%),
    radial-gradient(ellipse 12% 7% at 26% 25%, #f4f8ff 0 55%, transparent 100%),
    radial-gradient(ellipse 22% 10% at 78% 18%, #fff 0 55%, transparent 100%),
    radial-gradient(ellipse 14% 7% at 70% 24%, #eef4ff 0 55%, transparent 100%),
    radial-gradient(ellipse 25% 10% at 30% 78%, #fff 0 55%, transparent 100%),
    radial-gradient(ellipse 18% 8% at 84% 72%, #fff 0 55%, transparent 100%),
    radial-gradient(ellipse 12% 6% at 60% 86%, #f4f8ff 0 55%, transparent 100%),
    linear-gradient(#3a6ee8, #79a6f6 60%, #9cc0fa);
  color: #000;
}
.splash .logo { display: flex; align-items: center; gap: 18px; }
.splash .logo svg { width: 120px; height: 108px; filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, .25)); }
.splash .word { font: italic 900 22px/1 Arial, sans-serif; letter-spacing: -.01em; }
.splash .word small { display: block; font: italic bold 15px/1.4 Arial, sans-serif; }
.splash .word b { display: block; font: bold 64px/0.95 "Franklin Gothic Medium", "Arial Black", Arial, sans-serif; letter-spacing: -.03em; }
.splash .word b sup { font-size: 34px; vertical-align: top; color: #c00000; margin-left: 4px; }

/* 1.0 and 2.0: a ruled box on white */
.splash.b-1 { background: #fff; color: #000; }
.splash.b-1 .box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 48px; border: 3px double #000; box-shadow: 6px 6px 0 #0000aa; background: #fff; font: 20px var(--font-pixel); }
.splash.b-1 .box b { font: bold 44px/1 var(--font-pixel); letter-spacing: .08em; padding: 4px 18px; color: #fff; background: #0000aa; }
.splash.b-1 .skip { font: 16px var(--font-pixel); }
.splash.b-1 .copy { font: 16px var(--font-pixel); }

/* 3.1: the flag beside the name on white, the copyright under it */
.splash.b-3 { background: #fff; color: #000; }
.splash.b-3 .logo svg { width: 132px; height: 118px; filter: none; }
.splash.b-3 .word b { font: bold 58px/1 "Times New Roman", serif; letter-spacing: -.02em; }
.splash.b-3 .word i { display: block; margin-top: 8px; font: italic 22px "Times New Roman", serif; }
.splash.b-3 .copy { position: static; font: 13px "Pixelated MS Sans Serif", Arial, sans-serif; }

/* 2000: a white band with the logo over black, then a blue block bar */
.splash.b-2000 { gap: 14px; }
.splash.b-2000 .band { display: flex; align-items: center; gap: 22px; padding: 26px 56px; width: min(560px, calc(100vw - 32px)); box-sizing: border-box;
  background: linear-gradient(#fff 70%, #d8e0f0); color: #000; box-shadow: 0 6px 0 #1a3e9c, 0 10px 0 #5c80d8; }
.splash.b-2000 .band svg { width: 76px; height: 68px; flex: none; }
.splash.b-2000 .word b { font: bold 40px/1 Arial, sans-serif; }
.splash.b-2000 .word b sup { color: #000; font-size: 40px; vertical-align: baseline; margin-left: 8px; }
.splash.b-2000 .word span { display: block; font: bold 18px Arial, sans-serif; color: #1a3e9c; }
.splash.b-2000 .word small { display: block; margin-top: 6px; font: 12px Arial, sans-serif; color: #555; }
.splash.b-2000 .prog { width: min(560px, calc(100vw - 32px)); height: 14px; margin-top: 18px; box-sizing: border-box; padding: 2px; border: 1px solid #888; }
.splash.b-2000 .prog i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #2c4fb8 0 9px, transparent 9px 11px); animation: fill2000 2.2s steps(24) forwards; }
.splash.b-2000 p { margin: 0; font: 12px Tahoma, "Pixelated MS Sans Serif", sans-serif; }
@keyframes fill2000 { to { width: 100%; } }

/* XP: the logo on black, three blue blocks running through a rounded track */
.splash.b-xp { gap: 40px; }
.splash.b-xp .logo svg { width: 92px; height: 82px; filter: drop-shadow(0 0 6px #fff3); }
.splash.b-xp .word b { font: bold 54px/1 "Franklin Gothic Medium", Arial, sans-serif; font-style: normal; }
.splash.b-xp .word b sup { color: #ff7a00; font: italic bold 28px Arial, sans-serif; }
.splash .track { position: relative; width: 120px; height: 14px; border: 2px solid #b2b2b2; border-radius: 5px; overflow: hidden; }
.splash.b-xp .track span { position: absolute; top: 2px; left: 0; display: flex; gap: 2px; animation: xpblocks 2.4s linear infinite; }
.splash.b-xp .track i { width: 8px; height: 10px; border-radius: 1px; background: linear-gradient(#2838c7, #3d5cef 30%, #8e9fff 50%, #3d5cef 70%, #2838c7); }
.splash.b-xp .copy { left: 24px; }
.splash.b-xp .maker { position: absolute; bottom: 20px; right: 28px; font: italic bold 20px Arial, sans-serif; }
@keyframes xpblocks { from { transform: translateX(-32px); } to { transform: translateX(124px); } }

/* Vista: a green glow running through a thin bar on black */
.splash.b-vista .track { width: 180px; height: 9px; border: 1px solid #555; border-radius: 3px; }
.splash.b-vista .track i { position: absolute; inset: 0; width: 70px; background: linear-gradient(90deg, transparent, #2bd34b 30%, #c8ffcf 50%, #2bd34b 70%, transparent);
  animation: vistaglow 1.6s linear infinite; }
@keyframes vistaglow { from { transform: translateX(-70px); } to { transform: translateX(180px); } }
.splash.b-vista .copy, .splash.b-7 .copy { font: 13px "Segoe UI", Arial, sans-serif; color: #ccc; }

/* 7: "Starting" under a glowing flag that brightens in */
.splash.b-7 .logo svg { width: 100px; height: 90px; animation: glow7 2.2s ease-out forwards; }
.splash.b-7 p { margin: 0; font: 18px "Segoe UI", Arial, sans-serif; letter-spacing: .02em; }
@keyframes glow7 { from { opacity: 0; transform: scale(.7); filter: blur(6px) drop-shadow(0 0 30px #fff); } 60% { opacity: 1; filter: blur(0) drop-shadow(0 0 26px #fffc); } to { opacity: 1; transform: none; filter: drop-shadow(0 0 10px #fff6); } }

/* 8, 10 and 11: the four-pane logo over a ring of orbiting dots */
.splash.b-metro { gap: 70px; }
.splash .panes { width: 110px; height: 110px; background: linear-gradient(90deg, transparent 47%, #000 47% 53%, transparent 53%), linear-gradient(transparent 47%, #000 47% 53%, transparent 53%), #00a3ef; }
[data-win="10"] .splash .panes { background-color: #0078d7; transform: perspective(300px) rotateY(-14deg); clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 92%); }
[data-win="11"] .splash .panes { width: 96px; height: 96px; background: linear-gradient(90deg, transparent 48%, #000 48% 52%, transparent 52%), linear-gradient(transparent 48%, #000 48% 52%, transparent 52%), linear-gradient(135deg, #3ccdfd, #0078d4 60%, #0050a8); }
.splash .spin { position: relative; width: 40px; height: 40px; }
.splash .spin i { position: absolute; inset: 0; opacity: 0; animation: orbit 5.5s infinite; animation-delay: calc(var(--n) * .24s); }
.splash .spin i::before { content: ""; position: absolute; top: 0; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #fff; }
@keyframes orbit {
  0% { transform: rotate(225deg); opacity: 1; animation-timing-function: ease-out; }
  7% { transform: rotate(345deg); animation-timing-function: linear; }
  30% { transform: rotate(455deg); animation-timing-function: ease-in-out; }
  39% { transform: rotate(690deg); animation-timing-function: linear; }
  70% { transform: rotate(815deg); opacity: 1; animation-timing-function: ease-out; }
  75% { transform: rotate(945deg); animation-timing-function: ease-out; }
  76%, 100% { transform: rotate(945deg); opacity: 0; }
}
/* Phones: shrink the big logos to fit */
@media (max-width: 600px) { .splash :is(.logo, .box, .band) { zoom: .55; } .splash.b-2000 .band { width: auto; } }
@media (prefers-reduced-motion: reduce) {
  .splash :is(.prog i, .track span, .track i, .logo svg, .spin i) { animation: none !important; }
  .splash .spin i, .splash.b-2000 .prog i { opacity: 1; width: 100%; }
}

.splash .bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 18px;
  background: linear-gradient(90deg, #00f, #0ff, #0f0, #ff0, #f00, #f0f, #00f) 0 0 / 50% 100%;
  animation: bar 1.2s linear infinite;
}
@keyframes bar { to { background-position: 100% 0; } }
.screen.wait { display: grid; place-items: center; background: #000; color: #fff; }
.screen.wait div { background: linear-gradient(#2c4fb8, #6e9cf0); padding: 40px 60px; font: bold 20px Arial, sans-serif; text-align: center; color: #fff; }
.screen.off { display: grid; place-items: center; background: #000; color: #ff7f00; font: bold clamp(20px, 4vw, 34px)/1.3 Arial, sans-serif; text-align: center; padding: 16px; cursor: var(--hand); }
.screen.off small { display: block; color: #555; font-size: 13px; font-weight: normal; margin-top: 30px; }
.screen.off.dos { place-items: start; color: #aaa; font: 20px/1.2 var(--font-dos); text-align: left; }
.screen.dim { position: absolute; background: repeating-conic-gradient(#000 0 25%, transparent 0 50%) 0 0 / 2px 2px; z-index: 9000; }
body.shutting .taskbar::after { content: ""; position: absolute; inset: 0; background: repeating-conic-gradient(#000 0 25%, transparent 0 50%) 0 0 / 2px 2px; }
.screen.logon { background: var(--desktop); z-index: 45000; }
@media (prefers-reduced-motion: reduce) { .splash .bar { animation: none; } }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .task { flex: 0 0 34px; justify-content: center; padding: 0; }
  .task span { display: none; }
  .task.on { padding: 1px 0 0 1px; }
  .tray svg { display: none; }
  .quick { display: none; }
  .resize { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .win.opening { animation: open .16s steps(4) both; }
  @keyframes open { from { clip-path: inset(0 100% 100% 0); } to { clip-path: inset(0 0 0 0); } }
  @keyframes fade-open { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
  :is([data-win="1.0"], [data-win="2.0"], [data-win="3.1"]) .win.opening { animation: none; }
  :is([data-win="vista"], [data-win="7"], [data-win="8"], [data-win="10"], [data-win="11"]) .win.opening { animation: fade-open .2s ease-out both; }
}
.menu .mi.bold .lbl { font-weight: bold; }

/* ---------- Taskbar Properties: auto hide, not on top, small Start menu ---------- */
.taskbar { transition: transform .15s steps(4); }
body.tb-autohide .desktop { bottom: 2px; }
body.tb-autohide .taskbar { transform: translateY(calc(100% - 3px)); }
body.tb-autohide .taskbar.peek, body.tb-autohide .taskbar:focus-within { transform: none; }
body.tb-under .desktop { bottom: 0; }
body.tb-under .taskbar { z-index: 5; }
.menu.startmenu.small .side { display: none; }
.startmenu.small .mi { grid-template-columns: 18px 1fr auto 14px; min-height: 20px; padding: 1px 4px; }
.startmenu.small .mi .ic, .startmenu.small .mi .ic svg { width: 16px; height: 16px; }
.startmenu.small .mi.account .ic, .startmenu.small .mi.account .ic img { width: 20px; height: 20px; }
.titlebar > svg.sysicon { cursor: var(--arrow); }
.tray .spk { cursor: var(--arrow); }
.tray .spk.muted { opacity: .6; }
.tray .spk.muted use { filter: none; }

/* ---------- ?app=id: one program fills the page, no desktop around it ---------- */
body.solo .desktop { inset: 0; background: var(--face); }
body.solo .icons, body.solo .taskbar { display: none; }
.win.solo-win { border: 0; padding: 0; box-shadow: none; }
.win.solo-win > .titlebar { display: none; }
body.solo .begin-hint { display: none; }

/* ---------- tooltips ---------- */
.tooltip { position: fixed; z-index: 100001; pointer-events: none; background: var(--tip); color: #000; border: 1px solid #000; padding: 1px 4px; font: 11px/1.3 var(--font-ui); white-space: nowrap; }
.begin-hint { bottom: 6px; padding: 3px 6px; font-weight: bold; }
@media (prefers-reduced-motion: no-preference) {
  .begin-hint { animation: begin 1.4s steps(14) 1s both; }
  @keyframes begin { from { clip-path: inset(0 100% 0 0); } }
}

/* Alt+Tab */
.alttab {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 100000;
  background: var(--face); box-shadow: var(--raised); padding: 12px 14px; max-width: calc(100vw - 32px);
  font: 11px var(--font-ui); color: var(--ink);
}
.alttab-icons { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.alttab-icons span { display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid transparent; }
.alttab-icons span.on { border-color: var(--ink); }
.alttab-icons svg { width: 32px; height: 32px; }
.alttab-t { margin-top: 10px; padding: 3px 6px; box-shadow: var(--sunken); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The joke blue screen from typing WIN inside Windows */
.screen.bsod {
  background: #0000aa; color: #fff; font: clamp(16px, 2.6vw, 24px)/1.25 var(--font-dos);
  padding: 12vh max(16px, 12vw) 0; outline: none; cursor: default;
}
.screen.bsod p { margin: 0 0 1.2em; white-space: pre-wrap; }
.screen.bsod p:first-child, .screen.bsod p:last-child { text-align: center; }
.screen.bsod span { background: #aaa; color: #0000aa; }
.screen.bsod i { font-style: normal; animation: blink 1s steps(1) infinite; }
.screen.bsod.sad { background: #0a5ca8; font: clamp(14px, 2vw, 20px)/1.4 var(--font-ui, sans-serif); padding: 10vh max(16px, 10vw) 0; }
.screen.bsod.sad .face { font-size: clamp(64px, 14vw, 160px); line-height: 1; margin-bottom: .2em; }
.screen.bsod.sad p { text-align: left; max-width: 34em; }
.screen.bsod.sad .qr { display: flex; gap: 16px; align-items: flex-start; max-width: 34em; }
.screen.bsod.sad canvas { width: 100px; height: 100px; image-rendering: pixelated; background: #fff; padding: 4px; flex: none; }
.screen.bsod.sad .qr p { font-size: .7em; margin: 0; }
