/* ==========================================================================
   Microsoft Windows 3.1 — window manager chrome, controls, menus & dialogs
   Rendered inside the 486 CRT at 640x480 logical pixels (CSS transform scale)
   Colour scheme lives in CSS custom properties (Control Panel -> Color).
   ========================================================================== */

.w31-root {
  --w-bg: #c0c0c0;            /* Desktop (Background) */
  --w-appws: #ffffff;         /* Application Workspace */
  --w-window: #ffffff;        /* Window background */
  --w-wintext: #000000;       /* Window text */
  --w-menu: #ffffff;          /* Menu bar / pull-downs */
  --w-menutext: #000000;
  --w-acttitle: #000080;      /* Active title bar */
  --w-inacttitle: #ffffff;    /* Inactive title bar */
  --w-titletext: #ffffff;     /* Active title text */
  --w-inacttitletext: #000000;
  --w-actborder: #c0c0c0;
  --w-inactborder: #c0c0c0;
  --w-frame: #000000;         /* Window frame lines */
  --w-scroll: #c0c0c0;
  --w-btnface: #c0c0c0;
  --w-btnshadow: #808080;
  --w-btnhilight: #ffffff;
  --w-btntext: #000000;
  --w-graytext: #808080;
  --w-hilite: #000080;
  --w-hilitetext: #ffffff;
  --w-font: "MS Sans Serif", "Microsoft Sans Serif", Tahoma, Arial, Helvetica, sans-serif;
  --w-fixed: "Px437 IBM VGA 8x16", "Fixedsys", "Lucida Console", "Courier New", monospace;
  --w-serif: "Times New Roman", "Liberation Serif", Georgia, serif;
  --w-cursor-arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='20' shape-rendering='crispEdges'><path d='M0 0h1v17h1v-1h1v-1h1v-1h1v1h1v1h1v1h1v1h1v-1h1v-1h1v-1h-1v-1h-1v-1h-1v-1h4v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1z' fill='%23000'/><path d='M1 2h1v12h1v-1h1v-1h1v1h1v1h1v1h1v1h1v-1h-1v-1h-1v-1h-1v-1h3v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1z' fill='%23fff'/></svg>") 0 0, default;
  --w-cursor-wait: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='13' height='22' shape-rendering='crispEdges'><rect x='0' y='0' width='13' height='2' fill='%23000'/><rect x='0' y='20' width='13' height='2' fill='%23000'/><path d='M1 2h11v2h-1v2h-1v2h-1v2h-1v2h1v2h1v2h1v2h1v2h-11v-2h1v-2h1v-2h1v-2h1v-2h-1v-2h-1v-2h-1v-2h-1z' fill='%23fff' stroke='%23000' stroke-width='1'/><path d='M3 4h7v1h-1v1h-1v1h-1v1h-1v-1h-1v-1h-1v-1h-1z' fill='%23000'/><path d='M6 10h1v2h1v2h1v2h1v1h-7v-1h1v-2h1v-2h1z' fill='%23000'/></svg>") 6 11, wait;
  position: absolute;
  inset: 0;
  z-index: 17;
  background: #000000;
  overflow: hidden;
  font-family: var(--w-font);
  font-size: 11px;
  line-height: 13px;
  color: #000000;
  user-select: none;
  -webkit-user-select: none;
  cursor: var(--w-cursor-arrow);
  touch-action: manipulation;
  outline: none;
}

/* faint aperture-grille so the picture still reads as a CRT */
.w31-root::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3000;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.07) 50%);
  background-size: 100% 3px;
}

@media (prefers-reduced-motion: reduce) {
  .w31-root::after {
    display: none;
  }
}

.w31-root[hidden] {
  display: none !important;
}

.w31-root *,
.w31-root *::before,
.w31-root *::after {
  box-sizing: border-box;
  cursor: inherit;
}

.w31-root.busy,
.w31-root.busy * {
  cursor: var(--w-cursor-wait) !important;
}

/* Hercules / MDA monochrome adapters */
[data-video="amber"] .w31-root {
  filter: grayscale(1) sepia(1) saturate(3.2) hue-rotate(-14deg) contrast(1.1);
}

[data-video="green"] .w31-root {
  filter: grayscale(1) sepia(1) saturate(4) hue-rotate(68deg) contrast(1.1);
}

/* The 640x480 logical screen, scaled with transform to fit the CRT */
.w31-screen {
  position: absolute;
  left: 0;
  top: 0;
  width: 640px;
  height: 480px;
  transform-origin: 0 0;
  overflow: hidden;
  background: var(--w-bg);
  image-rendering: pixelated;
  outline: none;
}

.w31-screen canvas,
.w31-screen img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.w31-desktop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: var(--w-bg);
  background-repeat: repeat;
}

.w31-desktop.wall-center {
  background-repeat: no-repeat;
  background-position: center center;
}

.w31-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  isolation: isolate;
}

.w31-tray {
  z-index: 5;
}

.w31-win-layer {
  z-index: 10;
}

.w31-popup-layer {
  z-index: 1000;
}

.w31-top-layer {
  z-index: 2000;
}

.w31-layer > * {
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Windows
   -------------------------------------------------------------------------- */

.w31-win {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--w-btnface);
  /* Sizable frame: 1px frame + 3px border + 1px frame */
  border: 1px solid var(--w-frame);
  box-shadow:
    inset 0 0 0 3px var(--w-inactborder),
    inset 0 0 0 4px var(--w-frame);
  padding: 4px;
  min-width: 100px;
  min-height: 40px;
}

.w31-win.active {
  box-shadow:
    inset 0 0 0 3px var(--w-actborder),
    inset 0 0 0 4px var(--w-frame);
}

.w31-win.fixed,
.w31-win.dialog {
  padding: 1px;
  box-shadow: none;
}

.w31-win.dialog {
  /* DS_MODALFRAME double-line look */
  border: 1px solid var(--w-frame);
  box-shadow:
    inset 0 0 0 1px var(--w-btnface),
    inset 0 0 0 2px var(--w-frame);
  padding: 3px;
}

.w31-win.maximized {
  border: 0;
  box-shadow: none;
  padding: 0;
}

.w31-win.hidden {
  display: none !important;
}

/* Corner size-handle ticks on sizable frames */
.w31-win:not(.fixed):not(.dialog):not(.maximized)::before,
.w31-win:not(.fixed):not(.dialog):not(.maximized)::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 0;
  background:
    linear-gradient(var(--w-frame), var(--w-frame)) 0 18px / 4px 1px no-repeat,
    linear-gradient(var(--w-frame), var(--w-frame)) 100% 18px / 4px 1px no-repeat,
    linear-gradient(var(--w-frame), var(--w-frame)) 0 calc(100% - 18px) / 4px 1px no-repeat,
    linear-gradient(var(--w-frame), var(--w-frame)) 100% calc(100% - 18px) / 4px 1px no-repeat,
    linear-gradient(var(--w-frame), var(--w-frame)) 18px 0 / 1px 4px no-repeat,
    linear-gradient(var(--w-frame), var(--w-frame)) calc(100% - 18px) 0 / 1px 4px no-repeat,
    linear-gradient(var(--w-frame), var(--w-frame)) 18px 100% / 1px 4px no-repeat,
    linear-gradient(var(--w-frame), var(--w-frame)) calc(100% - 18px) 100% / 1px 4px no-repeat;
}

.w31-win:not(.fixed):not(.dialog):not(.maximized)::after {
  display: none;
}

.w31-resize {
  position: absolute;
  z-index: 3;
}

.w31-resize.n { left: 0; right: 0; top: -1px; height: 5px; cursor: ns-resize; }
.w31-resize.s { left: 0; right: 0; bottom: -1px; height: 5px; cursor: ns-resize; }
.w31-resize.w { top: 0; bottom: 0; left: -1px; width: 5px; cursor: ew-resize; }
.w31-resize.e { top: 0; bottom: 0; right: -1px; width: 5px; cursor: ew-resize; }
.w31-resize.nw { left: -1px; top: -1px; width: 19px; height: 19px; cursor: nwse-resize; }
.w31-resize.se { right: -1px; bottom: -1px; width: 19px; height: 19px; cursor: nwse-resize; }
.w31-resize.ne { right: -1px; top: -1px; width: 19px; height: 19px; cursor: nesw-resize; }
.w31-resize.sw { left: -1px; bottom: -1px; width: 19px; height: 19px; cursor: nesw-resize; }

.w31-titlebar {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 18px;
  flex: 0 0 18px;
  background: var(--w-inacttitle);
  color: var(--w-inacttitletext);
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  border-bottom: 1px solid var(--w-frame);
}

.w31-win.active > .w31-titlebar,
.w31-win.dialog.active > .w31-titlebar {
  background: var(--w-acttitle);
  color: var(--w-titletext);
}

.w31-sysbox {
  flex: 0 0 18px;
  width: 18px;
  height: 17px;
  background: var(--w-btnface);
  border-right: 1px solid var(--w-frame);
  position: relative;
}

.w31-sysbox::before {
  /* the "space bar" glyph */
  content: "";
  position: absolute;
  left: 3px;
  top: 7px;
  width: 11px;
  height: 3px;
  background: var(--w-btnhilight);
  border: 1px solid var(--w-btnshadow);
  border-top-color: var(--w-btnhilight);
  border-left-color: var(--w-btnhilight);
  box-shadow: 1px 1px 0 var(--w-frame), inset 0 0 0 1px var(--w-btnshadow);
}

.w31-sysbox.mdi::before {
  left: 4px;
  width: 9px;
  height: 3px;
}

.w31-title {
  flex: 1 1 auto;
  text-align: center;
  line-height: 17px;
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.w31-capbtn {
  flex: 0 0 18px;
  width: 18px;
  height: 17px;
  background: var(--w-btnface);
  border-left: 1px solid var(--w-frame);
  position: relative;
}

.w31-capbtn::before {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow:
    inset 1px 1px 0 var(--w-btnhilight),
    inset -1px -1px 0 var(--w-btnshadow);
}

.w31-capbtn:active::before {
  box-shadow:
    inset 1px 1px 0 var(--w-btnshadow),
    inset -1px -1px 0 var(--w-btnhilight);
}

.w31-capbtn::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.w31-capbtn.min::after {
  top: 7px;
  border-top: 4px solid var(--w-btntext);
}

.w31-capbtn.max::after {
  top: 5px;
  border-bottom: 4px solid var(--w-btntext);
}

.w31-capbtn.restore::after {
  top: 3px;
  border-bottom: 4px solid var(--w-btntext);
  box-shadow: none;
}

.w31-capbtn.restore {
  background:
    linear-gradient(var(--w-btnface), var(--w-btnface));
}

.w31-capbtn.restore span {
  position: absolute;
  left: 5px;
  top: 9px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--w-btntext);
}

.w31-menubar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  height: 18px;
  background: var(--w-menu);
  color: var(--w-menutext);
  padding: 0 2px;
  border-bottom: 1px solid var(--w-frame);
  white-space: nowrap;
}

.w31-menubar .w31-mtop {
  padding: 1px 6px 2px;
  line-height: 13px;
}

.w31-menubar .w31-mtop.open,
.w31-menubar .w31-mtop:hover.hot {
  background: var(--w-hilite);
  color: var(--w-hilitetext);
}

.w31-menubar .w31-mtop.disabled {
  color: var(--w-graytext);
}

.w31-client {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  background: var(--w-window);
  color: var(--w-wintext);
  min-height: 0;
}

.w31-win.dialog > .w31-client,
.w31-client.face {
  background: var(--w-btnface);
  color: var(--w-btntext);
}

.w31-client.workspace {
  background: var(--w-appws);
}

.w31-statusbar {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  align-items: center;
  height: 18px;
  padding: 0 4px;
  background: var(--w-btnface);
  color: var(--w-btntext);
  border-top: 1px solid var(--w-frame);
  white-space: nowrap;
  overflow: hidden;
}

.w31-statusbar > span {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.w31-statusbar > span.fixed {
  flex: 0 0 auto;
}

/* MDI child windows */
.w31-win.mdi {
  padding: 4px;
}

.w31-win.mdi.maximized {
  padding: 0;
}

/* Desktop & MDI minimized icons */
.w31-dicon {
  position: absolute;
  width: 74px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--w-wintext);
}

.w31-dicon img,
.w31-dicon canvas {
  width: 32px;
  height: 32px;
  display: block;
}

.w31-dicon .cap {
  margin-top: 2px;
  padding: 0 2px;
  line-height: 12px;
  max-width: 74px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.w31-dicon.selected .cap {
  background: var(--w-hilite);
  color: var(--w-hilitetext);
}

.w31-dicon.ondesk .cap {
  background: var(--w-bg);
}

.w31-dicon.ondesk.selected .cap {
  background: var(--w-acttitle);
  color: var(--w-titletext);
}

/* Program Manager group items */
.w31-group-client {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: var(--w-window);
}

.w31-pitem {
  position: absolute;
  width: 74px;
  height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.w31-pitem canvas {
  width: 32px;
  height: 32px;
  display: block;
}

.w31-pitem .cap {
  margin-top: 3px;
  padding: 0 2px;
  line-height: 12px;
  max-width: 74px;
  white-space: normal;
  overflow: hidden;
  max-height: 24px;
}

.w31-pitem.selected .cap {
  background: var(--w-hilite);
  color: var(--w-hilitetext);
}

.w31-win.active .w31-pitem.selected .cap,
.w31-pitem.selected.focus .cap {
  outline: 1px dotted var(--w-wintext);
}

/* --------------------------------------------------------------------------
   Pop-up menus
   -------------------------------------------------------------------------- */

.w31-menu {
  position: absolute;
  min-width: 100px;
  background: var(--w-menu);
  color: var(--w-menutext);
  border: 1px solid var(--w-frame);
  padding: 1px 0;
  white-space: nowrap;
  box-shadow: none;
  z-index: 100;
}

.w31-mi {
  position: relative;
  display: flex;
  align-items: center;
  height: 17px;
  padding: 0 18px 0 20px;
  line-height: 17px;
}

.w31-mi .lbl {
  flex: 1 1 auto;
}

.w31-mi .sc {
  flex: 0 0 auto;
  margin-left: 24px;
}

.w31-mi .sub {
  position: absolute;
  right: 6px;
  top: 5px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 4px solid currentColor;
}

.w31-mi.hot {
  background: var(--w-hilite);
  color: var(--w-hilitetext);
}

.w31-mi.disabled {
  color: var(--w-graytext);
}

.w31-mi.checked::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.w31-mi.radio::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.w31-msep {
  height: 2px;
  margin: 3px 1px;
  border-top: 1px solid var(--w-btnshadow);
  border-bottom: 1px solid var(--w-btnhilight);
}

.w31-u {
  text-decoration: underline;
  text-underline-offset: 1px;
}

/* --------------------------------------------------------------------------
   Controls
   -------------------------------------------------------------------------- */

.w31-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 23px;
  padding: 0 8px;
  font: inherit;
  color: var(--w-btntext);
  background: var(--w-btnface);
  border: 1px solid var(--w-frame);
  border-radius: 2px;
  position: relative;
  box-shadow:
    inset 1px 1px 0 var(--w-btnhilight),
    inset -1px -1px 0 var(--w-btnshadow),
    inset 2px 2px 0 var(--w-btnhilight),
    inset -2px -2px 0 var(--w-btnshadow);
  white-space: nowrap;
  text-align: center;
  outline: none;
  user-select: none;
}

.w31-btn.default {
  box-shadow:
    inset 0 0 0 1px var(--w-frame),
    inset 2px 2px 0 var(--w-btnhilight),
    inset -2px -2px 0 var(--w-btnshadow),
    inset 3px 3px 0 var(--w-btnhilight),
    inset -3px -3px 0 var(--w-btnshadow);
}

.w31-btn:active:not(.disabled),
.w31-btn.pressed {
  box-shadow:
    inset 1px 1px 0 var(--w-btnshadow),
    inset 2px 2px 0 var(--w-btnshadow);
  padding-top: 2px;
  padding-left: 10px;
}

.w31-btn.focus::after,
.w31-focusable.focus::after {
  content: "";
  position: absolute;
  inset: 4px 4px 4px 4px;
  border: 1px dotted var(--w-btntext);
  pointer-events: none;
}

.w31-btn.disabled {
  color: var(--w-graytext);
  text-shadow: 1px 1px 0 var(--w-btnhilight);
}

.w31-check,
.w31-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 16px;
  position: relative;
  white-space: nowrap;
}

.w31-check .box {
  width: 13px;
  height: 13px;
  background: var(--w-window);
  border: 1px solid var(--w-frame);
  position: relative;
  flex: 0 0 13px;
}

.w31-check.on .box::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0px;
  width: 4px;
  height: 8px;
  border-right: 2px solid var(--w-wintext);
  border-bottom: 2px solid var(--w-wintext);
  transform: rotate(45deg);
}

.w31-radio .box {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--w-window);
  border: 1px solid var(--w-frame);
  position: relative;
  flex: 0 0 12px;
}

.w31-radio.on .box::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--w-wintext);
}

.w31-check.focus .lbl,
.w31-radio.focus .lbl {
  outline: 1px dotted var(--w-btntext);
}

.w31-check.disabled,
.w31-radio.disabled {
  color: var(--w-graytext);
}

.w31-edit,
.w31-list,
.w31-text {
  font: inherit;
  color: var(--w-wintext);
  background: var(--w-window);
  border: 1px solid var(--w-frame);
  outline: none;
  padding: 2px 3px;
  margin: 0;
  resize: none;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

.w31-edit {
  height: 20px;
}

.w31-edit.ro {
  color: var(--w-graytext);
}

.w31-list {
  overflow: auto;
  padding: 1px;
}

.w31-list .li {
  padding: 0 2px;
  height: 13px;
  line-height: 13px;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 3px;
}

.w31-list .li.sel {
  background: var(--w-hilite);
  color: var(--w-hilitetext);
}

.w31-list .li canvas {
  width: 16px;
  height: 16px;
}

.w31-combo {
  position: relative;
  height: 20px;
  display: flex;
}

.w31-combo .w31-edit {
  flex: 1 1 auto;
  min-width: 0;
  border-right: 0;
  padding-right: 2px;
  overflow: hidden;
  white-space: nowrap;
  cursor: var(--w-cursor-arrow);
}

.w31-combo .dd {
  flex: 0 0 16px;
  width: 16px;
  height: 20px;
  background: var(--w-btnface);
  border: 1px solid var(--w-frame);
  box-shadow:
    inset 1px 1px 0 var(--w-btnhilight),
    inset -1px -1px 0 var(--w-btnshadow);
  position: relative;
}

.w31-combo .dd::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 7px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--w-btntext);
}

.w31-combo-pop {
  position: absolute;
  background: var(--w-window);
  border: 1px solid var(--w-frame);
  max-height: 120px;
  overflow: auto;
  z-index: 120;
}

.w31-combo-pop .li {
  height: 13px;
  line-height: 13px;
  padding: 0 3px;
  white-space: nowrap;
}

.w31-combo-pop .li.sel,
.w31-combo-pop .li:hover {
  background: var(--w-hilite);
  color: var(--w-hilitetext);
}

.w31-group {
  position: absolute;
  border: 1px solid var(--w-btnshadow);
  box-shadow: 1px 1px 0 var(--w-btnhilight), inset 1px 1px 0 var(--w-btnhilight);
  padding: 8px;
}

.w31-group > .legend {
  position: absolute;
  left: 8px;
  top: -7px;
  padding: 0 2px;
  background: var(--w-btnface);
}

.w31-lbl {
  position: absolute;
  white-space: nowrap;
}

.w31-abs {
  position: absolute;
}

.w31-sep {
  position: absolute;
  height: 2px;
  border-top: 1px solid var(--w-btnshadow);
  border-bottom: 1px solid var(--w-btnhilight);
}

.w31-icon32 {
  width: 32px;
  height: 32px;
  display: block;
}

/* Scrollbars (3.1 style: dithered track, bevelled arrows) */
.w31-root ::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

.w31-root ::-webkit-scrollbar-track {
  background-color: var(--w-scroll);
  background-image:
    linear-gradient(45deg, var(--w-btnhilight) 25%, transparent 25%, transparent 75%, var(--w-btnhilight) 75%),
    linear-gradient(45deg, var(--w-btnhilight) 25%, transparent 25%, transparent 75%, var(--w-btnhilight) 75%);
  background-size: 2px 2px;
  background-position: 0 0, 1px 1px;
}

.w31-root ::-webkit-scrollbar-thumb {
  background: var(--w-btnface);
  border: 1px solid var(--w-frame);
  box-shadow:
    inset 1px 1px 0 var(--w-btnhilight),
    inset -1px -1px 0 var(--w-btnshadow),
    inset 2px 2px 0 var(--w-btnhilight),
    inset -2px -2px 0 var(--w-btnshadow);
}

.w31-root ::-webkit-scrollbar-button:single-button {
  background-color: var(--w-btnface);
  border: 1px solid var(--w-frame);
  box-shadow:
    inset 1px 1px 0 var(--w-btnhilight),
    inset -1px -1px 0 var(--w-btnshadow);
  width: 16px;
  height: 16px;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
}

.w31-root ::-webkit-scrollbar-button:single-button:vertical:decrement {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='7' height='4'><path d='M3 0l3 4H0z' fill='black'/></svg>");
}

.w31-root ::-webkit-scrollbar-button:single-button:vertical:increment {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='7' height='4'><path d='M0 0h7L3 4z' fill='black'/></svg>");
}

.w31-root ::-webkit-scrollbar-button:single-button:horizontal:decrement {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='7'><path d='M0 3l4-3v7z' fill='black'/></svg>");
}

.w31-root ::-webkit-scrollbar-button:single-button:horizontal:increment {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='7'><path d='M0 0l4 3-4 4z' fill='black'/></svg>");
}

.w31-root ::-webkit-scrollbar-corner {
  background: var(--w-btnface);
}

/* --------------------------------------------------------------------------
   Drag outline, Alt+Tab box, text screens, screen saver, splash
   -------------------------------------------------------------------------- */

.w31-dragframe {
  position: absolute;
  border: 3px dotted #000;
  mix-blend-mode: difference;
  border-color: #fff;
  pointer-events: none;
  z-index: 200;
}

.w31-alttab {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--w-btnface);
  border: 1px solid var(--w-frame);
  box-shadow: inset 0 0 0 1px var(--w-btnface), inset 0 0 0 2px var(--w-frame);
  padding: 14px 24px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  z-index: 300;
}

.w31-alttab canvas {
  width: 32px;
  height: 32px;
}

.w31-alttab .t {
  font-weight: bold;
  white-space: nowrap;
}

.w31-textscreen {
  position: absolute;
  inset: 0;
  background: #0000aa;
  color: #ffffff;
  font-family: var(--w-fixed);
  font-size: 16px;
  line-height: 16px;
  white-space: pre;
  padding: 0;
  z-index: 400;
  overflow: hidden;
}

.w31-textscreen .inv {
  background: #aaaaaa;
  color: #0000aa;
}

.w31-textscreen.safe {
  background: #000000;
  color: #ff8800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 20px;
  line-height: 24px;
}

.w31-saver {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 350;
}

.w31-saver canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Boot splash — real WIN.COM startup logo */
.w31-boot {
  position: absolute;
  inset: 0;
  background: #000000;
  z-index: 420;
  overflow: hidden;
}

.w31-boot canvas {
  position: absolute;
  left: 0;
  top: 0;
}

.w31-boot .txt {
  position: absolute;
  left: 296px;
  top: 178px;
  color: #000;
  font-family: var(--w-serif);
}

.w31-boot .ms {
  font-size: 15px;
  line-height: 16px;
}

.w31-boot .win {
  font-size: 50px;
  line-height: 52px;
  font-weight: bold;
  letter-spacing: -1px;
  margin: 0 0 4px -2px;
}

.w31-boot .ver {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 16px;
}

.w31-boot .copy {
  position: absolute;
  left: 0;
  right: 0;
  top: 300px;
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  color: #000;
}

.w31-boot.flash {
  background: #000;
}

/* --------------------------------------------------------------------------
   Apps
   -------------------------------------------------------------------------- */

.w31-text {
  font-family: var(--w-fixed);
  font-size: 16px;
  line-height: 16px;
  white-space: pre;
  overflow: auto;
  padding: 2px 4px;
  width: 100%;
  height: 100%;
  border: 0;
}

.w31-text.wrap {
  white-space: pre-wrap;
  word-break: break-word;
}

.w31-help-body {
  position: absolute;
  inset: 0;
  overflow: auto;
  background: var(--w-window);
  color: var(--w-wintext);
  padding: 6px 10px 10px;
  font-size: 11px;
  line-height: 14px;
  user-select: text;
  -webkit-user-select: text;
}

.w31-help-body h1 {
  font-size: 14px;
  line-height: 16px;
  margin: 0 0 8px;
  font-weight: bold;
}

.w31-help-body h2 {
  font-size: 11px;
  margin: 10px 0 4px;
  font-weight: bold;
}

.w31-help-body p,
.w31-help-body ul {
  margin: 0 0 7px;
}

.w31-help-body ul {
  padding-left: 16px;
}

.w31-help-body a {
  color: #008000;
  text-decoration: underline;
  cursor: var(--w-cursor-arrow);
}

.w31-help-body a.pop {
  text-decoration: underline dotted;
}

.w31-help-body a:hover {
  color: #00a000;
}

.w31-help-btns {
  display: flex;
  gap: 1px;
  padding: 2px 2px;
  background: var(--w-btnface);
  border-bottom: 1px solid var(--w-frame);
}

.w31-help-btns .w31-btn {
  min-width: 50px;
  height: 20px;
  padding: 0 6px;
}

.w31-write-doc {
  position: absolute;
  inset: 0;
  overflow: auto;
  background: var(--w-window);
  color: var(--w-wintext);
  user-select: text;
  -webkit-user-select: text;
}

.w31-write-page {
  padding: 18px 40px 40px 48px;
  font-family: var(--w-serif);
  font-size: 13px;
  line-height: 16px;
  min-height: 100%;
}

.w31-write-page h1 {
  font-size: 22px;
  line-height: 26px;
  margin: 0 0 2px;
  text-align: center;
}

.w31-write-page .sub {
  text-align: center;
  font-style: italic;
  margin-bottom: 14px;
}

.w31-write-page h2 {
  font-size: 15px;
  margin: 14px 0 3px;
  border-bottom: 1px solid #000;
}

.w31-write-page h3 {
  font-size: 13px;
  margin: 10px 0 1px;
}

.w31-write-page .date {
  float: right;
  font-style: italic;
  font-size: 12px;
}

.w31-write-page .org {
  font-style: italic;
}

.w31-write-page p {
  margin: 0 0 5px;
}

.w31-write-page ul {
  margin: 2px 0 6px;
  padding-left: 22px;
}

.w31-write-page .pub {
  margin: 0 0 6px 24px;
  text-indent: -24px;
}

.w31-ruler {
  height: 22px;
  background: var(--w-btnface);
  border-bottom: 1px solid var(--w-frame);
  position: relative;
  overflow: hidden;
}

.w31-ruler canvas {
  display: block;
}

.w31-pb-tools {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 42px;
  background: var(--w-btnface);
  border-right: 1px solid var(--w-frame);
}

.w31-pb-tool {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #fff;
  border: 1px solid #000;
}

.w31-pb-tool.sel {
  background: #000;
}

.w31-pb-tool.sel canvas {
  filter: invert(1);
}

.w31-pb-widths {
  position: absolute;
  left: 2px;
  bottom: 4px;
  width: 37px;
  height: 62px;
  background: #fff;
  border: 1px solid #000;
}

.w31-pb-palette {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  background: var(--w-btnface);
  border-top: 1px solid var(--w-frame);
}

.w31-pb-canvas-wrap {
  position: absolute;
  left: 42px;
  top: 0;
  right: 0;
  bottom: 36px;
  overflow: auto;
  background: var(--w-appws);
}

.w31-pb-canvas-wrap canvas {
  display: block;
  cursor: crosshair !important;
}

.w31-calc {
  position: absolute;
  inset: 0;
  background: var(--w-btnface);
}

.w31-calc .disp {
  position: absolute;
  background: var(--w-window);
  border: 1px solid var(--w-frame);
  text-align: right;
  padding: 2px 4px;
  font-size: 12px;
  line-height: 14px;
  height: 20px;
  overflow: hidden;
  white-space: nowrap;
}

.w31-calc .k {
  position: absolute;
  min-width: 0;
  height: 20px;
  padding: 0;
  font-size: 11px;
}

.w31-calc .k.red { color: #ff0000; }
.w31-calc .k.blue { color: #0000ff; }
.w31-calc .k.mag { color: #ff00ff; }
.w31-calc .k.mem { color: #ff0000; }

.w31-calc .box {
  position: absolute;
  border: 1px solid var(--w-btnshadow);
  box-shadow: 1px 1px 0 var(--w-btnhilight), inset 1px 1px 0 var(--w-btnhilight);
}

.w31-mine {
  position: absolute;
  inset: 0;
  background: var(--w-btnface);
  overflow: hidden;
}

.w31-mine canvas {
  position: absolute;
  left: 0;
  top: 0;
}

.w31-sol canvas {
  position: absolute;
  left: 0;
  top: 0;
}

.w31-cp-grid {
  position: absolute;
  inset: 0;
  overflow: auto;
  background: var(--w-window);
  padding: 4px;
}

.w31-cp-item {
  position: absolute;
  width: 72px;
  height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.w31-cp-item canvas {
  width: 32px;
  height: 32px;
}

.w31-cp-item .cap {
  margin-top: 2px;
  padding: 0 2px;
  line-height: 12px;
}

.w31-cp-item.selected .cap {
  background: var(--w-hilite);
  color: var(--w-hilitetext);
}

.w31-fm-tree,
.w31-fm-list {
  position: absolute;
  top: 0;
  bottom: 0;
  overflow: auto;
  background: var(--w-window);
  color: var(--w-wintext);
  padding: 2px 0;
}

.w31-fm-row {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 16px;
  padding: 0 4px;
  white-space: nowrap;
}

.w31-fm-row canvas {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.w31-fm-row.sel {
  background: var(--w-hilite);
  color: var(--w-hilitetext);
}

.w31-fm-row.sel-inactive .nm {
  outline: 1px dotted var(--w-wintext);
}

.w31-fm-drivebar {
  height: 24px;
  background: var(--w-btnface);
  border-bottom: 1px solid var(--w-frame);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  position: relative;
}

.w31-fm-drive {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 1px 3px;
  border: 1px solid transparent;
}

.w31-fm-drive.cur {
  border: 1px dotted var(--w-wintext);
}

.w31-fm-drive canvas {
  width: 24px;
  height: 14px;
}

.w31-fm-path {
  margin-left: 10px;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.w31-fm-splitter {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--w-btnface);
  border-left: 1px solid var(--w-frame);
  border-right: 1px solid var(--w-frame);
  cursor: ew-resize !important;
}

.w31-card {
  position: absolute;
  background: var(--w-window);
  border: 1px solid var(--w-frame);
  box-shadow: 1px 1px 0 var(--w-frame);
}

.w31-card .idx {
  height: 17px;
  border-bottom: 1px solid var(--w-frame);
  padding: 2px 4px;
  font-weight: normal;
  background: var(--w-window);
  white-space: nowrap;
  overflow: hidden;
}

.w31-card .body {
  padding: 4px 6px;
  white-space: pre-wrap;
  font-family: var(--w-font);
  line-height: 13px;
  overflow: hidden;
}

.w31-cal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--w-window);
}

.w31-cal .hdr {
  height: 20px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 8px;
  border-bottom: 1px solid var(--w-frame);
  background: var(--w-window);
}

.w31-cal .arrow {
  width: 16px;
  height: 14px;
  background: var(--w-btnface);
  border: 1px solid var(--w-frame);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
}

.w31-cal table {
  border-collapse: collapse;
  width: 100%;
  flex: 1 1 auto;
  table-layout: fixed;
}

.w31-cal th {
  font-weight: normal;
  height: 16px;
  border-bottom: 1px solid var(--w-frame);
}

.w31-cal td {
  vertical-align: top;
  padding: 1px 3px;
  height: 36px;
  border: 1px solid var(--w-btnshadow);
  font-size: 11px;
  overflow: hidden;
  position: relative;
}

.w31-cal td.today {
  outline: 1px solid var(--w-frame);
  outline-offset: -2px;
}

.w31-cal td.sel {
  background: var(--w-hilite);
  color: var(--w-hilitetext);
}

.w31-cal td .ev {
  font-size: 9px;
  line-height: 10px;
  color: #800000;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.w31-cal td.sel .ev {
  color: inherit;
}

.w31-cal .day-view {
  flex: 1 1 auto;
  overflow: auto;
}

.w31-cal .slot {
  display: flex;
  height: 16px;
  line-height: 16px;
  border-bottom: 1px dotted var(--w-btnshadow);
  padding-left: 6px;
}

.w31-cal .slot .t {
  width: 56px;
  flex: 0 0 56px;
}

.w31-charmap {
  position: absolute;
  inset: 0;
  background: var(--w-btnface);
}

.w31-charmap canvas {
  position: absolute;
  background: var(--w-window);
  border: 1px solid var(--w-frame);
}

.w31-term {
  position: absolute;
  inset: 0;
  background: var(--w-window);
  color: var(--w-wintext);
  font-family: var(--w-fixed);
  font-size: 16px;
  line-height: 16px;
  white-space: pre-wrap;
  word-break: break-all;
  overflow: auto;
  padding: 2px 4px;
  user-select: text;
  -webkit-user-select: text;
}

.w31-term .cur {
  background: var(--w-wintext);
  color: var(--w-window);
}

.w31-led {
  display: block;
}

.w31-tray {
  position: absolute;
  inset: 0;
}

/* Mobile toolbar (outside the scaled screen) */
.w31-touchbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  gap: 6px;
  padding: 6px 8px;
  background: #111216;
  border-top: 1px solid #333;
  z-index: 20;
  align-items: center;
  overflow-x: auto;
  font-family: var(--dos-font, monospace);
}

.w31-touchbar button {
  appearance: none;
  flex: 0 0 auto;
  background: #202228;
  color: #fff;
  border: 1px solid #555;
  border-radius: 3px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
}

.w31-touchbar button.on {
  background: #ffff55;
  color: #000;
}

.w31-touchbar .hint {
  color: #8a8e94;
  font-size: 11px;
  white-space: nowrap;
  margin-left: auto;
}

.w31-root.touch .w31-touchbar {
  display: flex;
}

/* While Windows owns the CRT the DOS quick-key bar is hidden */
.win31-on .dos-touchbar {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .w31-root * {
    animation: none !important;
    transition: none !important;
  }
}
