/* ═══════════════════════════════════════════════════════════════════════
   AliOS — desktop environment stylesheet
   Sections: tokens · primitives · desktop · icons · windows · taskbar
             popovers · boot · login · power · saver · bsod · apps
   ═══════════════════════════════════════════════════════════════════════ */

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

/* ── TOKENS ─────────────────────────────────────────────────────────── */
:root {
  --accent:      #3b82f6;
  --accent-hi:   #60a5fa;
  --accent-dim:  rgba(59,130,246,0.18);
  --accent-line: rgba(59,130,246,0.42);

  --bg:        #050b14;
  --chrome:    rgba(9,16,30,0.82);
  --chrome-op: #0b1322;
  --surface:   rgba(13,22,40,0.94);
  --surface-2: rgba(255,255,255,0.035);
  --sunken:    rgba(0,0,0,0.28);
  --stroke:    rgba(255,255,255,0.09);
  --stroke-hi: rgba(255,255,255,0.16);

  --txt:       #e2e8f0;
  --txt-dim:   #94a3b8;
  --txt-faint: #64748b;

  --green: #10b981;
  --red:   #ef4444;
  --amber: #f59e0b;
  --cyan:  #06b6d4;
  --violet:#8b5cf6;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;

  --shadow:    0 18px 50px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.4);
  --shadow-hi: 0 30px 80px rgba(0,0,0,0.7), 0 3px 12px rgba(0,0,0,0.5);
  --pop-shadow:0 20px 60px rgba(0,0,0,0.6);

  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --tb-h: 52px;

  color-scheme: dark;
}

html[data-theme="light"] {
  --chrome:    rgba(248,250,252,0.84);
  --chrome-op: #eef2f7;
  --surface:   rgba(252,253,255,0.96);
  --surface-2: rgba(15,23,42,0.035);
  --sunken:    rgba(15,23,42,0.05);
  --stroke:    rgba(15,23,42,0.12);
  --stroke-hi: rgba(15,23,42,0.2);
  --txt:       #0f172a;
  --txt-dim:   #475569;
  --txt-faint: #94a3b8;
  --shadow:    0 18px 50px rgba(15,23,42,0.18), 0 2px 8px rgba(15,23,42,0.1);
  --shadow-hi: 0 30px 80px rgba(15,23,42,0.28);
  --pop-shadow:0 20px 60px rgba(15,23,42,0.22);
  color-scheme: light;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--sans);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
}
body { user-select: none; }

.svg-defs { position: absolute; width: 0; height: 0; pointer-events: none; }

/* ── PRIMITIVES ─────────────────────────────────────────────────────── */
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
svg { display: block; flex-shrink: 0; }
.ico { display: block; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--stroke-hi); border-radius: 99px;
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--txt-faint); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--stroke);
  color: var(--txt); font-size: 12.5px; font-weight: 500;
  transition: background .14s, border-color .14s, transform .1s var(--ease);
  white-space: nowrap;
}
.btn:hover  { background: var(--accent-dim); border-color: var(--accent-line); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.danger:hover { background: rgba(239,68,68,0.16); border-color: rgba(239,68,68,0.5); color: #fca5a5; }
.btn:disabled { opacity: .4; pointer-events: none; }

.fld {
  background: var(--sunken); border: 1px solid var(--stroke);
  border-radius: var(--r-sm); padding: 8px 11px;
  font-size: 13px; color: var(--txt); outline: none; width: 100%;
  transition: border-color .14s, box-shadow .14s;
}
.fld:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-dim); }
.fld::placeholder { color: var(--txt-faint); }

.mono { font-family: var(--mono); }
.dim  { color: var(--txt-dim); }
.faint{ color: var(--txt-faint); }

/* ── SCREEN + DESKTOP ───────────────────────────────────────────────── */
#screen { position: fixed; inset: 0; overflow: hidden; }
#wall   { position: absolute; inset: 0; width: 100%; height: 100%; }
#wallTint {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 120%, transparent 40%, rgba(0,0,0,0.45) 100%);
}
#desktop { position: absolute; inset: 0 0 var(--tb-h) 0; }
#iconLayer, #winLayer { position: absolute; inset: 0; }
#iconLayer { z-index: 1; }
#winLayer  { z-index: 2; pointer-events: none; }
#winLayer > * { pointer-events: auto; }

#screen.peek #winLayer { opacity: 0; transform: scale(0.99); transition: opacity .18s, transform .18s; }

#rubber {
  position: absolute; z-index: 5;
  border: 1px solid var(--accent-line);
  background: var(--accent-dim);
  border-radius: 2px; pointer-events: none;
}

/* ── DESKTOP ICONS ──────────────────────────────────────────────────── */
.dicon {
  position: absolute; width: 84px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 4px 6px; border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: background .1s, border-color .1s;
}
.dicon .ico { width: 42px; height: 42px; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5)); }
.dicon .lbl {
  font-size: 11.5px; line-height: 1.28; text-align: center; color: #f1f5f9;
  text-shadow: 0 1px 3px rgba(0,0,0,0.95), 0 0 10px rgba(0,0,0,0.6);
  word-break: break-word; max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dicon:hover { background: rgba(255,255,255,0.08); border-color: var(--stroke); }
.dicon.sel   { background: var(--accent-dim); border-color: var(--accent-line); }
.dicon.sel .lbl { -webkit-line-clamp: 4; }
.dicon.dragging { opacity: .65; z-index: 9; }
.dicon.launch { animation: iconLaunch .3s var(--ease); }
@keyframes iconLaunch { 50% { transform: scale(0.9); } }

/* ── WINDOWS ────────────────────────────────────────────────────────── */
.win {
  position: absolute;
  display: flex; flex-direction: column;
  min-width: 260px; min-height: 160px;
  background: var(--surface);
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .16s, border-color .16s;
}
.win.focus { border-color: var(--stroke-hi); box-shadow: var(--shadow-hi); }
.win.focus .win-bar { background: var(--surface-2); }
.win.max { border-radius: 0; border-color: transparent; }
.win.snapping, .win.restoring { transition: left .16s var(--ease), top .16s var(--ease), width .16s var(--ease), height .16s var(--ease); }
.win.opening { animation: winOpen .19s var(--ease); }
@keyframes winOpen { from { opacity: 0; transform: scale(0.94) translateY(8px); } }
.win.closing { animation: winClose .13s ease-in forwards; pointer-events: none; }
@keyframes winClose { to { opacity: 0; transform: scale(0.95); } }
.win.minning { animation: winMin .16s ease-in forwards; pointer-events: none; }
@keyframes winMin { to { opacity: 0; transform: scale(0.7) translateY(60px); } }
.win.hidden { display: none; }
.win.shake { animation: winShake .4s; }
@keyframes winShake {
  10%,90% { transform: translateX(-2px); } 20%,80% { transform: translateX(4px); }
  30%,50%,70% { transform: translateX(-7px); } 40%,60% { transform: translateX(7px); }
}

.win-bar {
  height: 38px; flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding-left: 12px;
  border-bottom: 1px solid var(--stroke);
  cursor: default;
}
.win-bar .ico { width: 16px; height: 16px; }
.win-bar .t {
  flex: 1; font-size: 12.5px; font-weight: 500; color: var(--txt);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.win:not(.focus) .win-bar .t { color: var(--txt-faint); }
.win-ctl { display: flex; height: 100%; }
.win-ctl button {
  width: 44px; height: 100%;
  display: grid; place-items: center;
  color: var(--txt-dim); transition: background .12s, color .12s;
}
.win-ctl button:hover { background: var(--surface-2); color: var(--txt); }
.win-ctl .x:hover { background: #dc2626; color: #fff; }
.win-ctl svg { width: 10px; height: 10px; }

.win-body { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; }
.win-body.pad { padding: 14px; overflow: auto; }

.rz { position: absolute; z-index: 3; }
.rz-n { top: -3px; left: 8px; right: 8px; height: 7px; cursor: ns-resize; }
.rz-s { bottom: -3px; left: 8px; right: 8px; height: 7px; cursor: ns-resize; }
.rz-w { left: -3px; top: 8px; bottom: 8px; width: 7px; cursor: ew-resize; }
.rz-e { right: -3px; top: 8px; bottom: 8px; width: 7px; cursor: ew-resize; }
.rz-nw{ top: -3px; left: -3px; width: 13px; height: 13px; cursor: nwse-resize; }
.rz-ne{ top: -3px; right: -3px; width: 13px; height: 13px; cursor: nesw-resize; }
.rz-sw{ bottom: -3px; left: -3px; width: 13px; height: 13px; cursor: nesw-resize; }
.rz-se{ bottom: -3px; right: -3px; width: 13px; height: 13px; cursor: nwse-resize; }
.win.max .rz { display: none; }

#snapGhost {
  position: fixed; z-index: 3; pointer-events: none;
  background: var(--accent-dim); border: 2px solid var(--accent-line);
  border-radius: var(--r); backdrop-filter: blur(3px);
  transition: all .12s var(--ease);
}

/* shared app chrome */
.toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 9px; flex-shrink: 0;
  border-bottom: 1px solid var(--stroke);
  background: var(--surface-2);
}
.tbtn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 9px; border-radius: var(--r-sm);
  font-size: 12px; color: var(--txt-dim);
  transition: background .12s, color .12s;
}
.tbtn:hover:not(:disabled) { background: var(--surface-2); color: var(--txt); }
.tbtn.on { background: var(--accent-dim); color: var(--accent-hi); }
.tbtn:disabled { opacity: .35; cursor: default; }
.tbtn svg { width: 15px; height: 15px; }
.tsep { width: 1px; height: 18px; background: var(--stroke); margin: 0 3px; }
.statusbar {
  flex-shrink: 0; display: flex; align-items: center; gap: 14px;
  padding: 5px 11px; border-top: 1px solid var(--stroke);
  background: var(--surface-2);
  font-size: 11px; color: var(--txt-faint); font-family: var(--mono);
}
.statusbar .sp { margin-left: auto; }

/* ── TASKBAR ────────────────────────────────────────────────────────── */
#taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--tb-h); z-index: 40;
  /* Start anchored left, tasks flowing left-to-right beside it, tray right. */
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  padding: 0 6px 0 6px;
  background: var(--chrome);
  backdrop-filter: blur(30px) saturate(1.6);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  border-top: 1px solid var(--stroke);
}
.tb-side { display: flex; align-items: center; gap: 2px; }
.tb-right { justify-content: flex-end; }
.tb-center { display: flex; align-items: center; gap: 3px; min-width: 0; overflow: hidden; }

/* ── START ── */
.tb-start {
  display: flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 14px 0 11px; border-radius: var(--r-sm);
  color: var(--txt); font-size: 12.5px; font-weight: 500;
  transition: background .14s, transform .1s var(--ease);
}
.tb-start-ico {
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-hi), var(--violet));
  box-shadow: 0 2px 8px var(--accent-dim);
  display: grid; place-items: center; position: relative;
  transition: transform .16s var(--ease), box-shadow .16s;
}
.tb-start-ico::after {
  content: 'A'; font-family: var(--sans);
  font-size: 12px; font-weight: 700; color: #fff; line-height: 1;
}
.tb-start:hover { background: var(--surface-2); }
.tb-start:hover .tb-start-ico { transform: scale(1.08); box-shadow: 0 3px 14px var(--accent-line); }
.tb-start:active { transform: scale(0.96); }
.tb-start.on { background: var(--accent-dim); }
.tb-start.on .tb-start-ico { transform: scale(0.94); }

/* ── ABOUT chip (right of the clock) ── */
.tb-brand {
  display: flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--txt-faint); font-size: 11px; font-family: var(--mono);
  transition: background .12s, color .12s;
}
.tb-brand:hover { background: var(--surface-2); color: var(--txt-dim); }
.tb-brand-mark {
  width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
}

.tb-btn, .tb-tray, .tb-clock {
  border-radius: var(--r-sm);
  transition: background .12s, transform .1s var(--ease);
  color: var(--txt-dim);
}
.tb-btn:active, .tb-tray:active { transform: scale(0.9); }
.tb-btn { width: 42px; height: 40px; display: grid; place-items: center; }
.tb-btn:hover, .tb-tray:hover, .tb-clock:hover { background: var(--surface-2); }
.tb-sep { width: 1px; height: 22px; background: var(--stroke); margin: 0 5px; flex-shrink: 0; }

.tb-tasks { display: flex; align-items: center; gap: 3px; }
.tb-task {
  position: relative; height: 40px; padding: 0 11px; border-radius: var(--r-sm);
  display: flex; align-items: center; gap: 8px;
  max-width: 180px; color: var(--txt-dim);
  transition: background .12s;
}
.tb-task .ico { width: 18px; height: 18px; }
.tb-task .t { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-task::after {
  content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 3px; border-radius: 2px; background: var(--txt-faint);
  transition: width .18s var(--ease), background .18s;
}
.tb-task:hover { background: var(--surface-2); color: var(--txt); }
.tb-task.on { background: var(--surface-2); color: var(--txt); }
.tb-task.on::after  { width: 18px; background: var(--accent); }
.tb-task.min::after { width: 8px; }
.tb-task.flash { animation: taskFlash 1s ease-in-out 3; }
@keyframes taskFlash { 50% { background: var(--accent-dim); } }

.tb-tray { width: 34px; height: 34px; display: grid; place-items: center; }
.tb-tray svg { width: 17px; height: 17px; }
.tb-tray.alert { color: var(--amber); }
.tb-clock {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  padding: 5px 10px; font-size: 11px; line-height: 1.25; color: var(--txt-dim);
  font-variant-numeric: tabular-nums;
}
#clkDate { font-size: 10px; color: var(--txt-faint); }
.tb-peek {
  width: 8px; height: 34px; margin-left: 4px; border-left: 1px solid var(--stroke);
  transition: background .12s;
}
.tb-peek:hover { background: var(--surface-2); }

/* ── POPOVERS ───────────────────────────────────────────────────────── */
.pop {
  position: absolute; z-index: 45;
  background: var(--chrome);
  backdrop-filter: blur(34px) saturate(1.7);
  -webkit-backdrop-filter: blur(34px) saturate(1.7);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  box-shadow: var(--pop-shadow);
  overflow: hidden;
  animation: popIn .16s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.pop[hidden] { display: none; }
.pop-h {
  padding: 12px 14px 8px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--txt-faint);
}

/* start menu */
#startMenu { bottom: calc(var(--tb-h) + 8px); left: 6px; transform-origin: bottom left; width: 540px; }
.sm-search { padding: 14px 14px 10px; }
.sm-search-box { position: relative; display: flex; align-items: center; }
.sm-search-box svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--txt-faint); }
.sm-search-box input { padding-left: 34px; height: 36px; border-radius: 99px; }
.sm-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 4px 12px 12px; }
.sm-app {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 4px; border-radius: var(--r-sm); text-align: center;
  transition: background .12s, transform .1s var(--ease);
}
.sm-app .ico { width: 32px; height: 32px; }
.sm-app .lbl { font-size: 10.5px; color: var(--txt-dim); line-height: 1.25; }
.sm-app:hover { background: var(--surface-2); }
.sm-app:hover .lbl { color: var(--txt); }
.sm-app:active { transform: scale(0.94); }
.sm-empty { padding: 24px; text-align: center; font-size: 12px; color: var(--txt-faint); grid-column: 1/-1; }
.sm-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--stroke); background: var(--sunken);
}
.sm-user { display: flex; align-items: center; gap: 9px; flex: 1; padding: 5px; border-radius: var(--r-sm); }
.sm-user:hover { background: var(--surface-2); }
.sm-av {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-hi), var(--violet));
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
}
.sm-uname { font-size: 12px; font-weight: 500; }
.sm-pw { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--txt-dim); }
.sm-pw:hover { background: rgba(239,68,68,0.16); color: #fca5a5; }
.sm-pw svg { width: 16px; height: 16px; }

/* tray panels */
#panelWifi, #panelVol, #panelBat, #panelClock { bottom: calc(var(--tb-h) + 8px); right: 8px; }
#panelWifi { width: 320px; }
#panelVol  { width: 268px; }
#panelBat  { width: 250px; }
#panelClock{ width: 300px; }

.wifi-net {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px; text-align: left; width: 100%;
  transition: background .12s;
}
.wifi-net:hover { background: var(--surface-2); }
.wifi-net.on { background: var(--accent-dim); }
.wifi-net svg { width: 18px; height: 18px; color: var(--txt-dim); flex-shrink: 0; }
.wifi-net.on svg { color: var(--accent-hi); }
.wifi-meta { flex: 1; min-width: 0; }
.wifi-ssid { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wifi-sub  { font-size: 10.5px; color: var(--txt-faint); margin-top: 1px; }
.wifi-sub.warn { color: var(--amber); }
.wifi-sub.ok   { color: var(--green); }
.wifi-form { padding: 0 14px 12px; display: flex; gap: 6px; }
.wifi-err { padding: 0 14px 10px; font-size: 11px; color: #fca5a5; }
.wifi-foot { padding: 10px 14px; border-top: 1px solid var(--stroke); background: var(--sunken); display: flex; align-items: center; gap: 8px; }
.wifi-toggle {
  display: flex; align-items: center; gap: 9px; font-size: 12px;
  padding: 6px 10px; border-radius: var(--r-sm); flex: 1;
}
.wifi-toggle:hover { background: var(--surface-2); }
.sw {
  width: 34px; height: 19px; border-radius: 99px; background: var(--stroke-hi);
  position: relative; flex-shrink: 0; transition: background .16s;
}
.sw::after {
  content: ''; position: absolute; top: 2.5px; left: 2.5px;
  width: 14px; height: 14px; border-radius: 50%; background: var(--txt-dim);
  transition: transform .16s var(--ease), background .16s;
}
.sw.on { background: var(--accent); }
.sw.on::after { transform: translateX(15px); background: #fff; }

.slider-row { display: flex; align-items: center; gap: 11px; padding: 12px 14px; }
.slider-row svg { width: 17px; height: 17px; color: var(--txt-dim); }
input[type="range"] {
  -webkit-appearance: none; appearance: none; flex: 1;
  height: 4px; border-radius: 99px; background: var(--stroke-hi); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid var(--chrome-op);
  box-shadow: 0 0 0 1px var(--accent);
}
input[type="range"]::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 50%; background: var(--accent);
  cursor: pointer; border: 2px solid var(--chrome-op);
}
.slider-val { font-size: 11px; color: var(--txt-faint); font-family: var(--mono); width: 30px; text-align: right; }

.bat-big { padding: 14px; text-align: center; }
.bat-pct { font-size: 30px; font-weight: 300; letter-spacing: -0.02em; }
.bat-note { font-size: 11px; color: var(--txt-faint); margin-top: 4px; line-height: 1.5; }

.cal-head { display: flex; align-items: center; gap: 6px; padding: 12px 14px 8px; }
.cal-title { flex: 1; font-size: 13px; font-weight: 600; }
.cal-nav { width: 26px; height: 26px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--txt-dim); }
.cal-nav:hover { background: var(--surface-2); color: var(--txt); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 0 12px 14px; }
.cal-dow { font-size: 10px; color: var(--txt-faint); text-align: center; padding: 4px 0; font-weight: 600; }
.cal-d {
  aspect-ratio: 1; display: grid; place-items: center;
  font-size: 11.5px; border-radius: var(--r-sm); color: var(--txt-dim);
  font-variant-numeric: tabular-nums;
}
.cal-d:hover { background: var(--surface-2); }
.cal-d.out { color: var(--txt-faint); opacity: .4; }
.cal-d.today { background: var(--accent); color: #fff; font-weight: 600; }
.clock-big { padding: 16px 14px 6px; text-align: center; }
.clock-big .t { font-size: 34px; font-weight: 200; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.clock-big .d { font-size: 11.5px; color: var(--txt-faint); margin-top: 2px; }

/* context menu */
.ctx {
  position: absolute; z-index: 60; min-width: 200px; padding: 5px;
  background: var(--chrome);
  backdrop-filter: blur(30px) saturate(1.6);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  border: 1px solid var(--stroke); border-radius: var(--r);
  box-shadow: var(--pop-shadow);
  animation: ctxIn .1s var(--ease);
}
@keyframes ctxIn { from { opacity: 0; transform: scale(0.97); } }
.ctx[hidden] { display: none; }
.ctx-i {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px; border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--txt); text-align: left;
  transition: background .1s;
}
.ctx-i:hover { background: var(--accent-dim); }
.ctx-i svg { width: 15px; height: 15px; color: var(--txt-dim); }
.ctx-i:hover svg { color: var(--accent-hi); }
.ctx-i .k { margin-left: auto; font-size: 10.5px; color: var(--txt-faint); font-family: var(--mono); }
.ctx-i.danger:hover { background: rgba(239,68,68,0.16); color: #fca5a5; }
.ctx-i.danger:hover svg { color: #fca5a5; }
.ctx-i.off { opacity: .35; pointer-events: none; }
.ctx-sep { height: 1px; background: var(--stroke); margin: 4px 8px; }
.ctx-lbl { padding: 6px 10px 3px; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--txt-faint); }

/* ── NOTIFICATIONS ──────────────────────────────────────────────────── */
#notifs {
  position: fixed; right: 10px; bottom: calc(var(--tb-h) + 10px); z-index: 55;
  display: flex; flex-direction: column-reverse; gap: 8px;
  pointer-events: none;
}
.notif {
  pointer-events: auto; width: 316px;
  display: flex; gap: 11px; padding: 12px 13px;
  background: var(--chrome);
  backdrop-filter: blur(30px) saturate(1.6);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  border: 1px solid var(--stroke); border-left: 3px solid var(--accent);
  border-radius: var(--r); box-shadow: var(--pop-shadow);
  animation: notifIn .3s var(--ease);
}
.notif.out { animation: notifOut .2s ease-in forwards; }
@keyframes notifIn  { from { opacity: 0; transform: translateX(340px); } }
@keyframes notifOut { to  { opacity: 0; transform: translateX(340px); } }
.notif.warn { border-left-color: var(--amber); }
.notif.err  { border-left-color: var(--red); }
.notif.ok   { border-left-color: var(--green); }
.notif .ico { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; }
.notif-b { flex: 1; min-width: 0; }
.notif-t { font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.notif-m { font-size: 11.5px; color: var(--txt-dim); line-height: 1.45; }
.notif-x { align-self: flex-start; color: var(--txt-faint); padding: 2px; border-radius: 4px; }
.notif-x:hover { background: var(--surface-2); color: var(--txt); }
.notif-x svg { width: 11px; height: 11px; }

/* ── MODALS ─────────────────────────────────────────────────────────── */
#modalLayer {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  background: rgba(2,6,14,0.55); backdrop-filter: blur(3px);
  animation: fadeIn .14s;
}
#modalLayer[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: min(420px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--stroke-hi);
  border-radius: var(--r-lg); box-shadow: var(--shadow-hi);
  overflow: hidden; animation: modalIn .18s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 15px 16px 0; }
.modal-h .ico { width: 24px; height: 24px; }
.modal-h .t { font-size: 14px; font-weight: 600; }
.modal-b { padding: 12px 16px 16px; font-size: 12.5px; color: var(--txt-dim); line-height: 1.6; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; background: var(--sunken); border-top: 1px solid var(--stroke); }

/* ── BOOT ───────────────────────────────────────────────────────────── */
#boot {
  position: fixed; inset: 0; z-index: 90; background: #000;
  font-family: var(--mono); font-size: 12.5px; color: #cbd5e1;
  padding: 34px 30px; overflow: hidden;
  transition: opacity .4s ease;
}
#boot.done { opacity: 0; pointer-events: none; }
#boot::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.22) 0 1px, transparent 1px 3px);
}
.boot-post { line-height: 1.62; white-space: pre-wrap; }
.boot-post .ok   { color: #10b981; }
.boot-post .warn { color: #f59e0b; }
.boot-post .err  { color: #ef4444; }
.boot-post .dm   { color: #475569; }
.boot-post .hd   { color: #60a5fa; }
.boot-skip { position: absolute; bottom: 22px; right: 26px; font-size: 10.5px; color: #334155; font-family: var(--mono); }

.boot-brand {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  background: #000; animation: fadeIn .35s;
}
.boot-logo {
  width: 74px; height: 74px; border-radius: 18px; margin-bottom: 20px;
  background: linear-gradient(135deg, #60a5fa, #7c3aed);
  box-shadow: 0 0 60px rgba(59,130,246,0.5);
  position: relative; animation: logoPulse 2.2s ease-in-out infinite;
}
.boot-logo::after {
  content: 'A'; position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--sans); font-size: 38px; font-weight: 700; color: #fff;
}
@keyframes logoPulse { 50% { transform: scale(1.05); box-shadow: 0 0 90px rgba(59,130,246,0.7); } }
.boot-name { font-family: var(--sans); font-size: 21px; font-weight: 300; letter-spacing: 0.35em; color: #e2e8f0; text-indent: 0.35em; }
.boot-spin { display: flex; gap: 6px; margin-top: 30px; height: 8px; }
.boot-spin i { width: 6px; height: 6px; border-radius: 50%; background: #3b82f6; animation: spinDot 1.3s ease-in-out infinite; }
.boot-spin i:nth-child(2) { animation-delay: .13s; }
.boot-spin i:nth-child(3) { animation-delay: .26s; }
.boot-spin i:nth-child(4) { animation-delay: .39s; }
.boot-spin i:nth-child(5) { animation-delay: .52s; }
@keyframes spinDot { 0%,60%,100% { opacity: .2; transform: scale(0.7); } 30% { opacity: 1; transform: scale(1); } }
.boot-status { margin-top: 22px; font-size: 11.5px; color: #475569; font-family: var(--mono); height: 16px; }

/* ── LOGIN ──────────────────────────────────────────────────────────── */
#login {
  position: fixed; inset: 0; z-index: 85;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #060d1a, #0d1830 55%, #131a3a);
  animation: fadeIn .5s;
  transition: opacity .45s ease, transform .45s var(--ease);
}
#login[hidden] { display: none; }
#login.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
#login::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(59,130,246,0.16), transparent 55%);
}
.login-clock { position: absolute; top: 8%; text-align: center; }
.login-time { font-size: 64px; font-weight: 200; letter-spacing: -0.03em; color: #f1f5f9; font-variant-numeric: tabular-nums; }
.login-date { font-size: 14px; color: #64748b; margin-top: 2px; }
.login-card { position: relative; display: flex; flex-direction: column; align-items: center; }
.login-av {
  width: 92px; height: 92px; border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #7c3aed);
  box-shadow: 0 12px 40px rgba(59,130,246,0.35);
  display: grid; place-items: center; margin-bottom: 15px;
  position: relative;
}
.login-av::after { content: 'A'; font-size: 40px; font-weight: 600; color: #fff; }
.login-user { font-size: 21px; font-weight: 500; color: #f1f5f9; margin-bottom: 18px; }
.login-row { display: flex; gap: 7px; align-items: center; }
.login-row input {
  width: 232px; height: 38px; padding: 0 14px; border-radius: 99px;
  background: rgba(255,255,255,0.09); border: 1px solid rgba(255,255,255,0.16);
  color: #f1f5f9; font-size: 13px; outline: none;
  transition: border-color .16s, background .16s;
}
.login-row input:focus { border-color: rgba(96,165,250,0.7); background: rgba(255,255,255,0.13); }
.login-go {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.09); border: 1px solid rgba(255,255,255,0.16);
  display: grid; place-items: center; color: #cbd5e1;
  transition: background .16s, transform .1s var(--ease);
}
.login-go::after { content: '→'; font-size: 16px; }
.login-go:hover { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.login-go:active { transform: scale(0.92); }
.login-hint { margin-top: 15px; font-size: 11px; color: #475569; font-family: var(--mono); height: 15px; transition: color .16s; }
.login-hint.bad { color: #f59e0b; }
.login-card.shake { animation: winShake .4s; }
.login-foot { position: absolute; bottom: 26px; display: flex; align-items: center; gap: 16px; }
.login-fbtn { font-family: var(--mono); font-size: 11px; color: #475569; padding: 5px 10px; border-radius: 5px; transition: color .14s, background .14s; }
.login-fbtn:hover { color: #94a3b8; background: rgba(255,255,255,0.05); }
.login-build { font-family: var(--mono); font-size: 10px; color: #1e293b; }

/* ── SCREENSAVER ────────────────────────────────────────────────────── */
#saver { position: fixed; inset: 0; z-index: 80; background: #000; overflow: hidden; animation: fadeIn .8s; }
#saver[hidden] { display: none; }
.saver-logo {
  position: absolute; padding: 12px 22px; border-radius: 10px;
  font-family: var(--sans); font-size: 26px; font-weight: 700; letter-spacing: 0.1em;
  color: #fff; background: linear-gradient(135deg, #60a5fa, #7c3aed);
  will-change: transform;
}
.saver-hint {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 10.5px; color: #1e293b;
}

/* ── BSOD ───────────────────────────────────────────────────────────── */
#bsod {
  position: fixed; inset: 0; z-index: 95;
  background: #0a5ca8; color: #fff; font-family: var(--sans);
  display: grid; place-items: center; padding: 40px;
  animation: fadeIn .1s;
}
#bsod[hidden] { display: none; }
.bsod-in { max-width: 620px; width: 100%; }
.bsod-face { font-size: 86px; font-weight: 300; line-height: 1; margin-bottom: 26px; }
.bsod-lead { font-size: 19px; font-weight: 300; line-height: 1.5; margin-bottom: 22px; }
.bsod-pct { font-size: 19px; font-weight: 300; margin-bottom: 34px; }
.bsod-meta { display: flex; gap: 18px; align-items: flex-start; font-size: 12px; line-height: 1.65; }
.bsod-meta p { margin-bottom: 8px; }
.bsod-qr {
  width: 78px; height: 78px; flex-shrink: 0; background: #fff;
  background-image:
    linear-gradient(90deg, #000 12.5%, transparent 12.5% 25%, #000 25% 37.5%, transparent 37.5% 50%, #000 50% 62.5%, transparent 62.5% 75%, #000 75% 87.5%, transparent 87.5%),
    linear-gradient(0deg,  #000 12.5%, transparent 12.5% 25%, #000 25% 37.5%, transparent 37.5% 50%, #000 50% 62.5%, transparent 62.5% 75%, #000 75% 87.5%, transparent 87.5%);
  background-blend-mode: difference; padding: 6px; box-sizing: content-box;
}
.bsod-stop { font-family: var(--mono); font-size: 11.5px; }

/* ── POWER ──────────────────────────────────────────────────────────── */
#power {
  position: fixed; inset: 0; z-index: 96; background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  animation: fadeIn .55s;
}
#power[hidden] { display: none; }
.pw-spin {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.12); border-top-color: #60a5fa;
  animation: pwSpin .85s linear infinite; margin-bottom: 26px;
}
@keyframes pwSpin { to { transform: rotate(360deg); } }
.pw-msg { font-size: 17px; font-weight: 300; color: #e2e8f0; letter-spacing: 0.02em; }
.pw-sub { font-size: 11.5px; color: #334155; margin-top: 9px; font-family: var(--mono); }
.pw-exit {
  margin-top: 34px; padding: 11px 22px; border-radius: 8px;
  border: 1px solid #1e293b; background: rgba(255,255,255,0.03);
  color: #94a3b8; font-size: 13px; font-family: var(--mono);
  transition: all .16s;
}
.pw-exit:hover { border-color: #3b82f6; color: #e2e8f0; background: rgba(59,130,246,0.1); }

/* ── SMALL SCREEN GATE ──────────────────────────────────────────────── */
#tooSmall {
  position: fixed; inset: 0; z-index: 99;
  display: grid; place-items: center; padding: 22px;
  background: linear-gradient(160deg, #060d1a, #101a33);
}
#tooSmall[hidden] { display: none; }
.ts-card { max-width: 380px; text-align: center; }
.ts-icon {
  width: 62px; height: 62px; margin: 0 auto 20px; border-radius: 15px;
  background: linear-gradient(135deg, #60a5fa, #7c3aed);
  box-shadow: 0 0 44px rgba(59,130,246,0.4);
  display: grid; place-items: center;
}
.ts-icon::after { content: 'A'; font-size: 32px; font-weight: 700; color: #fff; }
.ts-card h2 { font-size: 20px; font-weight: 600; color: #f1f5f9; margin-bottom: 12px; }
.ts-card p { font-size: 13.5px; line-height: 1.65; color: #64748b; margin-bottom: 24px; }
.ts-btns { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ts-go {
  padding: 11px 26px; border-radius: 8px; background: #3b82f6;
  color: #fff; font-size: 13px; font-weight: 600;
}
.ts-go:hover { filter: brightness(1.12); }
.ts-back { font-family: var(--mono); font-size: 11.5px; color: #475569; text-decoration: none; padding: 6px; }
.ts-back:hover { color: #94a3b8; }

/* ── MOBILE ─────────────────────────────────────────────────────────── */
body.mobile { --tb-h: 56px; }
body.mobile .dicon { width: 74px; }
body.mobile .dicon .ico { width: 36px; height: 36px; }
/* keep Start on mobile — just shed its label and the extras around it */
body.mobile .tb-start-txt, body.mobile .tb-brand,
body.mobile .tb-peek, body.mobile #clkDate { display: none; }
body.mobile .tb-start { padding: 0 11px; }
body.mobile #taskbar { grid-template-columns: auto 1fr auto; }
body.mobile .tb-task .t { display: none; }
body.mobile #startMenu { width: calc(100vw - 12px); left: 6px; }
body.mobile .sm-grid { grid-template-columns: repeat(4, 1fr); }
body.mobile .login-time { font-size: 44px; }
body.mobile .win-ctl button { width: 40px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
