:root {
	--face: #c0c0c0;
	--light: #dfdfdf;
	--hilite: #fff;
	--shadow: #808080;
	--dark: #000;
	--title: #000080;
	--title-text: #fff;
	--inactive: #808080;
	--inactive-text: #c0c0c0;
	--sel: #000080;
	--sel-text: #fff;
	--desktop: #008080;
	--field: #fff;
	--text: #000;
	--raised: inset -1px -1px var(--dark), inset 1px 1px var(--hilite), inset -2px -2px var(--shadow), inset 2px 2px var(--light);
	--pressed: inset -1px -1px var(--hilite), inset 1px 1px var(--dark), inset -2px -2px var(--light), inset 2px 2px var(--shadow);
	--sunken: inset -1px -1px var(--hilite), inset 1px 1px var(--shadow), inset -2px -2px var(--light), inset 2px 2px var(--dark);
	--thin-in: inset 1px 1px var(--shadow), inset -1px -1px var(--hilite);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
	font: 11px/1.3 Tahoma, "MS Sans Serif", "Microsoft Sans Serif", Geneva, Verdana, sans-serif;
	color: var(--text);
	background: #000;
	user-select: none;
	-webkit-user-select: none;
	-webkit-font-smoothing: none;
	cursor: default;
}
body.busy, body.busy * { cursor: progress !important; }
svg { display: block; flex: none; }
input, textarea, select, button { font: inherit; color: var(--text); }
input, textarea { user-select: text; -webkit-user-select: text; }
a { color: inherit; }
.noscript { color: #fff; padding: 20px; }

/* ---------- Desktop & wallpapers ---------- */
#desktop { position: fixed; inset: 0 0 28px 0; overflow: hidden; }
:where(#desktop) { background: var(--desktop); }
[data-wall="clouds"] {
	background:
		radial-gradient(ellipse 22% 9% at 18% 22%, #fff 0 30%, rgba(255,255,255,0) 72%),
		radial-gradient(ellipse 14% 7% at 27% 18%, #fff 0 25%, rgba(255,255,255,0) 72%),
		radial-gradient(ellipse 28% 10% at 72% 30%, #fff 0 28%, rgba(255,255,255,0) 72%),
		radial-gradient(ellipse 16% 8% at 82% 25%, #f2f6ff 0 25%, rgba(255,255,255,0) 72%),
		radial-gradient(ellipse 30% 11% at 40% 62%, #fff 0 28%, rgba(255,255,255,0) 72%),
		radial-gradient(ellipse 18% 8% at 51% 57%, #eef4ff 0 25%, rgba(255,255,255,0) 72%),
		radial-gradient(ellipse 24% 9% at 86% 80%, #fff 0 28%, rgba(255,255,255,0) 72%),
		radial-gradient(ellipse 15% 6% at 9% 86%, #fff 0 25%, rgba(255,255,255,0) 72%),
		linear-gradient(#1f4fae, #5d8fe0 55%, #a3c2f2);
}
[data-wall="houndstooth"] { background: repeating-conic-gradient(#000 0 25%, var(--desktop) 0 50%) 0 0 / 6px 6px; }
[data-wall="tiles"] {
	background:
		linear-gradient(90deg, rgba(0,0,0,.35) 1px, transparent 1px) 0 0 / 32px 32px,
		linear-gradient(rgba(0,0,0,.35) 1px, transparent 1px) 0 0 / 32px 32px,
		linear-gradient(135deg, rgba(255,255,255,.18) 25%, transparent 25%) 0 0 / 32px 32px,
		var(--desktop);
}
[data-wall="straw"] {
	background:
		repeating-linear-gradient(45deg, rgba(0,0,0,.12) 0 2px, transparent 2px 6px),
		repeating-linear-gradient(-45deg, #d9bb7a 0 3px, #b89650 3px 6px);
}

.dicon {
	position: absolute;
	width: 74px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 2px;
	touch-action: none;
	outline: none;
}
.dicon .dlabel { color: #fff; text-align: center; line-height: 13px; padding: 0 2px; }
.dicon.sel .dlabel { background: var(--sel); color: var(--sel-text); outline: 1px dotted var(--sel-text); outline-offset: -1px; }
.dicon.sel .dimg svg { filter: brightness(.55) sepia(1) hue-rotate(190deg) saturate(5); }
.dicon.dragging { opacity: .7; }

/* ---------- Bevels, buttons, fields ---------- */
.raised { box-shadow: var(--raised); }
.btn {
	background: var(--face);
	border: 0;
	min-width: 75px;
	height: 23px;
	padding: 0 8px;
	box-shadow: var(--raised);
	border-radius: 0;
}
.btn:active, .btn.pressed { box-shadow: var(--pressed); padding-top: 1px; }
.btn:focus-visible { outline: 1px dotted var(--text); outline-offset: -5px; }
.btn[disabled] { color: var(--shadow); text-shadow: 1px 1px var(--hilite); }
.field, input[type="text"], select, textarea {
	background: var(--field);
	border: 0;
	border-radius: 0;
	box-shadow: var(--sunken);
	padding: 3px 4px;
	outline: none;
}
select { height: 21px; padding: 1px 2px; }
textarea { resize: none; }
fieldset { border: 0; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--hilite), inset 2px 2px var(--hilite), inset -2px -2px var(--shadow); margin: 6px 0; padding: 10px 10px 8px; }
legend { padding: 0 3px; }
label { display: flex; align-items: center; gap: 6px; }
.btnrow { display: flex; gap: 6px; justify-content: flex-end; padding: 8px 2px 2px; flex: none; }
.btnrow.center { justify-content: center; }
.row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.row > span:first-child { min-width: 70px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--shadow); }

/* ---------- Windows ---------- */
#windows { position: fixed; inset: 0 0 28px 0; pointer-events: none; overflow: hidden; }
.window {
	position: absolute;
	pointer-events: auto;
	display: flex;
	flex-direction: column;
	min-width: 180px;
	max-height: 100%;
	padding: 3px;
	background: var(--face);
	color: var(--text);
	box-shadow: var(--raised);
}
.window.min { display: none; }
.window.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; }
.titlebar {
	flex: none;
	height: 18px;
	display: flex;
	align-items: center;
	gap: 3px;
	padding: 0 2px 0 2px;
	background: var(--inactive);
	color: var(--inactive-text);
	font-weight: bold;
	touch-action: none;
}
.window.active > .titlebar { background: var(--title); color: var(--title-text); }
.titlebar .title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 1px; }
.tbtns { display: flex; align-items: center; }
.tbtn {
	width: 16px; height: 14px; padding: 0; border: 0;
	display: grid; place-items: center;
	background: var(--face); box-shadow: var(--raised);
}
.tbtn:active { box-shadow: var(--pressed); }
.tbtn:active svg { transform: translate(1px, 1px); }
.tbtn.close { margin-left: 2px; }
.wbody { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 2px 0 0; }
.window.pad > .wbody { padding: 10px 8px 6px; }
.menubar { flex: none; display: flex; padding: 1px 0 2px; }
.menubar span { padding: 1px 6px; }
.statusbar { flex: none; display: flex; gap: 2px; margin-top: 2px; }
.statusbar span { flex: 1; padding: 2px 4px; box-shadow: var(--thin-in); white-space: nowrap; overflow: hidden; }

/* Message boxes */
.msgrow { display: flex; gap: 14px; align-items: flex-start; padding: 4px 4px 6px; }
.msgtext { padding-top: 2px; line-height: 1.45; max-width: 290px; }

/* Tabs */
.tabs { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tabstrip { display: flex; padding-left: 2px; position: relative; z-index: 1; flex: none; }
.tab {
	border: 0; background: var(--face); padding: 3px 8px 3px; margin-top: 2px;
	border-radius: 3px 3px 0 0;
	box-shadow: inset 1px 1px var(--hilite), inset -1px 0 var(--dark), inset -2px 0 var(--shadow), inset 2px 2px var(--light);
}
.tab.on { margin: 0 -2px -2px; padding: 4px 10px 5px; position: relative; z-index: 2; }
.tab:focus-visible { outline: 1px dotted var(--text); outline-offset: -4px; }
.tabpanel { flex: 1; min-height: 0; box-shadow: var(--raised); padding: 12px 10px; overflow: auto; }

/* ---------- Taskbar ---------- */
#taskbar {
	position: fixed; left: 0; right: 0; bottom: 0; height: 28px;
	display: flex; align-items: center; gap: 3px;
	padding: 2px 2px 0;
	background: var(--face);
	box-shadow: inset 0 1px var(--light), inset 0 2px var(--hilite);
	z-index: 100000;
}
#start { min-width: 0; height: 22px; display: flex; align-items: center; gap: 3px; padding: 0 5px 0 3px; font-weight: bold; }
#tasks { flex: 1; min-width: 0; display: flex; gap: 3px; overflow: hidden; }
.task {
	flex: 0 1 160px; min-width: 34px; height: 22px;
	display: flex; align-items: center; gap: 3px;
	padding: 0 4px; text-align: left; white-space: nowrap; overflow: hidden;
}
.task span { overflow: hidden; text-overflow: ellipsis; }
.task.active {
	box-shadow: var(--pressed);
	font-weight: bold;
	background: repeating-conic-gradient(var(--hilite) 0 25%, var(--face) 0 50%) 0 0 / 2px 2px;
	padding-top: 1px;
}
#tray { height: 22px; display: flex; align-items: center; gap: 6px; padding: 0 9px 0 5px; box-shadow: var(--thin-in); white-space: nowrap; }
#tray.noclock #clock { display: none; }

/* ---------- Menus ---------- */
#startmenu {
	position: fixed; left: 2px; bottom: 25px; z-index: 100001;
	display: flex; padding: 3px;
	background: var(--face); box-shadow: var(--raised);
}
#startmenu[hidden] { display: none; }
.band { width: 21px; background: var(--shadow); display: flex; align-items: flex-end; justify-content: center; }
.band span {
	writing-mode: vertical-rl; transform: rotate(180deg);
	font: 18px/21px "Arial Black", Arial, sans-serif; color: var(--hilite); padding: 6px 0 4px; letter-spacing: .5px;
}
.band b { color: var(--face); font-weight: 900; }
.menu { list-style: none; margin: 0; padding: 0; }
.mi {
	position: relative; display: flex; align-items: center; gap: 6px;
	height: 22px; padding: 0 22px 0 4px; white-space: nowrap;
}
#startmenu > .menu > .mi { height: 34px; min-width: 150px; gap: 10px; padding-left: 6px; }
.mi:hover, .mi.open { background: var(--sel); color: var(--sel-text); }
.mi.disabled { color: var(--shadow); text-shadow: 1px 1px var(--hilite); }
.mi.disabled:hover { text-shadow: none; }
.mi .arrow {
	position: absolute; right: 7px; top: 50%; margin-top: -4px;
	border-left: 4px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
}
.mi .mlabel u { text-decoration: underline; }
.submenu, .ctxmenu {
	position: absolute; left: 100%; top: -3px; display: none;
	min-width: 150px; padding: 2px; color: var(--text);
	background: var(--face); box-shadow: var(--raised); z-index: 1;
}
.mi.open > .submenu { display: block; }
.submenu.flip { left: auto; right: 100%; }
.ctxmenu { display: block; position: fixed; z-index: 100002; }
.sep { height: 2px; margin: 3px 2px; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--hilite); }

/* ---------- Apps ---------- */
.notepad { flex: 1; min-height: 0; font: 13px/1.3 "Fixedsys", "Courier New", monospace; white-space: pre; overflow: auto; }

.calc { display: grid; grid-template-columns: repeat(5, 36px); gap: 5px; padding: 6px 4px 2px; }
.calc .btn { min-width: 0; height: 28px; padding: 0; color: #00008b; }
.calc .btn.op { color: #c00000; }
.calc .wide { grid-column: span 5; display: flex; gap: 5px; justify-content: flex-end; }
.calc .wide .btn { width: 62px; color: #c00000; }
.calc-disp { margin: 6px 4px 2px; text-align: right; font-size: 14px; height: 24px; padding: 3px 6px; }

.listview { flex: 1; min-height: 0; overflow: auto; background: var(--field); box-shadow: var(--sunken); padding: 2px; }
.listview table { width: 100%; border-collapse: collapse; }
.listview th { position: sticky; top: 0; background: var(--face); box-shadow: var(--raised); text-align: left; font-weight: normal; padding: 2px 6px; white-space: nowrap; }
.listview td { padding: 1px 6px; white-space: nowrap; }
.listview tr.sel td { background: var(--sel); color: var(--sel-text); }
.toolbar { display: flex; gap: 2px; padding: 2px 0 4px; flex: none; }
.toolbar .btn { min-width: 0; height: auto; padding: 3px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: none; }
.toolbar .btn:hover { box-shadow: inset 1px 1px var(--hilite), inset -1px -1px var(--shadow); }
.toolbar .btn:active { box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--hilite); }

.iconview { flex: 1; min-height: 0; overflow: auto; background: var(--field); box-shadow: var(--sunken); padding: 8px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; }
.iconview .vi { width: 76px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 3px; text-align: center; outline: none; }
.iconview .vi.sel span:last-child { background: var(--sel); color: var(--sel-text); }

/* Display Properties */
.monitor { width: 184px; height: 158px; margin: 0 auto 10px; position: relative; }
.monitor .bezel { position: absolute; inset: 0 0 26px; background: var(--face); box-shadow: var(--raised); padding: 10px; }
.monitor .scr { width: 100%; height: 100%; box-shadow: var(--sunken); padding: 2px; }
.monitor .scr > div { width: 100%; height: 100%; }
:where(.monitor .scr > div) { background: var(--desktop); }
.monitor .stand { position: absolute; left: 62px; right: 62px; bottom: 6px; height: 20px; background: var(--face); box-shadow: var(--raised); }
.preview { height: 172px; padding: 10px; background: var(--desktop); box-shadow: var(--sunken); position: relative; overflow: hidden; color: var(--text); }
.preview .pw { position: absolute; background: var(--face); box-shadow: var(--raised); padding: 3px; }
.preview .pt { height: 16px; display: flex; align-items: center; padding: 0 3px; font-weight: bold; }
.preview .pt.on { background: var(--title); color: var(--title-text); }
.preview .pt.off { background: var(--inactive); color: var(--inactive-text); }
.preview .pm { display: flex; gap: 10px; padding: 2px 4px; }
.preview .pm .s { background: var(--sel); color: var(--sel-text); padding: 0 3px; }
.preview .pm .d { color: var(--shadow); text-shadow: 1px 1px var(--hilite); }
.preview .pf { background: var(--field); box-shadow: var(--sunken); padding: 4px 6px; height: 34px; }
.preview .msg { padding: 8px 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.preview .msg .btn { min-width: 50px; height: 19px; }
.door { color: #000080; text-decoration: underline; cursor: pointer; }

/* Date/Time */
.cal { display: grid; grid-template-columns: repeat(7, 22px); background: var(--field); box-shadow: var(--sunken); padding: 3px; }
.cal span { text-align: center; line-height: 18px; }
.cal .hd { background: var(--shadow); color: var(--hilite); }
.cal .today { background: var(--sel); color: var(--sel-text); }

/* Encarta */
.encarta > .wbody { padding: 0; background: #10183a; }
.enc-head { flex: none; padding: 8px 12px; background: linear-gradient(90deg, #0b1030, #2a3a7a 60%, #0b1030); color: #f5d77a; border-bottom: 2px solid #c9a43a; }
.enc-head b { font: italic bold 20px/1 Georgia, "Times New Roman", serif; letter-spacing: .5px; }
.enc-head small { display: block; color: #b8c4ef; margin-top: 3px; }
.enc-tools { flex: none; display: flex; gap: 4px; padding: 4px 6px; background: #1b2550; }
.enc-tools .btn { min-width: 0; height: 21px; padding: 0 10px; }
.enc-main { flex: 1; min-height: 0; display: flex; }
.enc-nav { width: 190px; flex: none; overflow: auto; background: #0e1530; color: #dfe6ff; padding: 6px 0; }
.enc-nav .h { padding: 4px 10px; color: #f5d77a; font-weight: bold; text-transform: uppercase; font-size: 10px; letter-spacing: 1px; }
.enc-nav .it { padding: 3px 10px 3px 16px; cursor: pointer; }
.enc-nav .it:hover, .enc-nav .it.on { background: #2c3c86; color: #fff; }
.enc-art { flex: 1; min-width: 0; overflow: auto; background: #fbf6e6; color: #1a1a1a; padding: 14px 18px; font: 13px/1.55 Georgia, "Times New Roman", serif; user-select: text; -webkit-user-select: text; }
.enc-art h1 { font: bold 22px/1.2 Georgia, "Times New Roman", serif; color: #1b2a6b; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid #c9a43a; }
.enc-art p { margin: 0 0 10px; }
.enc-art .lnk { color: #0a6b2a; text-decoration: underline; cursor: pointer; }
.enc-art .dyk { margin: 12px 0; padding: 8px 10px; background: #efe3bd; border-left: 4px solid #c9a43a; font-size: 12px; }
.enc-art .dyk b { display: block; color: #6b4b0a; font: bold 11px Tahoma, sans-serif; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 3px; }
.enc-art .see { font: 11px Tahoma, sans-serif; color: #555; border-top: 1px solid #ddd0a8; padding-top: 6px; }

/* Help */
.help-list { height: 150px; overflow: auto; background: var(--field); box-shadow: var(--sunken); padding: 2px; }
.help-list div { padding: 1px 4px; }
.help-list div.sel { background: var(--sel); color: var(--sel-text); }
.help-text { margin-top: 8px; min-height: 64px; line-height: 1.45; background: #ffffe1; box-shadow: var(--thin-in); padding: 6px 8px; }

/* Shut down */
#shutdown { position: fixed; inset: 0; z-index: 200000; background: #000; display: grid; place-items: center; color: #ff8c1a; font: bold clamp(20px, 4.5vw, 44px)/1.3 "Arial Rounded MT Bold", Arial, sans-serif; text-align: center; cursor: default; }
#shutdown.wait { background: #000; color: transparent; }

@media (max-width: 560px) {
	.enc-nav { width: 130px; }
	#startmenu > .menu > .mi { min-width: 130px; }
}
