/* ============================================================
   system7.css — the platinum look of Macintosh System 7 (1991).
   1-bit chrome, pinstripe title bars, gray dither desktop,
   Chicago bitmap typography throughout.
   ============================================================ */

@font-face {
  font-family: 'ChicagoFLF';
  src: url('../assets/fonts/ChicagoFLF.woff2') format('woff2'),
       url('../assets/fonts/ChicagoFLF.woff') format('woff');
  font-weight: normal; font-style: normal;
}
@font-face {
  font-family: 'FindersKeepers';
  src: url('../assets/fonts/FindersKeepers.woff2') format('woff2');
  font-weight: normal; font-style: normal;
}
@font-face {
  font-family: 'MacMonaco';
  src: url('../assets/fonts/monaco.woff2') format('woff2');
  font-weight: normal; font-style: normal;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #888;
  font-family: 'ChicagoFLF', 'FindersKeepers', Geneva, Verdana, sans-serif;
  font-size: 12px;
  -webkit-font-smoothing: none;
  font-smooth: never;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

img { image-rendering: pixelated; image-rendering: crisp-edges; }
button { font-family: inherit; font-size: inherit; }

/* ============ the desktop surface ============ */
#menubar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 21px;
  background: #fff;
  border-bottom: 1px solid #000;
  display: flex; justify-content: space-between;
  z-index: 100000;
  line-height: 20px;
}
.mb-left, .mb-right { display: flex; align-items: stretch; height: 100%; }
.mb-title {
  padding: 0 10px;
  cursor: default;
  height: 20px;
  display: flex; align-items: center;
  white-space: nowrap;
}
.mb-title img { display: block; }
.mb-apple { padding: 0 12px 0 14px; }
.mb-apple img { width: 14px; height: 16px; }
.mb-help { padding: 0 10px; }
.mb-help img { width: 16px; height: 16px; }
.mb-app { padding: 0 12px 0 8px; border-left: none; }
.mb-app img { width: 16px; height: 16px; margin-right: 5px; }
.mb-app span { display: inline-block; }
.mb-clock { padding: 0 12px; display: flex; align-items: center; white-space: nowrap; }
.mb-title.open, .mb-title:active { background: #000; color: #fff; }
.mb-title.open img, .mb-title:active img { filter: invert(1); }

/* pull-down menu */
.menu {
  position: fixed;
  min-width: 190px;
  background: #fff;
  border: 1px solid #000;
  box-shadow: 1px 1px 0 #777;
  z-index: 100001;
  padding: 3px 0;
}
.menu-item {
  display: flex; align-items: center;
  padding: 1px 12px 1px 4px;
  white-space: nowrap;
  min-height: 17px;
  cursor: default;
}
.menu-item .mi-check { width: 18px; text-align: center; flex: 0 0 18px; }
.menu-item .mi-label { flex: 1 1 auto; padding-right: 18px; display: flex; align-items: center; }
.menu-item .mi-icon { width: 16px; height: 16px; margin-right: 6px; }
.menu-item .mi-short { flex: 0 0 auto; }
.menu-item.hot { background: #000; color: #fff; }
.menu-item.hot .mi-icon { filter: invert(1); }
.menu-item.disabled { color: #888; text-shadow: 1px 0 #ddd; }
.menu-item.disabled .mi-icon { opacity: 0.35; }
.menu-item.dash { padding: 0; height: 9px; }
.menu-item.dash .dashline {
  display: block; margin: 4px 2px; height: 0; width: 100%;
  border-bottom: 1px solid #888;
}

/* ============ desktop ============ */
#desktop {
  position: fixed;
  top: 21px; left: 0; right: 0; bottom: 0;
  /* the classic 50% black/white dither "gray" desktop */
  background-image:
    repeating-conic-gradient(#000 0% 25%, #fff 0% 50%);
  background-size: 2px 2px;
  overflow: hidden;
}
#desktop.preboot { visibility: hidden; }

/* desktop & finder icons */
.dsk-icon {
  position: absolute;
  width: 64px;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 2px;
  cursor: default;
  touch-action: none;
}
.dsk-icon .dsk-img { width: 32px; height: 32px; }
.dsk-icon .dsk-label {
  margin-top: 2px;
  padding: 0 3px;
  max-width: 112px;
  min-width: 20px;
  text-align: center;
  line-height: 1.15;
  font-size: 12px;
  border: 1px solid transparent;
}
.dsk-icon .dsk-label.alias { font-style: italic; }
.dsk-icon.selected .dsk-label { background: #000; color: #fff; }
.dsk-icon.drop-hot .dsk-label { background: #000; color: #fff; }
.dsk-icon.drop-hot::after {
  content: ''; position: absolute; top: -2px; left: 50%; margin-left: -19px;
  width: 36px; height: 36px; border: 1px solid #000;
}
.dsk-icon.sm { width: 84px; flex-direction: row; align-items: flex-start; padding: 1px; }
.dsk-icon.sm .dsk-img { width: 16px; height: 16px; }
.dsk-icon.sm .dsk-label { margin-top: 1px; text-align: left; font-size: 10px; font-family: 'FindersKeepers', Geneva, sans-serif; }

.rename-input {
  font-family: inherit; font-size: 12px;
  width: 110px; text-align: center;
  border: 1px solid #000; outline: none;
  padding: 0 2px; margin-top: 1px;
  background: #fff; color: #000;
}

/* marquee */
.marquee {
  position: absolute;
  border: 1px dotted #000;
  background: rgba(0,0,0,0.04);
  z-index: 5;
  pointer-events: none;
}
.finder-body .marquee { position: absolute; }

/* drag ghost + window outline */
.icon-ghost {
  position: fixed; z-index: 200000; pointer-events: none;
  opacity: 0.75;
}
.icon-ghost img { position: absolute; width: 32px; height: 32px;
  outline: 1px dotted #000; background: rgba(255,255,255,0.5); }
.drag-outline {
  position: absolute; z-index: 200001;
  border: 2px dotted #555;
  background: rgba(255,255,255,0.15);
  pointer-events: none;
}
.finder-body.drop-hot { outline: 2px solid #000; outline-offset: -2px; }
.win.drop-hot { outline: 2px solid #000; }

/* ============ windows ============ */
.win {
  position: absolute;
  background: #fff;
  border: 1px solid #000;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.28);
  display: flex; flex-direction: column;
  min-width: 100px;
}
.wintitle {
  height: 19px; flex: 0 0 19px;
  position: relative;
  border-bottom: 1px solid #000;
  /* six pinstripes with 2px white rails top and bottom */
  background: repeating-linear-gradient(
    to bottom,
    #fff 0, #fff 1px,
    #000 1px, #000 2px
  );
  background-size: 100% 15px;
  background-position: 0 2px;
  background-repeat: repeat-x;
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.wintitle-text {
  background: #fff;
  padding: 0 7px;
  line-height: 19px;
  max-width: 70%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.closebox {
  position: absolute; left: 8px; top: 4px;
  width: 11px; height: 11px;
  background: #fff; border: 1px solid #000;
}
.closebox:active { background: #000; }
.zoombox {
  position: absolute; right: 8px; top: 4px;
  width: 11px; height: 11px;
  background: #fff; border: 1px solid #000;
}
.zoombox-inner {
  position: absolute; right: 0; top: 0;
  width: 5px; height: 5px;
  border-left: 1px solid #000; border-bottom: 1px solid #000;
  background: #fff;
}
.zoombox:active { background: #000; }
.zoombox:active .zoombox-inner { background: #000; }

/* inactive window: no stripes, no controls, title remains */
.win.inactive .wintitle { background: #fff; }
.win.inactive .closebox, .win.inactive .zoombox { display: none; }

.wincontent {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
}
.win.collapsed .wintitle { border-bottom: none; }

.growbox {
  position: absolute; right: 0; bottom: 0;
  width: 15px; height: 15px;
  background: #fff;
  border-left: 1px solid #000; border-top: 1px solid #000;
  cursor: nwse-resize;
  touch-action: none;
}
.growbox-inner {
  position: absolute; right: 2px; bottom: 2px;
  width: 6px; height: 6px;
  border-right: 1px solid #000; border-bottom: 1px solid #000;
}

/* ============ alerts & dialogs ============ */
.win.alert {
  padding: 0;
  border: 1px solid #000;
  outline: 2px solid #fff;
  box-shadow: 0 0 0 3px #000, 4px 4px 0 3px rgba(0,0,0,0.25);
  min-width: 250px; max-width: 340px;
}
.alertbox { display: flex; padding: 16px 14px 6px 16px; gap: 14px; }
.alerticon { width: 32px; height: 32px; flex: 0 0 32px; }
.alerttext { line-height: 1.35; padding-top: 1px; }
.alertbtns {
  display: flex; flex-direction: column; align-items: stretch;
  padding: 8px 16px 14px 0; margin-left: 200px; margin-left: 46%;
  gap: 7px;
}
.alertbtns .macbtn { align-self: flex-end; min-width: 74px; }
.alert-flash { outline-color: #000; }

.macbtn {
  font-family: inherit; font-size: 12px;
  background: #fff; color: #000;
  border: 1px solid #000;
  border-radius: 5px;
  padding: 2px 14px 3px;
  min-width: 64px;
  cursor: default;
}
.macbtn:active { background: #000; color: #fff; }
.macbtn-default { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #000; border-radius: 7px; }
.macbtn-press { background: #000; color: #fff; }

/* ============ Finder windows ============ */
.finder-wrap { display: flex; flex-direction: column; height: 100%; }
.finder-status {
  flex: 0 0 17px;
  border-bottom: 1px solid #000;
  font-family: 'FindersKeepers', Geneva, Verdana, sans-serif;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  white-space: nowrap; overflow: hidden;
}
.finder-body {
  flex: 1 1 auto;
  position: relative;
  overflow: auto;
  background: #fff;
}
.finder-body .dsk-icon { position: absolute; }

/* list views */
.lv { font-family: 'FindersKeepers', Geneva, Verdana, sans-serif; font-size: 10px; }
.lv-head {
  display: flex; border-bottom: 1px solid #000;
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.lv-h { padding: 1px 6px; border-right: 1px dotted #bbb; flex: 0 0 auto; }
.lv-h.sorted { background: #eee; }
.lv-h:active { background: #000; color: #fff; }
.lv-c-name { flex: 1 1 42%; }
.lv-c-size { width: 52px; flex: 0 0 52px; text-align: right; }
.lv-c-kind { width: 92px; flex: 0 0 92px; }
.lv-c-date { width: 128px; flex: 0 0 128px; }
.lv-row { display: flex; line-height: 17px; padding: 0; }
.lv-row.selected { background: #000; color: #fff; }
.lv-row.selected img { filter: invert(1); }
.lv-cell { padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; }
.lv-cell img { width: 16px; height: 16px; margin-right: 4px; }
.lv-cell .alias { font-style: italic; }

/* ============ apps ============ */
.docview-content { overflow: auto; }
.docview { height: 100%; overflow: auto; }
.docview-text {
  padding: 8px 10px;
  font-family: 'FindersKeepers', Geneva, Verdana, sans-serif;
  font-size: 11px; line-height: 1.4;
  white-space: pre-wrap;
  user-select: text; -webkit-user-select: text;
}

.notepad { display: flex; flex-direction: column; height: 100%; }
.notepad-text {
  flex: 1 1 auto;
  border: none; outline: none; resize: none;
  font-family: 'MacMonaco', 'FindersKeepers', Monaco, monospace;
  font-size: 11px; line-height: 1.35;
  padding: 5px 6px;
  background: #fff; color: #000;
  user-select: text; -webkit-user-select: text;
}
.notepad-bar {
  flex: 0 0 15px;
  border-top: 1px solid #000;
  display: flex; justify-content: space-between; align-items: flex-end;
  background: #fff;
}
.np-fold { width: 20px; height: 14px; position: relative; }
.np-fold::after {
  content: ''; position: absolute; bottom: 0;
  border-style: solid;
}
.np-fold-l::after { left: 1px; border-width: 9px 0 0 9px; border-color: transparent transparent transparent #000; }
.np-fold-r::after { right: 1px; border-width: 0 9px 9px 0; border-color: transparent #000 transparent transparent; }
.np-fold:active::after { border-color: #000; filter: none; opacity: 0.5; }

.calc { padding: 7px; display: flex; flex-direction: column; gap: 6px; height: 100%; }
.calc-disp {
  border: 1px solid #000; padding: 3px 6px;
  font-family: 'MacMonaco', Monaco, monospace;
  font-size: 14px; text-align: right;
  background: #fff;
  height: 22px; overflow: hidden;
}
.calc-grid {
  display: grid; flex: 1;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr; gap: 4px;
}
.calc-key {
  font-family: 'ChicagoFLF', inherit; font-size: 12px;
  border: 1px solid #000; background: #fff;
  box-shadow: 1px 1px 0 #888;
}
.calc-key:active { background: #000; color: #fff; box-shadow: none; }
.calc-eq { background: #fff; }
.calc-gap { }

.alarm { padding: 8px; height: 100%; }
.alarm-disp {
  font-family: 'MacMonaco', Monaco, monospace;
  font-size: 15px; text-align: center;
  padding: 4px 0;
  border-bottom: 1px dotted #999;
}
.alarm-row { display: flex; justify-content: flex-end; padding-top: 4px; }
.alarm-mini { font-size: 10px; border: 1px solid #000; background: #fff; padding: 0 6px; }
.alarm-mini:active { background: #000; color: #fff; }
.alarm-panel {
  margin-top: 6px; padding-top: 6px;
  border-top: 1px dotted #999;
  font-family: 'FindersKeepers', Geneva, sans-serif; font-size: 10px;
  display: flex; align-items: center; gap: 6px;
}
.alarm-input { width: 52px; font-family: inherit; font-size: 11px; border: 1px solid #000; padding: 1px 3px; }
.alarm-cb { margin: 0 2px 0 0; }

.puzzle { padding: 6px; }
.puzzle-board { position: relative; margin: 0 auto; background: #fff; border: 1px solid #000; overflow: hidden; }
.puzzle-tile { position: absolute; border: 1px solid #000; }
.puzzle-tile:active { opacity: 0.6; }
.puzzle-hint { font-family: 'FindersKeepers', Geneva, sans-serif; font-size: 9px; text-align: center; padding-top: 4px; color: #333; }

.diskaid { padding: 10px; display: flex; flex-direction: column; gap: 8px; height: 100%; }
.da-top { display: flex; align-items: center; gap: 10px; }
.da-icon { width: 32px; height: 32px; }
.da-vol { font-size: 12px; }
.da-status { font-family: 'FindersKeepers', Geneva, sans-serif; font-size: 10px; min-height: 13px; }
.da-prog { height: 12px; border: 1px solid #000; background: #fff; }
.da-bar { height: 100%; width: 0; background: repeating-linear-gradient(45deg, #000 0 2px, #fff 2px 4px); transition: width 0.12s; }
.da-btns { display: flex; justify-content: flex-end; gap: 8px; }

.getinfo { padding: 9px 10px; display: flex; flex-direction: column; height: 100%; overflow: auto; }
.gi-head { display: flex; align-items: center; gap: 9px; padding-bottom: 6px; border-bottom: 1px solid #000; }
.gi-icon { width: 32px; height: 32px; }
.gi-name { font-size: 13px; }
.gi-rows { padding: 5px 0; font-family: 'FindersKeepers', Geneva, sans-serif; font-size: 10px; }
.gi-row { display: flex; line-height: 14px; }
.gi-k { flex: 0 0 62px; text-align: right; padding-right: 6px; }
.gi-v { flex: 1; word-break: break-word; display: flex; align-items: center; }
.gi-clabel { font-family: 'FindersKeepers', Geneva, sans-serif; font-size: 10px; padding-bottom: 2px; }
.gi-comments {
  flex: 0 0 44px; resize: none;
  border: 1px solid #000; padding: 2px 4px;
  font-family: 'FindersKeepers', Geneva, sans-serif; font-size: 10px;
  user-select: text; -webkit-user-select: text;
}

.findwin { display: flex; flex-direction: column; height: 100%; }
.find-bar { display: flex; align-items: center; gap: 7px; padding: 9px 10px; border-bottom: 1px solid #000; }
.find-lbl { font-size: 12px; }
.find-input { flex: 1; font-family: 'FindersKeepers', Geneva, sans-serif; font-size: 11px; border: 1px solid #000; padding: 2px 5px; }
.find-res { flex: 1; overflow: auto; padding: 4px 0; }
.find-hit { display: flex; align-items: center; gap: 8px; padding: 3px 10px; }
.find-hit:active { background: #000; color: #fff; }
.find-hit:active img { filter: invert(1); }
.find-hit img { width: 16px; height: 16px; }
.find-hit-name { font-size: 11px; }
.find-hit-path { font-family: 'FindersKeepers', Geneva, sans-serif; font-size: 9px; color: #555; }
.find-hit:active .find-hit-path { color: #fff; }
.find-none { padding: 12px; font-family: 'FindersKeepers', Geneva, sans-serif; font-size: 10px; color: #333; }

.clipview { display: flex; flex-direction: column; height: 100%; }
.clip-head { padding: 6px 9px; border-bottom: 1px solid #000; font-family: 'FindersKeepers', Geneva, sans-serif; font-size: 10px; }
.clip-body { flex: 1; overflow: auto; padding: 7px 9px; font-family: 'MacMonaco', Monaco, monospace; font-size: 10px; white-space: pre-wrap; user-select: text; }
.clip-empty { color: #555; font-family: 'FindersKeepers', Geneva, sans-serif; }

.about { display: flex; padding: 12px 14px; gap: 16px; height: 100%; }
.about-left { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.about-apple { width: 60px; }
.about-sys { font-size: 12px; }
.about-ver { font-size: 12px; }
.about-right { flex: 1; font-family: 'FindersKeepers', Geneva, sans-serif; font-size: 10px; }
.about-copy { margin-bottom: 8px; }
.about-mem { margin-bottom: 2px; }
.about-bars { margin-top: 8px; }
.ab-row { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.ab-name { flex: 0 0 92px; text-align: right; }
.ab-track { flex: 1; height: 10px; border: 1px solid #000; }
.ab-fill { height: 100%; background: #000; }
.ab-k { flex: 0 0 38px; }

/* ============ scrollbars — styled like System 7's ============ */
.finder-body, .docview, .getinfo, .find-res, .clip-body {
  scrollbar-width: thin;
}
.finder-body::-webkit-scrollbar, .docview::-webkit-scrollbar,
.getinfo::-webkit-scrollbar, .find-res::-webkit-scrollbar,
.clip-body::-webkit-scrollbar {
  width: 15px; height: 15px;
}
.finder-body::-webkit-scrollbar-track, .docview::-webkit-scrollbar-track,
.getinfo::-webkit-scrollbar-track, .find-res::-webkit-scrollbar-track,
.clip-body::-webkit-scrollbar-track {
  background:
    repeating-conic-gradient(#888 0% 25%, #fff 0% 50%) 0 0 / 2px 2px;
  border-left: 1px solid #000;
}
.finder-body::-webkit-scrollbar-thumb, .docview::-webkit-scrollbar-thumb,
.getinfo::-webkit-scrollbar-thumb, .find-res::-webkit-scrollbar-thumb,
.clip-body::-webkit-scrollbar-thumb {
  background: #fff;
  border: 1px solid #000;
  box-shadow: inset 0 0 0 1px #fff;
}
.finder-body::-webkit-scrollbar-button, .docview::-webkit-scrollbar-button,
.getinfo::-webkit-scrollbar-button, .find-res::-webkit-scrollbar-button,
.clip-body::-webkit-scrollbar-button {
  display: none;
}
.finder-body::-webkit-scrollbar-corner, .docview::-webkit-scrollbar-corner {
  background: #fff; border-top: 1px solid #000; border-left: 1px solid #000;
}

/* ============ balloon help ============ */
.balloon {
  position: fixed; z-index: 200002;
  max-width: 210px;
  background: #ffffc8;
  border: 1px solid #000;
  border-radius: 8px 8px 8px 0;
  padding: 4px 7px;
  font-family: 'FindersKeepers', Geneva, sans-serif; font-size: 10px;
  pointer-events: none;
  box-shadow: 1px 1px 0 #888;
}

/* ============ boot / shutdown screens ============ */
.bootscreen {
  position: fixed; inset: 0; z-index: 300000;
  background: #ababab;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.4s;
}
.bootscreen.boot-fade { opacity: 0; }
.boot-mac { width: 64px; height: 64px; }
.boot-msg { margin-top: 18px; font-size: 16px; }
.boot-sub { margin-top: 4px; font-size: 16px; }
.boot-ext {
  position: absolute; bottom: 14px; left: 0; right: 0; height: 40px;
}
.boot-ext img { position: absolute; width: 32px; height: 32px; }
.grayscreen { background: #b3b3b3; }
.boot-btn { margin-top: 22px; font-size: 13px; }

/* ============ cursors ============ */
body { cursor: default; }
.notepad-text, .gi-comments, .docview-text { cursor: text; }
input[type='text'], .rename-input, .find-input, .alarm-input { cursor: text; user-select: text; -webkit-user-select: text; }
body.busy, body.busy * { cursor: wait !important; }

/* ============ small screens ============ */
@media (max-width: 560px) {
  .mb-title { padding: 0 6px; font-size: 11px; }
  .mb-apple { padding: 0 8px 0 10px; }
  .mb-clock { padding: 0 7px; font-size: 11px; }
  .mb-app span { display: none; }   /* icon only, like the pre-7.5 app menu */
  .menu { min-width: 168px; }
  .lv-c-kind { display: none; }
  .alertbtns { margin-left: 30%; }
}
@media (max-width: 380px) {
  .mb-title { padding: 0 4px; font-size: 10px; }
}
