*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #008080;
  color: #000;
}

body {
  font-family: Tahoma, "Microsoft Sans Serif", Geneva, sans-serif;
  font-size: 12px;
  line-height: 1.35;
}

button,
input {
  font: inherit;
  color: inherit;
}

img {
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}

[hidden] {
  display: none !important;
}

#desktop {
  position: relative;
  height: 100dvh;
  background: #008080;
  overflow: hidden;
  cursor: default;
  user-select: none;
}

#workspace {
  position: absolute;
  inset: 0 0 30px 0;
  z-index: 1;
}

#icons {
  position: absolute;
  top: 6px;
  left: 4px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 92px;
}

.desk-icon {
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  cursor: default;
}

.desk-icon img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.desk-icon .label {
  max-width: 80px;
  padding: 1px 3px 2px;
  text-align: center;
  line-height: 1.2;
}

.desk-icon.is-selected .label {
  background: #000080;
  color: #fff;
  text-shadow: none;
}

.icon-view .desk-icon {
  color: #000;
  text-shadow: none;
}

.icon-view .desk-icon.is-selected .label {
  background: #000080;
  color: #fff;
}

#taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  box-shadow: inset 0 1px 0 #dfdfdf;
}

#start-button {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 1px 8px 1px 4px;
  background: #c0c0c0;
  border-style: solid;
  border-width: 2px;
  border-color: #fff #000 #000 #fff;
  box-shadow: inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 #808080;
  cursor: default;
}

#start-button img {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
}

#start-button span {
  font-size: 15px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.2px;
}

#start-button[aria-expanded="true"] {
  border-color: #000 #fff #fff #000;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #dfdfdf;
  padding: 2px 7px 0 5px;
}

#tasks {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 4px;
  overflow: hidden;
}

.task {
  flex: 0 1 168px;
  min-width: 0;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  background: #c0c0c0;
  border-style: solid;
  border-width: 2px;
  border-color: #fff #000 #000 #fff;
  box-shadow: inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 #808080;
  cursor: default;
}

.task img {
  width: 16px;
  height: 16px;
  flex: none;
  image-rendering: pixelated;
}

.task span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.task.is-pressed {
  border-color: #000 #fff #fff #000;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #dfdfdf;
  padding: 2px 7px 0 9px;
}

#tray {
  min-width: 64px;
  padding: 3px 8px 1px;
  text-align: center;
  border-style: solid;
  border-width: 1px;
  border-color: #808080 #fff #fff #808080;
  box-shadow: inset 1px 1px 0 #404040;
}

#clock {
  font-variant-numeric: tabular-nums;
}

#start-menu {
  position: absolute;
  left: 2px;
  bottom: 30px;
  z-index: 40;
  display: flex;
  background: #c0c0c0;
  border-style: solid;
  border-width: 2px;
  border-color: #dfdfdf #000 #000 #dfdfdf;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
  padding: 2px;
  max-height: calc(100dvh - 36px);
}

.banner {
  width: 28px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #808080;
  color: #c0c0c0;
  overflow: hidden;
}

.banner span {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.menu-items {
  display: flex;
  flex-direction: column;
  min-width: 196px;
  padding: 2px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 16px 7px 8px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: default;
  white-space: nowrap;
}

.menu-item img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.menu-item:hover,
.menu-item:focus {
  background: #000080;
  color: #fff;
  outline: none;
}

.sep {
  height: 2px;
  margin: 4px 2px;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
}

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 230px;
  min-height: 150px;
  background: #c0c0c0;
  border-style: solid;
  border-width: 2px;
  border-color: #dfdfdf #000 #000 #dfdfdf;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
}

.window.is-min {
  display: none;
}

.window.is-max {
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.window.is-max .grip {
  display: none;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  margin: 2px 2px 0;
  padding: 2px 2px 2px 3px;
  background: #808080;
  color: #dfdfdf;
  font-weight: 700;
  touch-action: none;
}

.window.is-active .titlebar {
  background: #000080;
  color: #fff;
}

.titlebar img {
  width: 16px;
  height: 16px;
  flex: none;
  image-rendering: pixelated;
}

.title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.controls {
  display: flex;
  gap: 2px;
  flex: none;
}

.win-btn {
  width: 18px;
  height: 16px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #c0c0c0;
  border-style: solid;
  border-width: 2px;
  border-color: #fff #000 #000 #fff;
  box-shadow: inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 #808080;
  cursor: default;
}

.win-btn.close {
  margin-left: 2px;
}

.win-btn:active {
  border-color: #000 #fff #fff #000;
  box-shadow: inset 1px 1px 0 #808080;
}

.window-body {
  flex: 1;
  min-height: 0;
  margin: 2px;
  display: flex;
  flex-direction: column;
}

.program {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.sheet {
  flex: 1;
  min-height: 0;
  background: #fff;
}

.sunken {
  border-style: solid;
  border-width: 2px;
  border-color: #808080 #fff #fff #808080;
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #dfdfdf;
}

.dialog {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 16px 12px;
  background: #c0c0c0;
  overflow: auto;
  user-select: text;
}

.dialog .hero {
  width: 48px;
  height: 48px;
  flex: none;
  image-rendering: pixelated;
}

.dialog h1,
.prose h1 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.dialog p,
.prose p {
  margin: 0 0 8px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.cmd {
  min-width: 84px;
  padding: 4px 12px 3px;
  background: #c0c0c0;
  border-style: solid;
  border-width: 2px;
  border-color: #fff #000 #000 #fff;
  box-shadow: inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 #808080;
  cursor: default;
}

.cmd:active {
  border-color: #000 #fff #fff #000;
  box-shadow: inset 1px 1px 0 #808080;
  padding: 5px 11px 2px 13px;
}

.prose {
  padding: 12px 14px;
  overflow: auto;
  user-select: text;
}

.prose h2 {
  margin: 14px 0 4px;
  font-size: 13px;
}

.prose a {
  color: #000080;
}

.icon-view {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px 8px;
  height: 100%;
  padding: 8px;
  overflow: auto;
  background: #fff;
}

.split {
  display: flex;
  min-height: 0;
}

.index {
  width: 42%;
  max-width: 210px;
  overflow: auto;
  background: #fff;
  border-right: 1px solid #808080;
}

.index button {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  background: #fff;
  text-align: left;
  cursor: default;
}

.index button[aria-selected="true"],
.index button:hover,
.index button:focus-visible {
  background: #000080;
  color: #fff;
  outline: none;
}

.posts {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 10px 12px;
  background: #fff;
  user-select: text;
}

.posts h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.posts p {
  margin: 0 0 8px;
}

.statusbar {
  display: flex;
  gap: 2px;
  margin-top: 3px;
}

.statusbar span {
  flex: 1;
  min-width: 0;
  padding: 2px 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-style: solid;
  border-width: 1px;
  border-color: #808080 #fff #fff #808080;
}

.statusbar .fit {
  flex: 0 0 auto;
  min-width: 72px;
}

.grip {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 0 30%, #fff 30% 40%, transparent 40% 50%, #808080 50% 60%, transparent 60% 70%, #fff 70% 80%, transparent 80% 90%, #808080 90% 100%);
}

button:focus-visible,
.desk-icon:focus-visible {
  outline: 1px dotted #000;
  outline-offset: -3px;
}

#icons .desk-icon:focus-visible {
  outline-color: #fff;
}

#shutdown {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #000;
  color: #f0a000;
  text-align: center;
  cursor: default;
  user-select: none;
}

.shutdown-stack {
  max-width: 18em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(20px, 3.1vw, 28px);
  font-weight: 700;
  line-height: 1.35;
}

#shutdown-preparing,
#shutdown-safe {
  margin: 0;
}

#shutdown-restart {
  display: block;
  margin: 26px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f0a000;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.noscript {
  margin: 0;
  padding: 24px;
  color: #fff;
  text-align: center;
}

@media (max-width: 640px) {
  #icons {
    flex-direction: row;
    flex-wrap: wrap;
    width: auto;
    right: 4px;
    gap: 0;
  }

  .desk-icon {
    width: 72px;
  }

  .dialog {
    flex-direction: column;
    gap: 8px;
  }

  .split {
    flex-direction: column;
  }

  .index {
    width: auto;
    max-width: none;
    max-height: 132px;
    border-right: 0;
    border-bottom: 1px solid #808080;
  }
}
