/* Windows 95 base theme. Pixel font: "Pixelated MS Sans Serif" from 98.css (MIT). */
@font-face { font-family: 'W95'; font-weight: 400; font-display: swap; src: url(/vendor/ms_sans_serif.woff2) format('woff2'), url(/vendor/ms_sans_serif.woff) format('woff'); }
@font-face { font-family: 'W95'; font-weight: 700; font-display: swap; src: url(/vendor/ms_sans_serif_bold.woff2) format('woff2'), url(/vendor/ms_sans_serif_bold.woff) format('woff'); }

:root {
  --desktop: #008080;
  --face: #c0c0c0;
  --light: #dfdfdf;
  --shadow: #808080;
  --dark: #0a0a0a;
  --navy: #000080;
  --title-inactive: #808080;
  --ink: #000;
  --paper: #fff;
  --ui: 'W95', 'Tahoma', 'Verdana', sans-serif;
  --mono: 'Courier New', 'Courier', ui-monospace, monospace;
  --raised: inset -1px -1px var(--dark), inset 1px 1px var(--light), inset -2px -2px var(--shadow), inset 2px 2px #fff;
  --btn: inset -1px -1px var(--dark), inset 1px 1px #fff, inset -2px -2px var(--shadow), inset 2px 2px var(--light);
  --pressed: inset -1px -1px #fff, inset 1px 1px var(--dark), inset -2px -2px var(--light), inset 2px 2px var(--shadow);
  --sunken: inset -1px -1px #fff, inset 1px 1px var(--shadow), inset -2px -2px var(--light), inset 2px 2px var(--dark);
  --status: inset -1px -1px var(--light), inset 1px 1px var(--shadow);
  --taskbar-h: 44px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--desktop);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: none;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img { max-width: 100%; }
.px-icon { image-rendering: pixelated; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Windows ---------- */
.window { background: var(--face); box-shadow: var(--raised); padding: 3px; }
.title-bar {
  display: flex; align-items: center; gap: 6px;
  background: var(--navy); color: #fff;
  padding: 3px 3px 3px 4px; min-height: 26px;
  user-select: none;
}
.title-bar.inactive { background: var(--title-inactive); color: var(--face); }
.title-bar .px-icon { width: 16px; height: 16px; }
.title-bar-text { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-bar-controls { display: flex; gap: 2px; flex: none; }
.title-bar-controls button {
  width: 22px; height: 20px; min-width: 0; min-height: 0; padding: 0;
  display: grid; place-items: center;
}
.title-bar-controls button + button:last-child { margin-left: 2px; }
.title-bar-controls svg { width: 10px; height: 10px; shape-rendering: crispEdges; }
.window-body { margin: 8px; }
.window.collapsed .window-body, .window.collapsed .menu-bar, .window.collapsed .status-bar { display: none; }

.menu-bar { display: flex; gap: 2px; padding: 2px 4px; font-size: 14px; }
.menu-bar span { padding: 2px 6px; }
.menu-bar span::first-letter { text-decoration: underline; }

.status-bar { display: flex; gap: 2px; margin: 2px 0 0; font-size: 13px; }
.status-bar-field { box-shadow: var(--status); padding: 3px 6px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-bar-field.fit { flex: none; }

/* ---------- Controls ---------- */
button, .btn {
  font: inherit; font-size: 15px; color: var(--ink);
  background: var(--face); border: 0; border-radius: 0;
  box-shadow: var(--btn);
  min-height: 34px; min-width: 80px; padding: 4px 14px;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  -webkit-appearance: none; appearance: none;
  touch-action: manipulation;
}
button:active, .btn:active, button.active { box-shadow: var(--pressed); }
button:active > *, .btn:active > * { transform: translate(1px, 1px); }
button:focus-visible, .btn:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
button.default { box-shadow: inset 0 0 0 1px var(--dark), inset -2px -2px var(--dark), inset 2px 2px #fff, inset -3px -3px var(--shadow), inset 3px 3px var(--light); }
button:disabled { color: var(--shadow); text-shadow: 1px 1px 0 #fff; cursor: default; }

input[type=text], input[type=url], input[type=password], input[type=tel], input[type=email], input[type=number], textarea, select {
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--paper); border: 0; border-radius: 0;
  box-shadow: var(--sunken); padding: 7px 8px; width: 100%;
  -webkit-appearance: none; appearance: none;
}
textarea { font-family: var(--mono); line-height: 1.45; resize: vertical; min-height: 110px; }
input:focus, textarea:focus, select:focus { outline: 1px dotted #000; outline-offset: -4px; }
select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' shape-rendering='crispEdges'%3E%3Crect width='22' height='22' fill='%23c0c0c0'/%3E%3Cpath d='M0 0h21v1H1v20H0z' fill='%23dfdfdf'/%3E%3Cpath d='M1 1h19v1H2v18H1z' fill='%23fff'/%3E%3Cpath d='M21 0h1v22H0v-1h21z' fill='%230a0a0a'/%3E%3Cpath d='M20 1h1v20H1v-1h19z' fill='%23808080'/%3E%3Cpath d='M7 9h8v1h-1v1h-1v1h-1v1h-2v-1H9v-1H8v-1H7z' fill='%23000'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 3px center;
}

.field { box-shadow: var(--sunken); background: var(--paper); padding: 2px; }
.field-inset { box-shadow: var(--status); padding: 4px 8px; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; min-height: 32px; user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 18px; height: 18px; background: #fff; box-shadow: var(--sunken); display: grid; place-items: center; flex: none; }
.check input:checked + .box::after { content: ''; width: 9px; height: 9px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath d='M7 0H6v1H5v1H4v1H3v1H2V3H1V2H0v3h1v1h1v1h1V6h1V5h1V4h1V3h1V0z'/%3E%3C/svg%3E") center / contain no-repeat; }
.check input:focus-visible + .box { outline: 1px dotted #000; outline-offset: 2px; }

fieldset { border: 0; box-shadow: inset -1px -1px #fff, inset 1px 1px var(--shadow), inset -2px -2px var(--shadow), inset 2px 2px #fff; padding: 14px 12px 12px; margin: 0; position: relative; }
legend { background: var(--face); padding: 0 4px; font-size: 14px; }

hr.etched { border: 0; height: 2px; box-shadow: inset 0 1px var(--shadow), inset 0 -1px #fff; margin: 10px 0; }

/* ---------- Dialog overlay ---------- */
.overlay { position: fixed; inset: 0; background: transparent; display: grid; place-items: center; padding: 16px; z-index: 1000; }
.overlay[hidden] { display: none; }
.dialog { width: min(380px, 100%); }
.dialog .dialog-content { display: flex; gap: 14px; align-items: flex-start; padding: 12px 6px; font-size: 15px; }
.dialog .dialog-buttons { display: flex; justify-content: center; gap: 8px; padding-bottom: 6px; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.shake { animation: shake 0.3s steps(6); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
