@font-face { font-family: 'MS Sans Serif'; src: local('Tahoma'); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden;
  font-family: 'MS Sans Serif', Tahoma, 'Segoe UI', sans-serif; font-size: 12px;
  -webkit-font-smoothing: none; }

#root { height: 100%; }

/* ---------- Desktop ---------- */
.w95-desktop {
  height: 100vh; width: 100vw;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.04), transparent 60%),
    #008080;
  position: relative; overflow: hidden; user-select: none;
}

.w95-desk-icons { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 14px; z-index: 1; }
.w95-desk-icon { display: flex; flex-direction: column; align-items: center; width: 64px; cursor: pointer;
  color: #fff; text-align: center; }
.w95-desk-icon-img { font-size: 30px; filter: drop-shadow(1px 1px 0 #000); }
.w95-desk-icon span { font-size: 11px; padding: 1px 3px; margin-top: 2px; line-height: 1.2;
  text-shadow: 1px 1px 0 #000; }
.w95-desk-icon:hover span { background: #000080; }

/* ---------- Window chrome ---------- */
.w95-window { background: #c0c0c0; border: 2px solid; border-color: #dfdfdf #000 #000 #dfdfdf;
  box-shadow: 1px 1px 0 #0a0a0a; }
.w95-titlebar { background: linear-gradient(90deg, #000080, #1084d0); color: #fff; font-weight: bold;
  padding: 2px 3px; display: flex; justify-content: space-between; align-items: center; cursor: move; }
.w95-title-text { display: flex; align-items: center; gap: 4px; padding-left: 2px; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w95-title-icon { font-size: 13px; }
.w95-title-btns { display: flex; gap: 2px; }
.w95-tbtn { background: #c0c0c0; color: #000; border: 1px solid; border-color: #dfdfdf #000 #000 #dfdfdf;
  width: 17px; height: 15px; line-height: 12px; font-size: 10px; font-weight: bold; cursor: pointer; padding: 0; }
.w95-tbtn:active { border-color: #000 #dfdfdf #dfdfdf #000; }
.w95-window-body { padding: 0; }

.w95-floating { position: absolute; z-index: 20; }

/* ---------- Menu bar ---------- */
.w95-menubar { display: flex; gap: 2px; padding: 1px 3px; background: #c0c0c0;
  border-bottom: 1px solid #808080; }
.w95-menu-item { padding: 2px 8px; font-size: 12px; cursor: pointer; }
.w95-menu-item:hover { background: #000080; color: #fff; }

/* ---------- Main window layout ---------- */
.w95-main-wrap { position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 5; max-width: 96vw; }
.w95-main-window { width: 720px; max-width: 96vw; max-height: calc(100vh - 60px); }
.w95-builder-body { display: flex; gap: 8px; padding: 8px; flex-wrap: wrap;
  max-height: calc(100vh - 120px); overflow: auto; }
.w95-editor-col { flex: 1 1 340px; min-width: 300px; }
.w95-config-col { flex: 1 1 300px; min-width: 260px; }
.w95-config-col-solo { flex: 1 1 100%; max-width: 460px; margin: 0 auto; }

/* ---------- Toolbar ---------- */
.w95-toolbar { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 4px;
  background: #c0c0c0; padding: 3px; border: 1px solid; border-color: #dfdfdf #808080 #808080 #dfdfdf; }
.w95-tool { width: 30px; height: 28px; background: #c0c0c0; border: 2px solid;
  border-color: #dfdfdf #000 #000 #dfdfdf; cursor: pointer; font-size: 14px; padding: 0;
  display: flex; align-items: center; justify-content: center; }
.w95-tool:active, .w95-tool-active { border-color: #000 #dfdfdf #dfdfdf #000; background: #b0b0b0; }

/* ---------- Canvas ---------- */
.w95-canvas-frame { border: 2px solid; border-color: #808080 #dfdfdf #dfdfdf #808080; padding: 2px;
  background: #808080; display: inline-block; max-width: 100%; }
.w95-canvas { image-rendering: pixelated; display: block; cursor: crosshair;
  width: 100%; max-width: 480px; height: auto; touch-action: none; background: #fff; }

/* ---------- Palette ---------- */
.w95-palette-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.w95-color-indicator { width: 28px; height: 28px; border: 2px solid; border-color: #808080 #dfdfdf #dfdfdf #808080; flex: 0 0 auto; }
.w95-palette { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1px;
  border: 2px solid; border-color: #808080 #dfdfdf #dfdfdf #808080; padding: 1px; flex: 1; }
.w95-swatch { width: 100%; aspect-ratio: 1; border: 1px solid #808080; cursor: pointer; padding: 0; min-height: 14px; }
.w95-swatch:active { transform: scale(0.9); }

/* ---------- Buttons ---------- */
.w95-btn { background: #c0c0c0; border: 2px solid; border-color: #dfdfdf #000 #000 #dfdfdf;
  padding: 3px 10px; font-family: inherit; font-size: 12px; cursor: pointer; min-width: 60px; }
.w95-btn:active, .w95-btn-active { border-color: #000 #dfdfdf #dfdfdf #000; }
.w95-btn:disabled { color: #808080; cursor: default; }
.w95-btn-wide { min-width: 80px; }

/* ---------- Config form ---------- */
.w95-fieldset { border: 1px solid #808080; border-top-color: #dfdfdf; border-left-color: #dfdfdf;
  margin: 0 0 8px 0; padding: 8px; }
.w95-fieldset legend { font-size: 11px; padding: 0 4px; font-weight: bold; }
.w95-label { display: block; font-size: 11px; margin: 4px 0 1px; }
.w95-input { width: 100%; border: 2px solid; border-color: #808080 #dfdfdf #dfdfdf #808080;
  background: #fff; padding: 2px 3px; font-family: inherit; font-size: 12px; margin-bottom: 2px; }
select.w95-input { padding: 1px; }
.w95-check { display: flex; align-items: center; font-size: 11px; margin-top: 6px; cursor: pointer; gap: 2px; }

/* ---------- Preview ---------- */
.w95-preview-win { background: #c0c0c0; border: 2px solid; border-color: #dfdfdf #000 #000 #dfdfdf; }
.w95-preview-tbar { background: linear-gradient(90deg,#000080,#1084d0); color: #fff; font-size: 10px;
  font-weight: bold; padding: 2px 4px; }
.w95-preview-btn { background: #c0c0c0; border: 1px solid; border-color: #dfdfdf #000 #000 #dfdfdf;
  font-size: 9px; padding: 1px 6px; }

/* ---------- Compile button ---------- */
.w95-compile-btn { width: 100%; background: linear-gradient(#d8d8d8, #c0c0c0);
  border: 2px solid; border-color: #dfdfdf #000 #000 #dfdfdf; padding: 8px; font-family: inherit;
  font-size: 14px; font-weight: bold; cursor: pointer; margin-top: 4px; }
.w95-compile-btn:active { border-color: #000 #dfdfdf #dfdfdf #000; }

/* ---------- Modals ---------- */
.w95-modal-overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  z-index: 100; background: rgba(0,0,0,.12); }
.w95-msgbox { min-width: 260px; max-width: 90vw; }
.w95-compile-dialog { width: 360px; max-width: 92vw; }
.w95-console { background: #000; color: #00ff00; font-family: 'Courier New', monospace; font-size: 11px;
  height: 96px; overflow: hidden; padding: 4px; border: 2px solid; border-color: #808080 #dfdfdf #dfdfdf #808080;
  display: flex; flex-direction: column; justify-content: flex-end; }
.w95-progress { border: 2px solid; border-color: #808080 #dfdfdf #dfdfdf #808080; background: #fff;
  height: 22px; margin-top: 8px; padding: 2px; }
.w95-progress-fill { height: 100%; display: flex; gap: 2px; transition: width .2s; }
.w95-progress-block { flex: 1; background: #000080; min-width: 8px; }

/* ---------- Notepad ---------- */
.w95-notepad { background: #fff; border: 2px solid; border-color: #808080 #dfdfdf #dfdfdf #808080;
  padding: 6px; font-family: 'Courier New', monospace; font-size: 11px; white-space: pre-wrap;
  height: 340px; overflow: auto; margin: 4px; line-height: 1.35; }

/* ---------- Start menu ---------- */
.w95-startmenu { position: fixed; bottom: 30px; left: 2px; width: 200px; z-index: 60;
  background: #c0c0c0; border: 2px solid; border-color: #dfdfdf #000 #000 #dfdfdf;
  box-shadow: 2px 2px 0 #0a0a0a; display: flex; }
.w95-startmenu-bar { background: linear-gradient(#000080, #1084d0); color: #fff; writing-mode: vertical-rl;
  transform: rotate(180deg); font-weight: bold; font-size: 16px; padding: 8px 4px; display: flex; align-items: center; gap: 6px; }
.w95-startmenu-item { padding: 6px 12px; font-size: 12px; cursor: pointer; display: flex; align-items: center; }
.w95-startmenu-item:hover { background: #000080; color: #fff; }
.w95-start-backdrop { position: fixed; inset: 0; z-index: 55; }

/* ---------- Taskbar ---------- */
.w95-taskbar { position: fixed; bottom: 0; left: 0; right: 0; height: 30px; background: #c0c0c0;
  border-top: 2px solid #dfdfdf; display: flex; align-items: center; padding: 2px 3px; gap: 3px; z-index: 50; }
.w95-start-btn { background: #c0c0c0; border: 2px solid; border-color: #dfdfdf #000 #000 #dfdfdf;
  font-family: inherit; font-weight: bold; font-size: 12px; padding: 2px 8px; cursor: pointer;
  display: flex; align-items: center; gap: 3px; }
.w95-flag { font-size: 13px; }
.w95-task-divider { width: 2px; height: 22px; border-left: 1px solid #808080; border-right: 1px solid #dfdfdf; }
.w95-task-item { background: #c0c0c0; border: 2px solid; border-color: #dfdfdf #000 #000 #dfdfdf;
  padding: 2px 8px; font-size: 11px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w95-tray { border: 1px solid; border-color: #808080 #dfdfdf #dfdfdf #808080; padding: 2px 6px;
  display: flex; align-items: center; gap: 6px; font-size: 11px; }
.w95-clock { font-variant-numeric: tabular-nums; }

/* ---------- BSOD ---------- */
.w95-bsod { position: fixed; inset: 0; background: #0000aa; color: #fff; z-index: 999;
  font-family: 'Courier New', monospace; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.w95-bsod-inner { max-width: 600px; padding: 20px; font-size: 15px; line-height: 1.5; }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .w95-main-window { width: 100%; }
  .w95-builder-body { flex-direction: column; max-height: none; }
  .w95-desk-icons { flex-direction: row; flex-wrap: wrap; }
  .w95-main-wrap { top: 84px; left: 0; transform: none; width: 100%; max-width: 100vw; }
  .w95-editor-col, .w95-config-col { min-width: 0; }
}