/* LiteOS desktop shell */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: var(--font); font-size: var(--fs-m); color: var(--text); background: color-mix(in srgb, var(--accent) 65%, #000); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* no focus ring on fields and selects: the caret, or the open flyout, shows where you are */
input:focus-visible, select:focus-visible, textarea:focus-visible, .input:focus-visible, .select:focus-visible { outline: none; }

.os-root { position: fixed; inset: 0; overflow: hidden; user-select: none; }
.ico { width: 16px; height: 16px; flex-shrink: 0; }
.glass { background: var(--glass); -webkit-backdrop-filter: blur(28px) saturate(1.5); backdrop-filter: blur(28px) saturate(1.5); }
:root[data-glass="off"] .glass { -webkit-backdrop-filter: none; backdrop-filter: none; }
.tile { display: inline-flex; align-items: center; justify-content: center; color: var(--on-accent); flex-shrink: 0; }
.ibtn { border: none; background: transparent; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); border-radius: var(--radius-l); }
.ibtn:hover { background: var(--hover); }

/* ------------------------------------------------------------ wallpaper */
.wall { position: absolute; inset: 0; background-color: var(--accent); background-size: cover; background-position: center; transition: background var(--dur-slow); }
.night { position: absolute; inset: 0; pointer-events: none; background: rgba(255, 150, 40, 0.16); mix-blend-mode: multiply; z-index: 9000; }

/* ------------------------------------------------------------ top bar */
.topbar {
  position: absolute; left: 0; right: 0; top: 0; height: 34px; z-index: 600; display: flex; align-items: center; gap: 16px;
  padding: 0 10px 0 14px; border-bottom: 1px solid var(--glass-border); box-shadow: 0 1px 0 var(--edge); font-size: var(--fs-m);
}
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; border: none; background: none; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-l); }
.topbar .brand:hover { background: var(--hover); }
.topbar .brand img { width: 16px; height: 16px; }
.topbar .app-name { font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .status { display: flex; align-items: center; gap: 12px; height: 26px; padding: 0 10px; border-radius: var(--radius-l); border: none; background: none; cursor: pointer; font-weight: 500; font-variant-numeric: tabular-nums; }
.topbar .status:hover, .topbar .status.open { background: var(--hover); }

/* ------------------------------------------------------------ floating dock */
.dock-wrap { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; z-index: 600; pointer-events: none; transition: transform var(--dur-slow) var(--ease); }
.dock-wrap.hide { transform: translateY(110px); }
.dock {
  pointer-events: auto; display: flex; align-items: flex-end; gap: 4px; padding: 6px 10px; border-radius: var(--radius-l);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-float);
}
.dock-btn { border: none; background: transparent; cursor: pointer; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; width: calc(var(--dock-size) + 8px); position: relative; }
.dock-btn .tile { width: var(--dock-size); height: var(--dock-size); border-radius: calc(var(--dock-size) * 0.27); box-shadow: var(--shadow-tile); transition: transform var(--dur) var(--ease); }
.os-root.magnify .dock-btn:hover .tile { transform: translateY(-4px) scale(1.06); }
.dock-btn .dot { width: 5px; height: 5px; border-radius: var(--radius-full); background: transparent; }
.dock-btn.running .dot { background: var(--text); }
.dock-btn .lbl { font-size: var(--fs-xs); font-weight: 500; color: var(--text-2); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-btn.launcher-btn.open .tile { box-shadow: 0 0 0 3px var(--accent-ring), 0 3px 8px var(--accent-shadow); }
.dock-sep { width: 1px; align-self: center; height: calc(var(--dock-size) * 0.8); background: var(--line-strong); opacity: .7; margin: 0 4px 9px; }
.dock-tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--tip-bg); color: var(--tip-text); font-size: var(--fs-s);
  padding: 4px 8px; border-radius: var(--radius-l); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity var(--dur-fast);
}
.dock-btn:hover .dock-tip { opacity: 1; }
.dock-hotzone { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; z-index: 599; }

/* ------------------------------------------------------------ window previews (hovering a running app) */
.win-previews {
  position: absolute; z-index: 650; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px;
  max-width: calc(100% - 16px); border-radius: var(--radius-l); border: 1px solid var(--glass-border); background: var(--glass-strong); box-shadow: var(--shadow-float);
  animation: popIn var(--dur-fast) var(--ease-out);
}
.pv-card { width: 196px; display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: var(--radius-l); cursor: pointer; }
.pv-card:hover { background: var(--hover); }
.pv-card.on { background: var(--accent-soft); }
.pv-head { display: flex; align-items: center; gap: 8px; height: 22px; padding-left: 2px; font-size: var(--fs-s); color: var(--text); }
.pv-head img { width: 16px; height: 16px; flex: none; }
.pv-head span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-x { width: 22px; height: 22px; flex: none; display: flex; align-items: center; justify-content: center; border: none; border-radius: var(--radius); background: transparent; color: var(--text-2); cursor: pointer; opacity: 0; }
.pv-card:hover .pv-x { opacity: 1; }
.pv-x:hover { background: var(--danger); color: var(--on-danger); }
.pv-body { width: 100%; max-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: var(--radius-l); background: var(--surface-2); border: 1px solid var(--line); }
.pv-body { position: relative; overflow: hidden; }
.pv-body img { width: 40px; height: 40px; }
.pv-body small { font-size: var(--fs-xs); color: var(--muted); }
/* a picture of the window fills the card, from its top */
.pv-body.pic .shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pv-body.pic small { position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; border-radius: var(--radius); background: var(--glass-strong); color: var(--text-2); }
.os-root.pv-showing .dock-tip { display: none; }
/* peek: the hovered card's window shows where it is (even when minimised); the others fade out */
.os-root.win-peek .win { transition: opacity var(--dur) var(--ease); }
.os-root.win-peek .win:not(.peeked) { opacity: 0; }
.os-root.win-peek .win.peeked { z-index: 590 !important; animation: none; }
.os-root.win-peek .win.min.peeked { display: flex; }
/* minimising while its picture is taken: gone from view, still laid out */
.win.minimizing { opacity: 0; pointer-events: none; }
.os-root.win-peek .win.minimizing.peeked { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .win-previews { animation: none; } .os-root.win-peek .win { transition: none; } }

/* ------------------------------------------------------------ classic taskbar */
.taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 50px; z-index: 600; display: flex; align-items: center; gap: 4px;
  padding: 0 0 0 8px; border-top: 1px solid var(--glass-border); box-shadow: 0 -1px 0 var(--edge); transition: transform var(--dur-slow) var(--ease);
}
.taskbar.hide { transform: translateY(50px); }
.taskbar .start { height: 40px; padding: 0 12px 0 6px; border-radius: var(--radius-l); border: none; background: transparent; display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.taskbar .start .tile { width: 30px; height: 30px; border-radius: var(--radius-l); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent)); }
.taskbar .start img { width: 18px; height: 18px; }
.taskbar .start:hover, .taskbar .start.open { background: var(--hover); }
.taskbar .tsearch { height: 34px; width: 240px; margin: 0 8px 0 4px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); color: var(--muted); cursor: text; }
.taskbar .apps { display: flex; align-items: center; gap: 2px; }
.taskbar.center .apps { position: absolute; left: 50%; transform: translateX(-50%); }
.tb-btn { width: 46px; height: 42px; border-radius: var(--radius-l); border: none; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; position: relative; }
.tb-btn:hover { background: var(--hover); }
.tb-btn .tile { width: 28px; height: 28px; border-radius: var(--radius-l); }
.tb-btn .bar { height: 3px; width: 0; border-radius: var(--radius-full); background: var(--accent); transition: width var(--dur); }
.tb-btn.running .bar { width: 6px; }
.tb-btn.focused .bar { width: 16px; }
.tb-btn.focused { background: var(--hover); }
.taskbar .tray { margin-left: auto; display: flex; align-items: center; height: 100%; }
.taskbar .clock { height: 40px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; padding: 0 10px; border-radius: var(--radius-l); border: none; background: transparent; cursor: pointer; font-size: var(--fs-s); line-height: 1.3; font-variant-numeric: tabular-nums; }
.taskbar .clock:hover, .taskbar .clock.open { background: var(--hover); }
.taskbar .clock b { font-weight: 600; }
.taskbar .peek { width: 8px; height: 100%; border: none; border-left: 1px solid var(--line-strong); background: transparent; margin-left: 6px; cursor: pointer; }

/* ------------------------------------------------------------ popovers (launcher, quick settings) */
.pop {
  position: absolute; z-index: 700; border-radius: var(--radius-l); border: 1px solid var(--glass-border); box-shadow: var(--shadow-3);
  background: var(--glass-strong); overflow: hidden; animation: popIn var(--dur) var(--ease-out);
}
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.launcher { width: 640px; max-width: calc(100vw - 16px); max-height: calc(100vh - 120px); display: flex; flex-direction: column; }
.launcher .ls-search { margin: 22px 24px 8px; height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line-strong); }
.launcher .ls-search input { border: none; outline: none; background: transparent; width: 100%; font-size: var(--fs-l); color: var(--text); }
.launcher .ls-body { overflow-y: auto; padding-bottom: 8px; }
.ls-head { display: flex; align-items: center; padding: 10px 24px 2px; font-size: var(--fs-m); font-weight: 600; color: var(--text-2); }
.ls-head .link { margin-left: auto; font-size: var(--fs-s); font-weight: 500; color: var(--accent-ink); border: none; background: none; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-l); }
.ls-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; padding: 8px 16px 6px; }
.ls-app { height: 88px; border-radius: var(--radius-l); border: none; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.ls-app:hover, .ls-app.kbd { background: var(--accent-soft); }
.ls-app .tile { width: 44px; height: 44px; border-radius: var(--radius-l); box-shadow: var(--shadow-tile); }
.ls-app span { font-size: var(--fs-s); font-weight: 500; color: var(--text); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-files { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; padding: 6px 16px 14px; }
.ls-file { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-l); border: none; background: transparent; text-align: left; cursor: pointer; min-width: 0; }
.ls-file:hover, .ls-file.kbd { background: var(--accent-soft); }
.ls-file .tile { width: 34px; height: 34px; border-radius: var(--radius-l); }
.ls-file .meta { display: flex; flex-direction: column; min-width: 0; }
.ls-file .meta b { font-size: var(--fs-m); font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-file .meta small { font-size: var(--fs-s); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-empty { padding: 18px 24px; color: var(--muted); }
.ls-foot { height: 60px; flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 0 14px 0 24px; background: var(--surface-3); border-top: 1px solid var(--line); }
.avatar { border-radius: var(--radius-full); color: var(--on-accent); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ls-foot .who { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.ls-foot .who b { font-size: var(--fs-m); }
.ls-foot .who small { font-size: var(--fs-s); color: var(--muted); }
.ls-foot .ibtn { width: 38px; height: 38px; }

.qs { width: 348px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.qs .acct { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); }
.qs .acct .meta { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 4px; }
.qs .acct b { font-size: var(--fs-m); }
.qs .acct small { font-size: var(--fs-s); color: var(--muted); }
.meter { height: 5px; border-radius: var(--radius-full); background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-full); }
.qs .tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.qs .qtile { height: 64px; border-radius: var(--radius-l); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 0 12px; font-size: var(--fs-s); font-weight: 600; cursor: pointer; }
.qs .qtile.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.qs .qlabel { font-size: var(--fs-s); font-weight: 600; color: var(--text-2); }
.qs .qseg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: var(--radius-l); background: var(--surface-3); }
.qs .qseg button { height: 34px; border-radius: var(--radius-l); border: none; background: transparent; font-size: var(--fs-m); font-weight: 600; color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.qs .qseg button.on { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-1); }
.qs .qfoot { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.qs .qfoot small { flex: 1; color: var(--muted); font-size: var(--fs-s); }
.qs .qfoot .ibtn { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface); }

/* ------------------------------------------------------------ windows */
.windows { position: absolute; inset: 0; z-index: 100; pointer-events: none; }
.win {
  position: absolute; pointer-events: auto; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-win); overflow: hidden; min-width: 360px; min-height: 240px;
  animation: winIn var(--dur) var(--ease-out);
}
@keyframes winIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.win.focused { box-shadow: var(--shadow-win-focus); }
.win.max { border-radius: 0; box-shadow: none; }
.win.min { display: none; }
.win.closing { animation: winOut var(--dur-fast) var(--ease-in) forwards; }
@keyframes winOut { to { opacity: 0; transform: scale(.97); } }
.win-bar { height: 40px; flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 0 0 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); cursor: default; }
.win:not(.focused) .win-bar { color: var(--muted); }
.win-bar .tile { width: 20px; height: 20px; border-radius: var(--radius-l); }
.win-bar .title { font-size: var(--fs-m); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.win-bar .title .dirty { display: inline-block; width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--muted); margin-left: 6px; vertical-align: 1px; }
/* caption buttons, as in Windows: the full height of the bar, side by side, flush with the top and right edges
   (the window's rounded corner clips the close button); three of them are OS.win.controlsWidth (132px) */
.win-bar .ctl { align-self: stretch; width: 44px; height: auto; border-radius: 0; }
.win-bar .ctl + .ctl { margin-left: -10px; }
.win-bar .ctl.close:hover { background: var(--danger); color: var(--on-danger); }
.win-body { flex: 1; position: relative; min-height: 0; background: var(--surface); }
.win-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: var(--surface); }
.win-shield { position: absolute; inset: 0; display: none; }
/* Mica (an app's manifest "window": { "material": "mica" }), as in Windows 11: while Transparency effects is on, the
   focused window is frosted glass tinted by the wallpaper, title bar included, and the app's page is transparent over
   it (the app draws its own cards, half see-through). A window in the background turns solid, as Windows does. */
:root:not([data-glass="off"]) .win.win-mica { background: var(--mica); }
:root:not([data-glass="off"]) .win.win-mica.focused { background: var(--mica-glass); -webkit-backdrop-filter: blur(70px) saturate(1.8); backdrop-filter: blur(70px) saturate(1.8); }
:root:not([data-glass="off"]) .win.win-mica .win-bar { background: transparent; border-bottom-color: transparent; }
:root:not([data-glass="off"]) .win.win-mica .win-body,
:root:not([data-glass="off"]) .win.win-mica .win-body iframe { background: transparent; }
/* Loading cover while the app's page loads (os.js winLoading). */
.win-load { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: var(--surface); transition: opacity var(--dur) var(--ease), visibility 0s; }
.win-load.done { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--dur) var(--ease), visibility 0s var(--dur); }
/* What the app is doing while it opens (OS.win.loading): a line of text, and a thin bar when it knows how far it got. */
.win-load .ld-text { margin: -8px 0 0; max-width: min(320px, 80%); min-height: 1.4em; font-size: var(--fs-s); line-height: 1.4; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-load .ld-bar { display: block; width: 160px; height: 3px; margin-top: -14px; border-radius: var(--radius-full); background: var(--line); overflow: hidden; visibility: hidden; }
.win-load .ld-bar.on { visibility: visible; }
.win-load .ld-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width var(--dur-slow) var(--ease); }
/* Brand motion 02, "Loading · Shimmer": the icon at 30% with a slanted band of light passing over a full copy of it,
   2.8s a loop (the sweep takes the first 65%, then a rest). Applied over the front of any icon. */
.win-load .ld-mark { position: relative; display: block; width: 48px; height: 48px; }
.win-load .ld-mark .appicon { position: absolute; inset: 0; width: 100%; height: 100%; }
.win-load .ld-mark .appicon:first-child { opacity: .3; }
.win-load .ld-mark .appicon + .appicon {
  -webkit-mask: linear-gradient(110deg, transparent 35%, #000 50%, transparent 65%) 100% 0 / 300% 100% no-repeat;
  mask: linear-gradient(110deg, transparent 35%, #000 50%, transparent 65%) 100% 0 / 300% 100% no-repeat;
  animation: winShimmer 2.8s cubic-bezier(.45, 0, .3, 1) infinite;
}
@keyframes winShimmer { 0% { -webkit-mask-position: 100% 0; mask-position: 100% 0; } 65%, 100% { -webkit-mask-position: 0 0; mask-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .win-load .ld-mark .appicon:first-child { opacity: 1; }
  .win-load .ld-mark .appicon + .appicon { display: none; }
}
/* a window brought back after a reload that hasn't started yet: its icon, still (it starts when first shown) */
.win.asleep .win-load { opacity: 1; visibility: visible; }
.win.asleep .win-load .ld-mark .appicon:first-child { opacity: .6; }
.win.asleep .win-load .ld-mark .appicon + .appicon { display: none; }
.os-root.dragging .win-shield { display: block; }
.os-root.dragging { cursor: default; }
.rz { position: absolute; z-index: 2; }
/* touch: a finger on these drags (a window, its edges, desktop icons, the selection box on the desktop) instead of
   the browser taking the gesture for scrolling or zooming and cancelling the drag */
.win-bar, .rz, .desk-icon, .wall, .desk-icons { touch-action: none; }
.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.e { right: -3px; top: 8px; bottom: 8px; width: 7px; cursor: ew-resize; }
.rz.w { left: -3px; top: 8px; bottom: 8px; width: 7px; cursor: ew-resize; }
.rz.ne { right: -3px; top: -3px; width: 12px; height: 12px; cursor: nesw-resize; }
.rz.nw { left: -3px; top: -3px; width: 12px; height: 12px; cursor: nwse-resize; }
.rz.se { right: -3px; bottom: -3px; width: 12px; height: 12px; cursor: nwse-resize; }
.rz.sw { left: -3px; bottom: -3px; width: 12px; height: 12px; cursor: nesw-resize; }
.win.max .rz { display: none; }
/* snapped windows: only the edges shared with the rest of the group can be dragged (os.js tileResize) */
.win.tiled { border-radius: 0; box-shadow: 0 0 0 1px var(--line); }
.win.tiled .rz { display: none; }
.win[data-tile="l"] .rz.e, .win[data-tile="r"] .rz.w,
.win[data-tile="tl"] :is(.rz.e, .rz.s, .rz.se), .win[data-tile="bl"] :is(.rz.e, .rz.n, .rz.ne),
.win[data-tile="tr"] :is(.rz.w, .rz.s, .rz.sw), .win[data-tile="br"] :is(.rz.w, .rz.n, .rz.nw) { display: block; }
.win.tiled .rz.e, .win.tiled .rz.w { top: 0; bottom: 0; }
.win.tiled .rz.n, .win.tiled .rz.s { left: 0; right: 0; }
/* Snap Assist: the other open windows, offered for the empty part of the group */
.snap-assist { position: absolute; pointer-events: auto; display: flex; align-items: center; justify-content: center; padding: 16px; border-radius: var(--radius-l);
  background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 0 0 1px var(--line); animation: winIn var(--dur) var(--ease-out); }
.sa-list { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 8px; max-height: 100%; overflow: auto; }
.sa-item { width: 148px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px 12px; border: 1px solid transparent; border-radius: var(--radius-l);
  background: none; color: var(--text); font: inherit; font-size: var(--fs-s); cursor: default; }
.sa-item span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-item:hover { background: var(--hover); }
.sa-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.snap-ghost { position: absolute; z-index: 99; border-radius: var(--radius-l); background: var(--accent-soft); border: 2px solid var(--accent); pointer-events: none; transition: all var(--dur-fast); }

/* ------------------------------------------------------------ menus, toasts, modals */
.menu { position: fixed; z-index: 9500; min-width: 210px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-l); box-shadow: var(--shadow-2); padding: 6px; }
.menu-item { width: 100%; height: 32px; padding: 0 10px; border-radius: var(--radius-l); border: none; background: transparent; display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left; color: var(--text); }
.menu-item:hover { background: var(--accent-soft); color: var(--accent-ink); }
.menu-item.danger { color: var(--danger-ink); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }

.toasts { position: absolute; right: 16px; bottom: 100px; z-index: 8000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; max-width: 360px; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-l); background: var(--glass-strong); border: 1px solid var(--line); box-shadow: var(--shadow-2); font-size: var(--fs-m); line-height: 1.4; animation: popIn var(--dur) var(--ease-out); }

.btn { height: 34px; padding: 0 16px; border-radius: var(--radius-l); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.input { height: 38px; padding: 0 12px; border-radius: var(--radius-l); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); outline: none; width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: var(--fs-m); font-weight: 500; color: var(--text-2); }
.err { color: var(--danger-ink); font-size: var(--fs-m); min-height: 18px; }

/* file dialog: the Windows Open / Save As window (os.js fileDialog) */
.dlg.fdlg { width: 880px; height: 580px; }
.fdlg-head { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 0 0 14px; flex-shrink: 0; }
.fdlg-head > img, .fdlg-head > .ico { width: 16px; height: 16px; flex-shrink: 0; }
.fdlg .dlg-title { padding: 0; flex: 1; min-width: 0; font-size: var(--fs-m); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fdlg-close { align-self: stretch; width: 44px; height: auto; border-radius: 0; flex-shrink: 0; }
.fdlg-close:hover { background: var(--danger); color: var(--on-danger); }
.fdlg-nav { display: flex; align-items: center; gap: 4px; padding: 4px 12px 8px; flex-shrink: 0; }
.fdlg-nav > .ibtn { width: 32px; height: 32px; flex-shrink: 0; }
.fdlg .ibtn:disabled { color: var(--disabled); cursor: default; background: transparent; }
.fdlg-addr { flex: 1; min-width: 0; height: 32px; display: flex; align-items: center; gap: 8px; margin-left: 6px; padding: 0 2px 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); color: var(--muted); }
.fdlg-addr .ibtn { width: 28px; height: 26px; margin-left: auto; flex-shrink: 0; }
/* a folder that takes a moment to open */
.fdlg-addr { position: relative; overflow: hidden; }
.dlg.loading, .dlg.loading * { cursor: progress !important; }
.dlg.loading .fdlg-addr::after { content: ''; position: absolute; left: 0; bottom: 0; width: 30%; height: 2px; background: var(--accent); animation: fdlgBusy 1s ease-in-out infinite; }
@keyframes fdlgBusy { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .dlg.loading .fdlg-addr::after { animation: none; width: 100%; opacity: .5; } }
.fdlg .crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; overflow: hidden; white-space: nowrap; font-size: var(--fs-m); }
.fdlg .crumbs button { border: none; background: none; cursor: pointer; padding: 3px 5px; border-radius: var(--radius); color: var(--text); }
.fdlg .crumbs button:hover { background: var(--hover); }
.fdlg .crumbs .sepc { color: var(--muted); }
.fdlg-search { width: 220px; height: 32px; flex-shrink: 0; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); color: var(--muted); }
.fdlg-search:focus-within { border-color: var(--accent); }
.fdlg-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: var(--fs-m); }
.fdlg-search input::-webkit-search-cancel-button { display: none; }
.fdlg-cmd { display: flex; align-items: center; gap: 4px; padding: 0 12px 6px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.fdlg-cmd .btn { height: 30px; padding: 0 10px; font-weight: 500; border-color: transparent; background: transparent; }
.fdlg-cmd .btn:hover { background: var(--hover); }
.fdlg .dlg-body { padding: 0; flex: 1; min-height: 0; flex-direction: row; gap: 0; }
.fdlg .side { width: 200px; flex-shrink: 0; border-right: 1px solid var(--line); padding: 8px 6px; display: flex; flex-direction: column; gap: 1px; overflow: auto; }
.fdlg .side button { height: 32px; border: none; background: transparent; border-radius: var(--radius-l); display: flex; align-items: center; gap: 10px; padding: 0 10px; cursor: pointer; color: var(--text); text-align: left; flex-shrink: 0; }
.fdlg .side button:hover { background: var(--hover); }
.fdlg .side button.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
/* USB drives of a LiteLink device (os.js fileDialog), below the folders */
.fdlg .side-sep { height: 1px; margin: 6px 4px; background: var(--line); flex-shrink: 0; }
.fdlg .side button .ico { flex-shrink: 0; }
/* the navigation pane, as in Files: tree rows indent by depth, with the arrow's slot on every row so the icons line up */
.fdlg .side button.tv { height: 30px; gap: 6px; padding: 0 8px 0 calc(4px + var(--d, 0) * 16px); }
.fdlg .side .tw { width: 16px; height: 16px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); color: var(--muted); }
.fdlg .side .tw.none .ico { visibility: hidden; }
.fdlg .side .tw[data-tw]:hover { color: var(--text); background: var(--hover); }
.fdlg .side .tw .ico { transition: transform .12s; }
.fdlg .side .tw.open .ico { transform: rotate(90deg); }
.fdlg .side .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fdlg .side .pinmark { display: flex; color: var(--faint); }
.fdlg .side button.on .pinmark { color: inherit; }
.fdlg-ro { margin-left: auto; font-size: 12px; color: var(--muted); }
.fdlg .main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fdlg-cols, .fdlg .item { display: grid; grid-template-columns: minmax(0, 1fr) 150px 130px 80px; align-items: center; gap: 12px; }
.fdlg-cols { height: 30px; padding: 0 14px; font-size: var(--fs-s); color: var(--muted); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.fdlg .list { flex: 1; overflow: auto; padding: 4px 6px; }
.fdlg .item { width: 100%; height: 30px; padding: 0 8px; border: none; background: transparent; border-radius: var(--radius); cursor: default; text-align: left; color: var(--text); font-size: var(--fs-m); }
.fdlg .item:hover { background: var(--hover); }
.fdlg .item.sel { background: var(--accent-soft); }
.fdlg .item .nm { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fdlg .item .nm > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fdlg .item .tile { flex-shrink: 0; }
.fdlg .item .c { color: var(--muted); font-size: var(--fs-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fdlg .item .sz { text-align: right; }
.fdlg .item.dim { opacity: .45; }
.fdlg-empty { padding: 28px; color: var(--muted); text-align: center; }
.fdlg-foot { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); flex-shrink: 0; }
.fdlg-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 8px; }
.fdlg-row > span { text-align: right; color: var(--text-2); }
.fdlg-row .input { height: 30px; padding: 0 10px; border-radius: var(--radius-s); }
.fdlg-row .input[readonly] { color: var(--text-2); background: var(--surface-2); }
/* the type box: a combo box (a button with its list in the shell's flyout), its label cut short rather than spilling */
.fdlg-row .fdlg-type { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; text-align: left; color: var(--text); cursor: pointer; font: inherit; }
.fdlg-row .fdlg-type span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fdlg-row .fdlg-type .ico, .fdlg-row .fdlg-type svg { flex-shrink: 0; color: var(--muted); }
.fdlg-row .fdlg-type[aria-expanded="true"] { border-bottom: 2px solid var(--accent); }

/* LiteOS's print dialog (os.js printDialog, LiteLink devices only): label | control rows, flyouts for choices */
.pdlg-head { display: flex; align-items: center; gap: 8px; padding: 20px 24px 0; }
.pdlg-head .dlg-title { padding: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdlg .dlg-body { gap: 10px; padding-top: 14px; }
.pdlg-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 12px; }
.pdlg-row > span { color: var(--text-2); }
.pdlg-row .input { height: 32px; padding: 0 10px; border-radius: var(--radius-s); }
.pdlg-combo { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; text-align: left; color: var(--text); cursor: pointer; font: inherit; }
.pdlg-combo span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdlg-combo .ico, .pdlg-combo svg { flex-shrink: 0; color: var(--muted); }
.pdlg-note { margin: 0; color: var(--text-2); }
.pdlg-note.warn { margin-left: 108px; color: var(--danger-ink); font-size: 12px; }
.pdlg-status { margin-right: auto; font-size: 12px; color: var(--muted); }
.pdlg-menu .menu-item.is-current { background: var(--accent-soft); color: var(--accent-ink); }
/* a printer that can take documents now: a faint green dot after its name */
.pdlg-combo span { flex: 1; }
.pdlg-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--success); opacity: .55; }
.pdlg-menu .pdlg-dot { margin-left: auto; }
.fdlg-typemenu .menu-item.is-current { background: var(--accent-soft); color: var(--accent-ink); }
.fdlg-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.fdlg-btns .btn { min-width: 88px; height: 32px; border-radius: var(--radius-s); }
.fdlg-btns .btn:not(.is-default) { background: var(--dlg-btn); }

/* ------------------------------------------------------------ lock / sign-in / setup */
.lock { position: absolute; inset: 0; z-index: 9800; background-size: cover; background-position: center; color: #fff; animation: fadeIn var(--dur-slow); }
.lock-frame { position: absolute; inset: 0; z-index: 9800; animation: fadeIn var(--dur-slow); transition: opacity var(--dur-slow) var(--ease); }
.lock-frame.leaving { opacity: 0; }
.lock-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: transparent; }
.lock::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(10,30,70,.12), rgba(10,30,70,.38)); }

@media (max-width: 720px) {
  .launcher .ls-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ls-files { grid-template-columns: minmax(0, 1fr); }
  .taskbar .tsearch { display: none; }
}

/* system icons from the icon set (LOS_sysGlyph, LOS_fileTile): pictures, not glyphs, so no tile background or shadow;
   on a red close button they turn white like the glyphs did */
img.tile.filetile { background: none; box-shadow: none; border-radius: 0; object-fit: contain; }
img.sysico { object-fit: contain; }
.win-bar .ctl.close:hover img.sysico, .fdlg-close:hover img.sysico { filter: brightness(0) invert(1); }
