/* The Macintosh Plus (macplus.js): a beige compact Mac whose 512 x 342 one-bit screen is the whole show. */
body.macplus-on > :not(#macplus) { visibility: hidden !important; }
#macplus { position: fixed; inset: 0; z-index: 2147483000; display: block; overflow: hidden; outline: none;
  background: radial-gradient(ellipse at 50% 40%, #3a3631, #141210 70%); user-select: none; }
/* the case: 640 x 640 units, scaled to the window by layout() */
.mp-case { position: relative; width: 640px; height: 640px; flex: none; transform-origin: 0 0; border-radius: 26px 26px 10px 10px;
  background: linear-gradient(#efe9d9, #e2dbc7 60%, #d3cbb5); box-shadow: inset 0 3px 0 #fbf8ef, inset 0 -6px 0 #bfb69e, 0 30px 60px rgba(0,0,0,.6); }
.mp-bezel { position: absolute; left: 40px; top: 34px; width: 560px; height: 420px; border-radius: 12px; background: linear-gradient(#d9d1bb, #e9e3d2);
  box-shadow: inset 0 4px 10px rgba(0,0,0,.25), inset 0 -2px 0 #fff; display: grid; place-items: center; }
.mp-crt { position: relative; width: 530px; height: 368px; border-radius: 18px / 22px; background: #0a0a0a; display: grid; place-items: center;
  box-shadow: inset 0 0 22px #000, 0 0 0 3px #b7ae98; overflow: hidden; }
.mp-crt::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(ellipse 80% 75% at 50% 45%, transparent 60%, rgba(0,0,0,.35) 100%), linear-gradient(160deg, rgba(255,255,255,.08), transparent 40%); }
.mp-chin { position: absolute; left: 0; right: 0; top: 470px; height: 170px; }
.mp-badge { position: absolute; left: 52px; top: 22px; display: flex; align-items: center; gap: 8px; font: 15px "Garamond", "Times New Roman", serif; color: #6c6556; letter-spacing: .5px; }
.mp-badge i svg { width: 18px; height: 16px; } .mp-badge i svg path[fill="#000"] { fill: #8a8270; }
.mp-slot { position: absolute; right: 70px; top: 40px; width: 150px; height: 9px; border-radius: 4px; background: #57513f; box-shadow: inset 0 3px 3px #000, 0 1px 0 #fff; }
.mp-vents { position: absolute; left: 60px; right: 60px; bottom: 26px; height: 40px; background: repeating-linear-gradient(90deg, transparent 0 14px, rgba(0,0,0,.08) 14px 18px); border-radius: 6px; }

/* the screen: 512 x 342, black on white, one bit */
.mp-screen { position: relative; width: 512px; height: 342px; overflow: hidden; background: #fff; color: #000; cursor: default;
  font: bold 12px/1 Chicago, ChicagoFLF, "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: none; font-smooth: never; image-rendering: pixelated; }
.mp-screen * { box-sizing: border-box; }
.mp-grey { position: absolute; inset: 0; display: grid; place-items: center; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' shape-rendering='crispEdges'%3E%3Crect width='1' height='1'/%3E%3Crect x='1' y='1' width='1' height='1'/%3E%3C/svg%3E") 0 0 / 2px 2px #fff; }
.mp-happy svg { width: 32px; height: 40px; }
.mp-welcome { padding: 10px 26px; background: #fff; border: 1px solid #000; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #000; font-size: 14px; }
.mp-off-msg { position: absolute; inset: 0; display: grid; place-items: center; background: #fff; }

/* menu bar and menus */
.mp-bar { position: absolute; left: 0; right: 0; top: 0; height: 20px; z-index: 1000; display: flex; align-items: center; gap: 0; padding: 0 8px; background: #fff; border-bottom: 1px solid #000; border-radius: 6px 6px 0 0; }
.mp-mt { padding: 3px 9px; height: 19px; display: flex; align-items: center; }
.mp-mt.on { background: #000; color: #fff; } .mp-mt.bun svg { display: block; } .mp-mt.on.bun svg path[fill="#000"] { fill: #fff; } .mp-mt.on.bun svg path[stroke="#fff"] { stroke: #000; }
.mp-clock { margin-left: auto; font-weight: normal; }
.mp-menu { position: absolute; top: 19px; z-index: 1001; min-width: 150px; padding: 2px 0; background: #fff; border: 1px solid #000; box-shadow: 2px 2px 0 #000; }
.mp-mi { display: flex; justify-content: space-between; gap: 18px; padding: 2px 14px; white-space: nowrap; }
.mp-mi:hover:not(.dis) { background: #000; color: #fff; } .mp-mi.dis { color: #000; opacity: 1; background-image: none; } .mp-mi.dis span { opacity: .45; }
.mp-key { font-weight: bold; } .mp-sep { margin: 2px 0; border-top: 1px dotted #000; }

/* desktop and icons */
.mp-desk { position: absolute; inset: 0; background-repeat: repeat; background-size: 8px 8px; image-rendering: pixelated; border-radius: 6px; overflow: hidden; }
.mp-ic svg { display: block; width: 32px; height: 32px; }
.mp-di { position: absolute; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 1px; font: 9px/1.1 Geneva, Verdana, sans-serif; }
.mp-di span, .mp-fi span { background: #fff; padding: 0 2px; text-align: center; }
.mp-di.sel svg, .mp-fi.sel svg { filter: invert(1); } .mp-di.sel span, .mp-fi.sel span { background: #000; color: #fff; }
.mp-ghost { position: absolute; z-index: 2000; pointer-events: none; opacity: .6; }

/* windows */
.mp-win { position: absolute; display: flex; flex-direction: column; background: #fff; border: 1px solid #000; box-shadow: 1px 1px 0 #000; min-width: 100px; }
.mp-win.da { box-shadow: 1px 1px 0 #000; }
.mp-tbar { position: relative; flex: none; height: 19px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #000; padding: 0 22px; }
.mp-win.on > .mp-tbar { background: linear-gradient(#fff 3px, transparent 3px, transparent 15px, #fff 15px), repeating-linear-gradient(#000 0 1px, #fff 1px 2px) 0 3px / 100% 12px no-repeat; }
.mp-title { background: #fff; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mp-title:empty { display: none; }
.mp-close { position: absolute; left: 8px; top: 4px; width: 11px; height: 11px; background: #fff; border: 1px solid #000; box-shadow: 0 0 0 1px #fff; visibility: hidden; }
.mp-win.on .mp-close { visibility: visible; } .mp-close:active { background: #000; }
.mp-content { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.mp-grow { position: absolute; right: 0; bottom: 0; width: 15px; height: 15px; border-left: 1px solid #000; border-top: 1px solid #000; background: #fff; }
.mp-grow::after { content: ""; position: absolute; left: 3px; top: 3px; width: 6px; height: 6px; border: 1px solid #000; box-shadow: 2px 2px 0 -1px #fff, 2px 2px 0 0 #000; }

/* Finder windows */
.mp-fwin { display: flex; flex-direction: column; height: 100%; }
.mp-wstat { display: flex; justify-content: space-between; padding: 2px 8px 3px; border-bottom: 1px solid #000; font: 10px Geneva, Verdana, sans-serif; box-shadow: 0 1px 0 #fff, 0 2px 0 #000; margin-bottom: 2px; }
.mp-fbody { flex: 1; overflow: auto; padding: 6px 18px 16px 6px; border-right: 15px solid transparent;
  background: linear-gradient(90deg, transparent calc(100% - 0px), #000 0); }
.mp-icons { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.mp-fi { width: 76px; display: flex; flex-direction: column; align-items: center; gap: 2px; font: 9px/1.1 Geneva, Verdana, sans-serif; }
.mp-names { font: 10px Geneva, Verdana, sans-serif; } .mp-nhead, .mp-nrow { display: grid; grid-template-columns: 1fr 110px; padding: 1px 4px; }
.mp-nhead { font-weight: bold; text-decoration: underline; } .mp-nrow.sel { background: #000; color: #fff; }

/* dialogs */
.mp-modal { position: absolute; inset: 0; z-index: 3000; display: grid; place-items: center; }
.mp-dlg { min-width: 260px; max-width: 360px; padding: 12px 14px; background: #fff; border: 1px solid #000; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000; font: bold 12px Chicago, ChicagoFLF, "Helvetica Neue", Arial, sans-serif; }
.mp-dlg.wide { min-width: 300px; } .mp-dlg p { margin: 0 0 10px; white-space: pre-line; line-height: 1.3; }
.mp-dlg-row { display: flex; gap: 12px; align-items: flex-start; }
.mp-dlg-ic { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 2px solid #000; border-radius: 50%; font-size: 20px; }
.mp-dlg-btns { display: flex; gap: 12px; justify-content: flex-end; }
.mp-btn { min-width: 64px; padding: 3px 12px; background: #fff; color: #000; border: 1px solid #000; border-radius: 8px; font: inherit; cursor: default; }
.mp-btn.def { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000; } .mp-btn:active { background: #000; color: #fff; }
.mp-field { width: 100%; margin-bottom: 10px; padding: 2px 4px; border: 1px solid #000; font: 12px Geneva, Verdana, sans-serif; outline: none; }
.mp-list { height: 110px; overflow: auto; margin-bottom: 10px; border: 1px solid #000; font: 11px Geneva, Verdana, sans-serif; }
.mp-li { padding: 1px 6px; } .mp-li.on { background: #000; color: #fff; }
.mp-about { display: flex; gap: 12px; padding: 12px; font: 10px/1.35 Geneva, Verdana, sans-serif; } .mp-about b { font: bold 13px Chicago, ChicagoFLF, Arial, sans-serif; } .mp-about p { margin: 3px 0; }
.mp-about .mp-ic svg { width: 32px; height: 40px; }

/* MacPaint */
.mp-paint { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: 1fr 30px; height: 100%; }
.mp-tools { display: grid; grid-template-columns: 24px 24px; grid-auto-rows: 21px; gap: 0; align-content: start; padding: 2px; border-right: 1px solid #000; }
.mp-tool { padding: 0; border: 1px solid #000; margin: -1px 0 0 -1px; background: #fff; color: #000; font: 13px/1 "DejaVu Sans", sans-serif; }
.mp-tool.on { background: #000; color: #fff; }
.mp-lws { grid-column: span 2; display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.mp-lw { height: 10px; padding: 0 4px; background: #fff; border: 1px solid transparent; display: grid; align-items: center; } .mp-lw i { display: block; background: #000; }
.mp-lw.on { border-color: #000; }
.mp-paint-area { position: relative; overflow: hidden; display: grid; place-items: center; background: #fff; }
.mp-paint-cv { width: 416px; height: 240px; image-rendering: pixelated; cursor: crosshair; border: 1px solid #000; touch-action: none; }
.mp-paint-text { position: absolute; z-index: 2; width: 200px; padding: 0; border: 0; border-bottom: 1px dotted #000; background: transparent; font: 12px Geneva, Verdana, sans-serif; outline: none; }
.mp-pats { grid-column: span 2; display: flex; gap: 4px; align-items: center; padding: 2px 4px; border-top: 1px solid #000; }
.mp-patcur canvas { width: 32px; height: 20px; border: 1px solid #000; image-rendering: pixelated; }
.mp-patgrid { display: grid; grid-template-columns: repeat(19, 1fr); grid-auto-rows: 11px; flex: 1; }
.mp-pat { padding: 0; border: 1px solid #000; margin: -1px 0 0 -1px; background: #fff; } .mp-pat canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }

/* MacWrite */
.mp-write { display: flex; flex-direction: column; height: 100%; }
.mp-ruler { flex: none; border-bottom: 1px solid #000; padding: 2px 8px; }
.mp-ruler-scale { display: flex; justify-content: space-between; font: 9px Geneva, sans-serif; border-bottom: 1px solid #000; background: repeating-linear-gradient(90deg, #000 0 1px, transparent 1px 8px) bottom / 100% 3px no-repeat; padding-bottom: 3px; }
.mp-ruler-btns { display: flex; gap: 4px; align-items: center; padding-top: 2px; }
.mp-ruler-btns button { padding: 0 4px; height: 14px; background: #fff; border: 1px solid #000; font: 10px/1 "DejaVu Sans", sans-serif; color: #000; }
.mp-write-scroll { flex: 1; overflow: auto; border-right: 15px solid #fff; box-shadow: inset -1px 0 0 #000; }
.mp-write-page { min-height: 100%; padding: 8px 14px 20px; outline: none; font: 12px/1.2 Geneva, Verdana, sans-serif; font-weight: normal; user-select: text; cursor: text; }
.mp-write-page p { margin: 0 0 4px; }
.mp-outline { color: #fff; -webkit-text-stroke: 1px #000; } .mp-shadow { text-shadow: 1px 1px 0 #000; }

/* desk accessories */
.mp-alarm { display: grid; place-items: center; height: 100%; font-size: 14px; }
.mp-calc { padding: 4px; } .mp-calc-lcd { border: 1px solid #000; padding: 2px 4px; text-align: right; margin-bottom: 4px; font-size: 13px; overflow: hidden; }
.mp-calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; } .mp-calc-keys button { height: 22px; padding: 0; background: #fff; border: 1px solid #000; border-radius: 3px; font: inherit; color: #000; }
.mp-calc-keys button:active { background: #000; color: #fff; } .mp-calc-keys .wide { grid-column: span 2; }
.mp-cp { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 6px; font: 9px Geneva, sans-serif; } .mp-cp b { display: block; margin: 2px 0; font: bold 9px Geneva, sans-serif; }
.mp-cp-grid { display: grid; grid-template-columns: repeat(8, 9px); border: 1px solid #000; width: max-content; } .mp-cp-grid i { width: 9px; height: 9px; border: 1px solid #ddd; } .mp-cp-grid i.on { background: #000; }
.mp-cp-prev { width: 72px; height: 28px; margin: 4px 0; border: 1px solid #000; background-size: 8px 8px; image-rendering: pixelated; }
.mp-cp input[type=range] { width: 120px; accent-color: #000; }
.mp-kc-line { height: 20px; margin: 4px; border: 1px solid #000; padding: 2px 4px; font: 12px Geneva, sans-serif; overflow: hidden; }
.mp-kc { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px; } .mp-kc div { display: flex; gap: 2px; }
.mp-kc i { width: 18px; height: 16px; display: grid; place-items: center; border: 1px solid #000; border-radius: 2px; font: 10px Geneva, sans-serif; font-style: normal; }
.mp-kc i.space { width: 140px; } .mp-kc i.down { background: #000; color: #fff; }
.mp-note { display: flex; flex-direction: column; height: 100%; } .mp-note-ta { flex: 1; resize: none; border: 0; outline: none; padding: 4px 6px; font: 12px Geneva, Verdana, sans-serif; background: #fff; color: #000; }
.mp-note-foot { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 2px; font-size: 11px; } .mp-note-foot b { cursor: pointer; }
.mp-puz { display: grid; grid-template-columns: repeat(4, 30px); gap: 1px; padding: 4px; } .mp-puz i { height: 30px; display: grid; place-items: center; border: 1px solid #000; font-style: normal; background: #fff; }
.mp-puz i.hole { border-color: transparent; background: #000; }
.mp-scrap { display: flex; flex-direction: column; height: 100%; } .mp-scrap-box { flex: 1; display: grid; place-items: center; border-bottom: 1px solid #000; }
.mp-scrap-t { font: 14px "New York", "Times New Roman", serif; } .mp-scrap-bar { display: flex; gap: 10px; align-items: center; padding: 2px 6px; font-size: 10px; } .mp-scrap-bar b { cursor: pointer; }
