:root {
  --face: #d4d0c8;
  --hilite: #ffffff;
  --light: #dfdfdf;
  --shadow: #808080;
  --dark: #404040;
  --title-a: #0a246a;
  --title-b: #a6caf0;
  --title-ia: #808080;
  --title-ib: #c0c0c0;
  --sel: #0a246a;
  --ui: Tahoma, "Segoe UI", Verdana, Geneva, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #000; }
body { font-family: var(--ui); font-size: 12px; color: #000; user-select: none; -webkit-user-select: none; cursor: default; }
button { font-family: var(--ui); font-size: 12px; color: #000; }

/* bevels */
.out { background: var(--face); border: 1px solid; border-color: var(--hilite) var(--dark) var(--dark) var(--hilite); box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--light); }
.in  { border: 1px solid; border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow); box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--light); }
.btn { min-width: 75px; height: 23px; padding: 0 10px; cursor: default; }
.btn:active, .btn.pressed { border-color: var(--dark) var(--hilite) var(--hilite) var(--dark); box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light); padding-top: 1px; padding-left: 11px; }
.btn.default { outline: 1px solid #000; outline-offset: -1px; }
.btn:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }

/* ---------- boot screen ---------- */
#boot {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #000; color: #fff;
}
#boot .band { width: 100%; height: 38%; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 28px;
  background: linear-gradient(#000 0%, #05103a 65%, #0d2470 100%); }
#boot .mid { width: 100%; flex: 1; background: linear-gradient(#0d2470, #000 6%, #000); display: flex; flex-direction: column; align-items: center; padding-top: 34px; gap: 28px; }
.brand { display: flex; align-items: center; gap: 18px; }
.orb {
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 38% 34%, #fff6d0 0%, #ffc04a 18%, #ff6a1a 46%, #b0200a 72%, #3a0600 100%);
  box-shadow: 0 0 22px rgba(255,110,30,.7), 0 0 60px rgba(255,70,10,.35);
  animation: orb 3.6s ease-in-out infinite;
}
@keyframes orb { 50% { box-shadow: 0 0 14px rgba(255,110,30,.55), 0 0 36px rgba(255,70,10,.25); filter: brightness(.92); } }
.word { font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif; line-height: 1; }
.word .w1 { font-size: 46px; font-weight: bold; letter-spacing: -.5px; }
.word .w1 sup { font-size: 20px; font-weight: normal; vertical-align: top; position: relative; top: 4px; margin-left: 4px; color: #ffb35c; }
.word .w2 { font-size: 22px; margin-top: 6px; color: #e8e8e8; }
.word .w3 { font-size: 11px; margin-top: 8px; color: #9fb0d8; letter-spacing: .04em; }
.progress { width: 230px; height: 16px; padding: 2px; border: 1px solid #6f7fa8; overflow: hidden; position: relative; }
.progress i { position: absolute; top: 2px; bottom: 2px; width: 60px; display: flex; gap: 2px; animation: slide 1.6s linear infinite; }
.progress i b { flex: 1; background: linear-gradient(#9fc0ff, #2d5fd0 60%, #1d3f9a); }
@keyframes slide { from { left: -64px; } to { left: 234px; } }
#boot .starting { color: #c8c8c8; font-size: 12px; }
#boot .copy { position: absolute; bottom: 18px; color: #6c6c6c; font-size: 11px; }

/* ---------- log on ---------- */
#logon { position: fixed; inset: 0; z-index: 900; background: #3a6ea5; display: none; align-items: center; justify-content: center; }
#logon .dlg { width: 412px; max-width: calc(100vw - 20px); }
#logon .banner { height: 72px; display: flex; align-items: center; gap: 12px; padding: 0 16px; color: #fff;
  background: linear-gradient(90deg, #000 0%, #0a1d5a 55%, #2a4ea8 100%); border-bottom: 3px solid; border-image: linear-gradient(90deg, #ff6a1a, #ffb35c, #ff6a1a) 1; }
#logon .banner .orb { width: 40px; height: 40px; }
#logon .banner .w1 { font-size: 26px; }
#logon .banner .w1 sup { font-size: 12px; top: 2px; }
#logon .banner .w2 { font-size: 13px; margin-top: 3px; }
.form { padding: 16px 14px 12px; display: grid; grid-template-columns: 80px 1fr; gap: 8px 10px; align-items: center; }
.field { height: 21px; background: #fff; padding: 2px 4px; display: flex; align-items: center; font-size: 12px; }
.field.disabled { background: var(--face); color: var(--shadow); }
.actions { display: flex; justify-content: flex-end; gap: 6px; padding: 0 14px 14px; }

/* ---------- desktop ---------- */
#desktop { position: fixed; inset: 0 0 30px 0; overflow: hidden; overflow: clip;
  background:
    radial-gradient(circle at 58% 46%, rgba(255,140,40,.20) 0, rgba(255,80,20,.10) 10%, rgba(0,0,0,0) 32%),
    linear-gradient(160deg, #0e2758 0%, #0a1a3c 45%, #050a18 100%);
}
.core-wall { position: absolute; left: 58%; top: 46%; width: 190px; height: 190px; margin: -95px 0 0 -95px; border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #fff3c8 0%, #ffbf55 14%, #ff6c1c 38%, #b8260b 62%, rgba(80,10,0,0) 72%);
  filter: blur(1px); opacity: .85; animation: corebreath 5s ease-in-out infinite; pointer-events: none; }
.core-wall::after { content: ""; position: absolute; inset: -60px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,110,30,.25), rgba(255,60,10,0) 65%); animation: corebreath 5s ease-in-out infinite reverse; }
@keyframes corebreath { 50% { transform: scale(.94); opacity: .7; } }
.rings { position: absolute; left: 58%; top: 46%; pointer-events: none; }
.rings span { position: absolute; border: 1px solid rgba(255,170,90,.18); border-radius: 50%; transform: translate(-50%,-50%); animation: ring 9s linear infinite; }
@keyframes ring { from { width: 190px; height: 190px; opacity: .9; } to { width: 900px; height: 900px; opacity: 0; } }
.watermark { position: absolute; right: 12px; bottom: 8px; text-align: right; color: rgba(255,255,255,.75); font-size: 11px; line-height: 1.5; pointer-events: none; }

.icons { position: absolute; top: 8px; left: 6px; display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 76px); gap: 4px 8px; height: calc(100% - 16px); }
.icon { width: 76px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 2px; cursor: default; }
.icon .img { width: 32px; height: 32px; position: relative; }
.icon .img svg { width: 32px; height: 32px; display: block; }
.icon .label { color: #fff; font-size: 11px; text-align: center; line-height: 13px; padding: 0 2px; text-shadow: 1px 1px 1px #000; max-width: 74px; word-wrap: break-word; }
.icon.sel .img { filter: brightness(.55) sepia(1) hue-rotate(190deg) saturate(4); }
.icon.sel .label { background: var(--sel); text-shadow: none; outline: 1px dotted #fff; }
.marquee { position: absolute; border: 1px dotted #fff; pointer-events: none; display: none; }

/* ---------- windows ---------- */
.win { position: absolute; display: flex; flex-direction: column; padding: 3px; min-width: 220px; }
.win.opening { animation: open .16s ease-out; }
@keyframes open { from { transform: scale(.85); opacity: 0; } }
.tb { height: 18px; display: flex; align-items: center; gap: 3px; padding: 0 2px 0 3px; color: #fff; font-weight: bold; font-size: 11px;
  background: linear-gradient(90deg, var(--title-ia), var(--title-ib)); flex: none; touch-action: none; }
.win.active .tb { background: linear-gradient(90deg, var(--title-a), var(--title-b)); }
.tb .ti { width: 16px; height: 16px; flex: none; }
.tb .ti svg { width: 16px; height: 16px; display: block; }
.tb .tt { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb .tbb { display: flex; gap: 0; }
.tb .tbb button { width: 16px; height: 14px; padding: 0; display: flex; align-items: center; justify-content: center; }
.tb .tbb button.x { margin-left: 2px; }
.tb .tbb button svg { width: 8px; height: 7px; display: block; }
.wb { flex: 1; display: flex; flex-direction: column; min-height: 0; margin-top: 2px; }
.menubar { display: flex; gap: 0; padding: 1px 0 2px; flex: none; }
.menubar span { padding: 1px 7px; }
.menubar span:hover { box-shadow: inset 1px 1px var(--hilite), inset -1px -1px var(--shadow); }
.menubar u { text-decoration: underline; }
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; }

/* notepad */
.np { flex: 1; background: #fff; padding: 3px 5px; overflow: auto; font: 13px/1.35 "Lucida Console", "Courier New", monospace; white-space: pre-wrap; user-select: text; -webkit-user-select: text; cursor: text; }
.np .caret { display: inline-block; width: 1px; height: 14px; background: #000; vertical-align: -2px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* explorer */
.toolbar { display: flex; align-items: center; gap: 2px; padding: 2px 2px 3px; border-bottom: 1px solid var(--shadow); box-shadow: 0 1px var(--hilite); flex: none; }
.tbtn { display: flex; align-items: center; gap: 4px; padding: 2px 6px; color: #000; }
.tbtn.off { color: var(--shadow); text-shadow: 1px 1px var(--hilite); }
.tbtn svg { width: 16px; height: 16px; }
.addr { display: flex; align-items: center; gap: 6px; padding: 4px 3px; flex: none; }
.addr .field { flex: 1; gap: 4px; }
.addr .field svg { width: 16px; height: 16px; }
.explorer { flex: 1; display: flex; min-height: 0; background: #fff; }
.webview { width: 190px; flex: none; padding: 14px 12px; background: linear-gradient(#fff 0%, #dbe5f7 55%, #b9cbee 100%); border-right: 1px solid #c8d4ee; overflow: hidden; }
.webview .bigicon svg { width: 48px; height: 48px; }
.webview h2 { font: bold 17px/1.15 var(--ui); margin: 6px 0 4px; color: #000; }
.webview .rule { height: 2px; margin: 4px 0 10px; background: linear-gradient(90deg, #ff7a2a, #ffb35c 50%, rgba(255,255,255,0)); }
.webview p { font-size: 11px; line-height: 1.45; margin-bottom: 8px; color: #222; }
.files { flex: 1; overflow: auto; padding: 4px; }
.frow { display: grid; grid-template-columns: 20px minmax(130px, 1.6fr) minmax(80px, .7fr) 90px; align-items: center; gap: 6px; padding: 2px 4px; white-space: nowrap; }
.frow.head { position: sticky; top: 0; padding: 0; gap: 0; background: var(--face); }
.frow.head span { padding: 2px 6px; border: 1px solid; border-color: var(--hilite) var(--shadow) var(--shadow) var(--hilite); }
.frow.head span:first-child { display: none; }
.frow.head { grid-template-columns: minmax(150px, 1.6fr) minmax(80px, .7fr) 90px; }
.frow svg { width: 16px; height: 16px; display: block; }
.frow.sel { background: var(--sel); color: #fff; }
.redact { display: inline-block; height: .95em; vertical-align: -.12em; background: #000; border-radius: 1px; }
.frow > span { overflow: hidden; text-overflow: ellipsis; }
.frow.sel .redact { background: #fff; }
.statusbar { display: flex; gap: 2px; padding-top: 2px; flex: none; }
.statusbar span { padding: 1px 4px; font-size: 11px; }
.statusbar span:first-child { flex: 1; }

/* task manager */
.tabs { display: flex; padding: 6px 6px 0; gap: 0; flex: none; position: relative; z-index: 1; }
.tab { padding: 3px 10px 2px; border: 1px solid; border-bottom: none; border-color: var(--hilite) var(--dark) transparent var(--hilite); box-shadow: inset -1px 0 var(--shadow); border-radius: 3px 3px 0 0; margin-right: -2px; background: var(--face); }
.tab.on { padding-bottom: 4px; margin-bottom: -1px; position: relative; top: -2px; z-index: 2; }
.tabpage { flex: 1; margin: 0 6px 6px; padding: 10px; border: 1px solid; border-color: var(--hilite) var(--dark) var(--dark) var(--hilite); display: grid; grid-template-columns: 90px 1fr; grid-template-rows: 1fr 1fr auto; gap: 10px 10px; min-height: 0; }
.group { border: 1px solid var(--shadow); box-shadow: 1px 1px var(--hilite), inset 1px 1px var(--hilite); padding: 12px 8px 8px; position: relative; display: flex; flex-direction: column; min-height: 0; }
.group > legend, .group > .lg { position: absolute; top: -8px; left: 6px; background: var(--face); padding: 0 3px; }
.meter { flex: 1; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 4px; min-height: 90px; }
.meter .bars { width: 34px; flex: 1; min-height: 0; display: flex; flex-direction: column-reverse; gap: 1px; overflow: hidden; }
.meter .bars i { flex: 1; min-height: 1px; background: #0a3f0a; }
.meter .bars i.lit { background: #00ff00; }
.meter .bars i.hot { background: #ff8a1a; }
.meter .val { color: #00ff00; font: 11px "Lucida Console", monospace; margin-top: 4px; }
canvas.graph { width: 100%; flex: 1; min-height: 90px; background: #000; display: block; }
.totals { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.totals .group { font-size: 11px; }
.kv { display: flex; justify-content: space-between; line-height: 16px; }

/* mail */
.mailhead { display: grid; grid-template-columns: 62px 1fr; gap: 4px 6px; align-items: center; padding: 6px 6px; flex: none; }
.mailhead .field { font-size: 12px; }
.mailbody { flex: 1; margin: 0 6px 6px; background: #fff; padding: 6px; font: 13px/1.4 Arial, sans-serif; color: #000; overflow: auto; user-select: text; -webkit-user-select: text; outline: none; }
.mailbody:empty::before { content: attr(data-ph); color: #8a8a8a; }
.mailhead input.field { border: 1px solid; border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow); box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--light); font-family: var(--ui); outline: none; }

/* my core */
.drives { flex: 1; background: #fff; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; align-content: start; overflow: auto; }
.drive { display: flex; gap: 8px; align-items: center; padding: 4px; }
.drive svg { width: 32px; height: 32px; flex: none; }
.drive .cap { height: 9px; margin-top: 4px; border: 1px solid #8a8a8a; background: #fff; }
.drive .cap i { display: block; height: 100%; background: #3a6ea5; }
.drive .cap i.full { background: linear-gradient(90deg, #ff8a1a, #d42a0a); }
.drive small { color: #555; font-size: 10px; }
.drive.sel { background: var(--sel); color: #fff; }
.drive.sel small { color: #ddd; }

/* dialogs */
.dlgbody { display: flex; gap: 14px; padding: 14px 14px 6px; align-items: flex-start; max-width: 380px; }
.dlgbody svg { width: 32px; height: 32px; flex: none; }
.dlgbody p { line-height: 1.45; margin-bottom: 8px; }
.dlgbtns { display: flex; justify-content: center; gap: 6px; padding: 8px 14px 12px; }
.run { padding: 12px 12px 4px; display: grid; grid-template-columns: 32px 1fr; gap: 10px 12px; width: 340px; max-width: 100%; }
.run svg { width: 32px; height: 32px; }
.run label { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; }
.run input { flex: 1; height: 21px; border: 1px solid; border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow); box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--light); padding: 0 4px; font: 12px var(--ui); outline: none; }

/* ---------- taskbar ---------- */
#taskbar { position: fixed; left: 0; right: 0; bottom: 0; height: 30px; z-index: 500; display: flex; align-items: center; gap: 4px; padding: 2px 2px 2px 2px;
  background: var(--face); border-top: 1px solid var(--light); box-shadow: inset 0 1px var(--hilite); }
#start { height: 24px; min-width: 0; padding: 0 6px 0 3px; display: flex; align-items: center; gap: 4px; font-weight: bold; }
#start .orb { width: 16px; height: 16px; animation: none; box-shadow: 0 0 3px rgba(255,90,20,.6); }
.sep { width: 2px; height: 22px; border-left: 1px solid var(--shadow); border-right: 1px solid var(--hilite); margin: 0 2px; }
.ql { display: flex; gap: 2px; }
.ql button { width: 22px; height: 22px; padding: 0; background: transparent; border: 1px solid transparent; display: flex; align-items: center; justify-content: center; }
.ql button:hover { border-color: var(--hilite) var(--shadow) var(--shadow) var(--hilite); }
.ql svg { width: 16px; height: 16px; }
#tasks { flex: 1; display: flex; gap: 3px; min-width: 0; overflow: hidden; }
.task { flex: 0 1 160px; min-width: 40px; height: 24px; display: flex; align-items: center; gap: 4px; padding: 0 6px; text-align: left; white-space: nowrap; overflow: hidden; }
.task span { overflow: hidden; text-overflow: ellipsis; }
.task svg { width: 16px; height: 16px; flex: none; }
.task.pressed { font-weight: bold; background-color: #e8e6e1;
  background-image: conic-gradient(var(--hilite) 25%, var(--face) 0 50%, var(--hilite) 0 75%, var(--face) 0); background-size: 2px 2px; }
#tray { height: 24px; display: flex; align-items: center; gap: 6px; padding: 0 8px 0 6px; border: 1px solid; border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow); }
#tray svg { width: 16px; height: 16px; display: block; }
#tray .trayorb { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff2c0, #ff8a2a 45%, #a8200a); box-shadow: 0 0 4px #ff7a2a; animation: orb 2s ease-in-out infinite; cursor: default; }
#clock { font-size: 11px; min-width: 52px; text-align: right; }

/* start menu */
#startmenu { position: fixed; left: 2px; bottom: 28px; z-index: 600; display: none; padding: 2px; width: 250px; }
#startmenu.show { display: flex; animation: rise .12s ease-out; }
@keyframes rise { from { transform: translateY(14px); clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.smbanner { width: 22px; flex: none; background: linear-gradient(#ff6a1a 0%, #8a1c06 30%, #0a246a 60%, #000 100%); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.smbanner span { writing-mode: vertical-rl; transform: rotate(180deg); color: #fff; font: bold 17px/1 "Franklin Gothic Medium", Arial, sans-serif; white-space: nowrap; }
.smbanner span em { font-style: normal; font-weight: normal; color: #ffc48a; }
.smitems { flex: 1; display: flex; flex-direction: column; }
.smi { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px 0 6px; position: relative; }
.smi svg { width: 24px; height: 24px; flex: none; }
.smi.small { height: 26px; }
.smi.dis { color: var(--shadow); text-shadow: 1px 1px var(--hilite); }
.smi .arrow { margin-left: auto; font-size: 8px; }
.smi:hover:not(.dis) { background: var(--sel); color: #fff; }
.smsep { height: 2px; margin: 2px 2px; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--hilite); }
.sub { position: absolute; left: 100%; top: -3px; width: 190px; padding: 2px; display: none; color: #000; }
.smi:hover > .sub { display: block; }
.sub .smi { height: 24px; }
.sub .smi svg { width: 16px; height: 16px; }

/* context menu */
#ctx { position: fixed; z-index: 700; width: 160px; padding: 2px; display: none; }
#ctx div { padding: 3px 20px; }
#ctx div:hover { background: var(--sel); color: #fff; }
#ctx .smsep { padding: 0; }
#ctx .smsep:hover { background: none; }

/* balloon */
#balloon { position: fixed; right: 10px; bottom: 40px; z-index: 650; width: 270px; background: #ffffe1; border: 1px solid #000; border-radius: 8px; padding: 8px 10px 10px; display: none; box-shadow: 2px 2px 6px rgba(0,0,0,.35); }
#balloon::after { content: ""; position: absolute; right: 38px; bottom: -12px; border: 12px solid transparent; border-top-color: #000; border-bottom: 0; border-right: 0; }
#balloon::before { content: ""; position: absolute; right: 39px; bottom: -10px; border: 10px solid transparent; border-top-color: #ffffe1; border-bottom: 0; border-right: 0; z-index: 1; }
#balloon b { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
#balloon .bx { position: absolute; right: 6px; top: 5px; width: 14px; height: 14px; border: 1px solid #a0a0a0; border-radius: 2px; font-size: 10px; line-height: 12px; text-align: center; }
#balloon.show { display: block; animation: open .2s ease-out; }

/* shutdown / bsod */
#fade { position: fixed; inset: 0; z-index: 800; pointer-events: none; background: #000; opacity: 0; transition: opacity 1.2s; }
#fade.dim { opacity: .5; pointer-events: auto; background-image: repeating-conic-gradient(#000 0 25%, transparent 0 50%); background-size: 2px 2px; background-color: transparent; transition: none; }
#safe { position: fixed; inset: 0; z-index: 1100; background: #000; color: #ff8a2a; display: none; align-items: center; justify-content: center; font: 26px/1.3 "Franklin Gothic Medium", Arial, sans-serif; text-align: center; padding: 20px; }
#safe small { display: block; font-size: 12px; color: #6c4a2a; margin-top: 20px; font-family: var(--ui); }
#bsod { position: fixed; inset: 0; z-index: 1200; background: #0000aa; color: #fff; display: none; padding: 24px 28px; font: 14px/1.35 "Lucida Console", "Courier New", monospace; white-space: pre-wrap; overflow: auto; }

@media (max-width: 640px) {
  .icons { grid-auto-flow: row; grid-template-columns: repeat(4, 76px); grid-template-rows: none; height: auto; }
  .core-wall, .rings { left: 50%; top: 62%; }
  .webview { display: none; }
  .watermark { display: none; }
  .ql { display: none; }
  .task { flex-basis: 110px; }
  .totals { grid-template-columns: 1fr; }
}
