/* Local Win98-style window subset used by the snapshot frontend. */
.window {
  position: absolute;
  min-width: 96px;
  padding: 3px;
  background: #c0c0c0;
  border-top: 1px solid #dfdfdf;
  border-left: 1px solid #dfdfdf;
  border-right: 1px solid #0a0a0a;
  border-bottom: 1px solid #0a0a0a;
  box-shadow: inset 1px 1px #ffffff, inset -1px -1px #808080;
  color: #000;
  font: 12px/1.2 "MS Sans Serif", Tahoma, sans-serif;
}

.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 18px;
  padding: 2px 2px 2px 3px;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  user-select: none;
}

.title-bar-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 700;
}

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

.title-bar-controls button {
  width: 16px;
  height: 14px;
  min-width: 16px;
  min-height: 14px;
  padding: 0;
  border-radius: 0;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  background: #c0c0c0;
  color: #000;
  font: 11px/1 Arial, sans-serif;
}

.title-bar-controls button::before {
  content: "×";
}

.window-body {
  margin: 3px 0 0;
  padding: 0;
  background: #000;
}

/* Win32 menu chrome is frontend-owned; client pixels remain in the canvas. */
.wemu-menu-bar,
.wemu-submenu {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #000;
  font: 12px/1.2 "MS Sans Serif", Tahoma, sans-serif;
}

.wemu-menu-bar {
  position: relative;
  z-index: 3;
  display: flex;
  min-height: 20px;
  padding: 1px 2px;
  background: #c0c0c0;
}

.wemu-menu-bar[hidden] {
  display: none;
}

.wemu-window.has-menu {
  overflow: visible;
}

.has-menu .window-body {
  margin-top: 0;
}

.wemu-menu-item {
  position: relative;
}

.wemu-menu-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: default;
}

.wemu-menu-bar > .wemu-menu-item > .wemu-menu-button {
  width: auto;
  height: 18px;
  padding: 1px 7px;
}

.wemu-menu-button:disabled {
  color: #808080;
  text-shadow: 1px 1px #fff;
  opacity: 1;
}

.wemu-menu-item.open > .wemu-menu-button:not(:disabled),
.wemu-menu-button:focus-visible,
.wemu-menu-active .wemu-menu-item:hover > .wemu-menu-button:not(:disabled) {
  outline: 0;
  background: #000080;
  color: #fff;
  text-shadow: none;
}

.wemu-submenu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  display: none;
  min-width: 150px;
  padding: 2px;
  background: #c0c0c0;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  box-shadow: inset 1px 1px #dfdfdf, inset -1px -1px #808080, 1px 1px #000;
}

.wemu-submenu .wemu-submenu {
  top: -3px;
  left: calc(100% - 2px);
}

.wemu-popup-menu {
  display: block;
  z-index: 1000;
}

.wemu-popup-menu[hidden] {
  display: none;
}

.wemu-menu-item.open > .wemu-submenu {
  display: block;
}

.wemu-submenu > .wemu-menu-item > .wemu-menu-button {
  min-height: 19px;
  padding: 2px 22px 2px 20px;
}

.wemu-menu-shortcut {
  margin-left: auto;
  padding-left: 24px;
}

.wemu-menu-access {
  text-decoration: underline;
}

.wemu-submenu .has-submenu > .wemu-menu-button::after {
  position: absolute;
  right: 7px;
  content: "▶";
  font-size: 8px;
}

.wemu-submenu .checked > .wemu-menu-button::before {
  position: absolute;
  left: 7px;
  content: "✓";
  font-weight: 700;
}

.wemu-menu-separator {
  height: 7px;
  margin: 0 2px;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
  transform: translateY(3px);
}
