/* =====================================================================
   Kambana OS - system styles (shell, windows, panels, lock screen)
   Tokens first; every colour used by the shell comes from here.
   ===================================================================== */
:root {
  --font: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font);
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --accent: #2cb7ae;
  --accent-rgb: 44, 183, 174;
  --accent-fg: #fff;

  /* radii: window < panel; controls smaller; icons are squircles (26%) */
  --r-win: 14px;
  --r-panel: 24px;
  --r-tile: 18px;
  --r-ctl: 10px;
  --r-sm: 7px;

  --dock-icon: 54px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-io: cubic-bezier(.4, 0, .2, 1);
}

/* Dark (default) */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --text: #eef1f7;
  --text-2: rgba(238, 241, 247, .70);
  --text-3: rgba(238, 241, 247, .46);
  --surface: #1a1f2b;
  --surface-2: #212736;
  --surface-3: #2a3142;
  --sidebar: rgba(30, 36, 50, .72);
  --hover: rgba(255, 255, 255, .07);
  --press: rgba(255, 255, 255, .12);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --glass: rgba(26, 31, 44, .56);
  --glass-strong: rgba(28, 33, 46, .80);
  --glass-solid: #222838;
  --glass-border: rgba(255, 255, 255, .12);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .07);
  --bar: rgba(30, 36, 50, .72);
  --tile: rgba(255, 255, 255, .09);
  --tile-hover: rgba(255, 255, 255, .14);
  --shadow-win: 0 30px 70px -18px rgba(0, 0, 0, .62), 0 0 0 .5px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  --shadow-win-blur: 0 14px 36px -14px rgba(0, 0, 0, .5), 0 0 0 .5px rgba(0, 0, 0, .5);
  --shadow-pop: 0 18px 50px -10px rgba(0, 0, 0, .55), 0 0 0 .5px rgba(0, 0, 0, .5);
  --topbar-fg: #fff;
  --topbar-bg: rgba(8, 12, 22, .30);
}
:root[data-theme="light"] {
  color-scheme: light;
  --text: #151a25;
  --text-2: rgba(21, 26, 37, .68);
  --text-3: rgba(21, 26, 37, .45);
  --surface: #fbfbfd;
  --surface-2: #f2f4f8;
  --surface-3: #e7eaf0;
  --sidebar: rgba(240, 242, 247, .78);
  --hover: rgba(10, 20, 40, .055);
  --press: rgba(10, 20, 40, .10);
  --line: rgba(10, 20, 40, .08);
  --line-2: rgba(10, 20, 40, .14);
  --glass: rgba(246, 247, 251, .62);
  --glass-strong: rgba(248, 249, 252, .86);
  --glass-solid: #f3f5f9;
  --glass-border: rgba(255, 255, 255, .6);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .7);
  --bar: rgba(244, 246, 250, .78);
  --tile: rgba(10, 20, 40, .06);
  --tile-hover: rgba(10, 20, 40, .1);
  --shadow-win: 0 30px 70px -20px rgba(20, 30, 60, .38), 0 0 0 .5px rgba(0, 0, 0, .16);
  --shadow-win-blur: 0 12px 30px -14px rgba(20, 30, 60, .3), 0 0 0 .5px rgba(0, 0, 0, .14);
  --shadow-pop: 0 18px 50px -12px rgba(20, 30, 60, .35), 0 0 0 .5px rgba(0, 0, 0, .12);
  --topbar-fg: #111827;
  --topbar-bg: rgba(255, 255, 255, .38);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05070d; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: default; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex-shrink: 0; display: block; }

#os { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
#os input, #os textarea, #os [contenteditable] { user-select: text; -webkit-user-select: text; }

/* glass material - shared by bars, panels, menus, widgets */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(34px) saturate(1.7);
  backdrop-filter: blur(34px) saturate(1.7);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-hi), var(--shadow-pop);
}
.no-glass .glass, .no-glass .glass-bar, .no-glass .win-bar { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: var(--glass-solid) !important; }

/* ---------------------------------------------------------------------
   Wallpaper + desktop
   --------------------------------------------------------------------- */
#wallpaper { position: absolute; inset: 0; background: var(--wallpaper, #0d2a36); transition: transform .9s var(--ease), filter .5s; }
.overview #wallpaper { filter: blur(14px) brightness(.62); transform: scale(1.04); }
#desktop { position: absolute; left: 0; right: 0; top: 32px; bottom: 90px; transition: opacity .35s; }
.overview #desktop { opacity: 0; pointer-events: none; }

/* desktop icons: right column, newest at the top (macOS-style) */
#desk-icons {
  position: absolute; top: 14px; right: 14px; bottom: 6px;
  display: flex; flex-direction: column; flex-wrap: wrap-reverse; align-content: flex-start; gap: 6px;
}
.desk-icon {
  width: 92px; padding: 6px 4px; border: 0; background: none; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff;
}
.desk-icon:hover { background: rgba(255, 255, 255, .08); }
.desk-icon.sel { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.di-name {
  font-size: 12px; font-weight: 500; line-height: 1.25; text-align: center; max-width: 88px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .7), 0 0 8px rgba(0, 0, 0, .35);
}
.desk-icon.sel .di-name { background: var(--accent); color: var(--accent-fg); text-shadow: none; border-radius: 4px; padding: 0 4px; }
.di-thumb { width: 58px; height: 44px; border-radius: 6px; border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .35); margin: 6px 0 4px; }

/* folder drawn in CSS, tinted by the accent colour */
.di-folder, .file-folder {
  --fc: var(--accent);
  position: relative; width: 58px; height: 46px; margin-top: 8px; display: grid; place-items: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--fc) 72%, #fff) 0%, var(--fc) 100%);
  border-radius: 4px 8px 8px 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 4px 10px rgba(0, 0, 0, .25);
}
.di-folder::before, .file-folder::before {
  content: ''; position: absolute; left: 0; top: -7px; width: 24px; height: 9px;
  background: color-mix(in srgb, var(--fc) 80%, #000); border-radius: 4px 6px 0 0;
}
.di-folder::after, .file-folder::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 9px; border-radius: 4px 8px 0 0;
  background: color-mix(in srgb, var(--fc) 82%, #000); opacity: .55; z-index: 0;
}
.di-folder-ic { position: relative; z-index: 1; color: rgba(255, 255, 255, .92); margin-top: 6px; }

/* paper document with folded corner */
.di-doc, .file-doc {
  position: relative; width: 44px; height: 54px; border-radius: 4px; background: #fdfdfd;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  clip-path: polygon(0 0, 72% 0, 100% 20%, 100% 100%, 0 100%);
  color: #475569;
}
.di-doc::after, .file-doc::after { content: ''; position: absolute; right: 0; top: 0; width: 28%; height: 20%; background: linear-gradient(225deg, transparent 50%, #d9dee7 50%); }
.di-doc em, .file-doc em { font-style: normal; font-size: 8.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: #64748b; }
.k-text { color: #2563eb; } .k-image { color: #db2777; } .k-audio { color: #9333ea; } .k-video { color: #ea580c; }
.k-document { color: #1d4ed8; } .k-sheet { color: #15803d; } .k-design { color: #0e7490; } .k-presentation { color: #c2410c; } .k-archive { color: #57534e; }
.k-android { color: #16a34a; } .k-windows { color: #2563eb; } .k-linux { color: #b45309; } .k-pdf { color: #dc2626; }

/* ---------------------------------------------------------------------
   Widgets
   --------------------------------------------------------------------- */
#widgets {
  position: absolute; top: 18px; left: 18px;
  display: grid; grid-template-columns: repeat(2, 168px); grid-auto-rows: 168px; gap: 14px;
  transition: opacity .3s;
}
.hide-widgets #widgets { opacity: 0; pointer-events: none; }
.widget { border-radius: var(--r-panel); padding: 14px; overflow: hidden; position: relative; color: var(--text); }
.widget[role="button"]:hover { filter: brightness(1.06); }
#widgets .widget { box-shadow: var(--glass-hi), 0 10px 30px -12px rgba(0, 0, 0, .45); }

.w-clock { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.wc-face {
  position: relative; width: 104px; height: 104px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 6px 16px rgba(0, 0, 0, .25);
}
.wc-face::before { /* hour ticks */
  content: ''; position: absolute; inset: 7px; border-radius: 50%;
  background: repeating-conic-gradient(from -1deg, var(--text-3) 0deg 2deg, transparent 2deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 41px, #000 42px); mask: radial-gradient(circle, transparent 41px, #000 42px);
}
.wc-face i { position: absolute; left: 50%; bottom: 50%; transform-origin: 50% 100%; border-radius: 3px; }
.wc-h { width: 4px; height: 26px; margin-left: -2px; background: var(--text); }
.wc-m { width: 3px; height: 38px; margin-left: -1.5px; background: var(--text); }
.wc-s { width: 1.5px; height: 42px; margin-left: -.75px; background: var(--accent); }
.wc-face b { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: var(--accent); }
.wc-txt { text-align: center; line-height: 1.2; }
.wc-day { display: block; font-size: 13px; font-weight: 700; color: var(--accent); }
.wc-date { font-size: 12px; color: var(--text-2); }

.w-weather { color: #fff; background: linear-gradient(170deg, #4a8fd6 0%, #2a5ea8 55%, #1d3f7a 100%); border: 1px solid rgba(255, 255, 255, .14); display: flex; flex-direction: column; }
.ww-top { display: flex; justify-content: space-between; align-items: flex-start; }
.ww-top b { font-size: 13px; font-weight: 600; }
.ww-temp { font-family: var(--font-display); font-size: 42px; font-weight: 300; line-height: 1; margin-top: 2px; }
.ww-bottom { margin-top: auto; font-size: 12px; display: flex; flex-direction: column; font-weight: 500; }
.ww-hours { display: none; }
.w-weather.nc { min-height: 0; }
.w-weather.nc .ww-hours { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .18); }
.ww-hours span { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.ww-hours small { opacity: .8; }

.w-next { grid-column: span 2; display: flex; flex-direction: column; gap: 8px; }
.wn-title { font-size: 12px; font-weight: 700; color: var(--accent); }
.wn-ev { padding-left: 10px; border-left: 3px solid var(--c); line-height: 1.3; }
.wn-ev b { display: block; font-size: 13.5px; font-weight: 600; }
.wn-ev small { color: var(--text-2); font-size: 12px; }
.wn-none { color: var(--text-2); font-size: 13px; }

.w-photo { background-size: cover; border: 1px solid rgba(255, 255, 255, .14); }
.wp-label { position: absolute; left: 10px; bottom: 10px; display: inline-flex; gap: 5px; align-items: center; font-size: 11.5px; font-weight: 600; color: #fff; padding: 4px 8px; border-radius: 99px; background: rgba(0, 0, 0, .32); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.wp-label .ic { display: inline; }

.w-batt { display: grid; place-items: center; }
.wb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.wb-item { position: relative; width: 52px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wb-ring { width: 44px; height: 44px; transform: rotate(-90deg); }
.wb-track { fill: none; stroke: var(--tile); stroke-width: 4; }
.wb-fill { fill: none; stroke: #34c759; stroke-width: 4; stroke-linecap: round; }
.wb-ic { position: absolute; top: 14px; }
.wb-item small { font-size: 11px; font-weight: 600; color: var(--text-2); }

/* calendar widget (notification centre) */
.w-cal { padding: 14px 14px 10px; }
.w-cal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.w-cal-head b { color: var(--accent); font-size: 14px; }
.w-cal-head span { color: var(--text-3); font-size: 12px; }
.w-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; row-gap: 2px; }
.w-cal-grid span { height: 26px; display: grid; place-items: center; border-radius: 50%; position: relative; font-variant-numeric: tabular-nums; }
.w-cal-grid.dow span { height: 20px; color: var(--text-3); font-weight: 600; font-size: 11px; }
.w-cal-grid span.today { background: var(--accent); color: var(--accent-fg); font-weight: 700; width: 26px; justify-self: center; }
.w-cal-grid span.has::after { content: ''; position: absolute; bottom: 1px; width: 3px; height: 3px; border-radius: 50%; background: var(--text-2); }

/* ---------------------------------------------------------------------
   Top bar
   --------------------------------------------------------------------- */
#topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 32px; z-index: 4000;
  display: flex; align-items: center; justify-content: space-between; padding: 0 8px;
  color: var(--topbar-fg); font-size: 13px;
}
/* the menu bar follows the wallpaper's brightness, not the app theme */
[data-wp-tone="dark"] #topbar { --topbar-fg: #fff; --topbar-bg: rgba(8, 12, 22, .30); }
[data-wp-tone="light"] #topbar { --topbar-fg: #111827; --topbar-bg: rgba(255, 255, 255, .38); }
[data-wp-tone="dark"] .tb-btn:hover, [data-wp-tone="dark"] .tb-menu:hover, [data-wp-tone="dark"] .tb-app:hover, [data-wp-tone="dark"] .tb-btn.on { background: rgba(255, 255, 255, .16) !important; }
.glass-bar { background: var(--topbar-bg); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8); box-shadow: 0 .5px 0 rgba(0, 0, 0, .18); }
.tb-left, .tb-right { display: flex; align-items: center; gap: 2px; height: 100%; min-width: 0; }
.tb-menus { display: flex; gap: 0; min-width: 0; overflow: hidden; }
.tb-btn, .tb-menu, .tb-app {
  height: 24px; padding: 0 9px; border: 0; background: none; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: inherit; font-weight: 500;
}
.tb-app { font-weight: 700; }
.tb-btn:hover, .tb-menu:hover, .tb-app:hover, .tb-btn.on { background: rgba(255, 255, 255, .16); }
[data-theme="light"] .tb-btn:hover, [data-theme="light"] .tb-menu:hover, [data-theme="light"] .tb-app:hover, [data-theme="light"] .tb-btn.on { background: rgba(0, 0, 0, .08); }
.tb-logo { padding: 0 8px; }
.tb-logo .logo { --sun: var(--accent); }
.tb-tray { gap: 9px; padding: 0 10px; }
.tb-tray .ic { display: inline; }
.batt { display: inline-flex; align-items: center; gap: 5px; }
.batt-pct { font-size: 12px; font-variant-numeric: tabular-nums; }
.tb-clock { gap: 8px; font-variant-numeric: tabular-nums; position: relative; }
.tbc-date { opacity: .92; }
.tb-clock.has-notifs::after, .tray-clock.has-notifs::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 2px; }
.tb-status { display: none; }

/* ---------------------------------------------------------------------
   Dock (default) - floating glass shelf, magnifying
   --------------------------------------------------------------------- */
#dock { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 4000; display: flex; justify-content: center; pointer-events: none; }
.dock-inner {
  pointer-events: auto; display: flex; align-items: flex-end; gap: 6px;
  padding: 9px 10px; border-radius: 30px; height: 74px;
}
[data-layout="dock"] .dock-inner, [data-layout="mobile"] .dock-inner {
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06));
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(255, 255, 255, .05), 0 24px 50px -16px rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(28px) saturate(1.9); backdrop-filter: blur(28px) saturate(1.9);
}
[data-theme="light"][data-layout="dock"] .dock-inner { background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .32)); border-color: rgba(255, 255, 255, .6); }
.dock-center, .dock-apps { display: flex; align-items: flex-end; gap: 6px; height: 100%; }
.dock-weather, .dock-tray, .tb-only { display: none !important; }
.dock-item {
  --mag: 1;
  --dsz: calc(var(--dock-icon) * var(--mag));
  position: relative; border: 0; background: none; padding: 0;
  width: var(--dsz); height: 100%; display: flex; align-items: flex-end; justify-content: center;
  transition: width .14s var(--ease);
}
.dock-item .appicon, .dock-sys-icon {
  width: var(--dsz) !important; height: var(--dsz) !important;
  transform-origin: 50% 100%; transition: width .14s var(--ease), height .14s var(--ease);
}
.dock-sys-icon {
  border-radius: 26%; display: grid; place-items: center; color: var(--text);
  background: var(--tile); box-shadow: inset 0 0 0 1px var(--line);
}
.dock-sys-icon svg { width: 44%; height: 44%; }
.start-tile { --a: var(--accent); --b: #2b2a68; }
.start-tile .logo { --sun: #ffb27a; }
.dock-item::after {
  content: attr(data-label); position: absolute; bottom: calc(var(--dsz) + 18px); left: 50%; transform: translate(-50%, 4px);
  white-space: nowrap; font-size: 12.5px; font-weight: 500; padding: 4px 10px; border-radius: 8px;
  background: var(--glass-strong); color: var(--text); box-shadow: var(--shadow-pop); border: 1px solid var(--glass-border);
  opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s;
}
.dock-item:hover::after { opacity: 1; transform: translate(-50%, 0); }
.run-dot { position: absolute; bottom: -6px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 3px; background: #fff; box-shadow: 0 0 6px rgba(255, 255, 255, .8); opacity: 0; transition: opacity .2s, width .25s var(--ease), margin .25s var(--ease), background .2s; }
.dock-item.running .run-dot { opacity: .9; }
[data-layout="dock"] .dock-item.active .run-dot { width: 14px; margin-left: -7px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
[data-theme="light"] .run-dot { background: #1a1f2b; box-shadow: none; }
.dock-item:active .appicon { filter: brightness(.8); }
.dock-item.bounce .appicon { animation: dock-bounce .7s var(--ease-io); }
@keyframes dock-bounce { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-16px); } 55% { transform: translateY(0); } 72% { transform: translateY(-6px); } }
.dock-sep { width: 1px; align-self: stretch; margin: 8px 4px; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .28), transparent); }
[data-theme="light"] .dock-sep { background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .18), transparent); }
.trash-tile { --a: #a9b8cc; --b: #4b5a70; }
.trash-dot { position: absolute; top: 30%; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* ---------------------------------------------------------------------
   Taskbar layout - single bottom bar, no top bar (Windows-style)
   --------------------------------------------------------------------- */
[data-layout="taskbar"] #topbar { display: none; }
[data-layout="taskbar"] #desktop { top: 0; bottom: 52px; }
[data-layout="taskbar"] #dock { bottom: 0; }
[data-layout="taskbar"] .dock-inner {
  width: 100%; height: 52px; border-radius: 0; border-width: 1px 0 0; padding: 0 0 0 10px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; box-shadow: none;
}
[data-layout="taskbar"] .dock-only { display: none !important; }
[data-layout="taskbar"] .tb-only { display: flex !important; }
[data-layout="taskbar"] .dock-weather {
  display: flex !important; align-items: center; gap: 8px; justify-self: start; padding: 4px 10px; border-radius: 8px; font-size: 12px; line-height: 1.2;
}
[data-layout="taskbar"] .dock-weather:hover { background: var(--hover); }
.dock-weather b { display: block; font-weight: 600; }
.dock-weather small { color: var(--text-2); }
[data-layout="taskbar"] .dock-center, [data-layout="taskbar"] .dock-apps { align-items: center; gap: 2px; }
[data-layout="taskbar"] .dock-item { --dsz: 28px; width: 44px; height: 42px; border-radius: 8px; align-items: center; }
[data-layout="taskbar"] .dock-item:hover, [data-layout="taskbar"] .dock-item.on { background: var(--hover); }
[data-layout="taskbar"] .dock-item.active { background: var(--tile); }
[data-layout="taskbar"] .dock-sys-icon { background: none; box-shadow: none; }
[data-layout="taskbar"] .dock-sys-icon svg { width: 76%; height: 76%; }
[data-layout="taskbar"] .dock-item::after { bottom: 54px; }
[data-layout="taskbar"] .run-dot { bottom: 2px; width: 6px; margin-left: -3px; border-radius: 3px; background: var(--text-3); box-shadow: none; }
[data-layout="taskbar"] .dock-item.active .run-dot { width: 16px; margin-left: -8px; background: var(--accent); opacity: 1; }
[data-layout="taskbar"] .dock-sep { margin: 12px 6px; }
[data-layout="taskbar"] .dock-tray { display: flex !important; justify-self: end; align-items: center; height: 100%; gap: 2px; }
.tray-btn { height: 40px; padding: 0 10px; border: 0; background: none; border-radius: 8px; display: flex; align-items: center; gap: 9px; color: var(--text); }
.tray-btn:hover, .tray-btn.on { background: var(--hover); }
.tray-btn .ic { display: inline; }
.tray-clock { flex-direction: column; align-items: flex-end; justify-content: center; gap: 0; font-size: 12px; line-height: 1.25; font-variant-numeric: tabular-nums; position: relative; }
.tray-clock small { color: var(--text-2); font-size: 11.5px; }
.tray-clock.has-notifs::after { position: absolute; right: 2px; top: 6px; }
.tray-desktop { width: 8px; height: 100%; border: 0; background: none; border-left: 1px solid var(--line); margin-left: 4px; }
.tray-desktop:hover { background: var(--hover); }

/* ---------------------------------------------------------------------
   Top bar visibility by layout × menu placement
   dock: always (status on the right) · island / taskbar: only when menus
   live at the top, and then it is a slim 30px bar with the app menus only
   --------------------------------------------------------------------- */
[data-menus="window"] .tb-menus { display: none; }
[data-layout="island"] #topbar { display: none; }
[data-menus="top"]:is([data-layout="island"], [data-layout="taskbar"]) #topbar { display: flex; height: 30px; padding: 0 10px; }
[data-menus="top"]:is([data-layout="island"], [data-layout="taskbar"]) :is(.tb-logo, .tb-right) { display: none; }
[data-menus="top"]:is([data-layout="island"], [data-layout="taskbar"]) .tb-app { padding-left: 8px; }
[data-menus="top"][data-layout="taskbar"] #desktop { top: 30px; }
[data-menus="top"][data-layout="taskbar"] #notifs { top: 40px; }

/* =====================================================================
   Kambana OS layout ("island"): one floating command bar at the bottom
   and a live island at the top centre
   ===================================================================== */
:root { --cb-h: 56px; --cb-inset: 10px; --cb-r: 18px; --cb-reserve: 76px; --spring: cubic-bezier(.34, 1.3, .5, 1); }
:root, :root[data-theme="dark"] {
  --cb-bg: rgba(18, 22, 32, .72);
  --cb-border: rgba(255, 255, 255, .11);
  --cb-hi: inset 0 1px 0 rgba(255, 255, 255, .08);
  --cb-shadow: 0 18px 44px -18px rgba(0, 0, 0, .7), 0 2px 8px -2px rgba(0, 0, 0, .35);
}
:root[data-theme="light"] {
  --cb-bg: rgba(250, 251, 253, .80);
  --cb-border: rgba(255, 255, 255, .75);
  --cb-hi: inset 0 1px 0 rgba(255, 255, 255, .9);
  --cb-shadow: 0 18px 44px -18px rgba(20, 30, 60, .45), 0 0 0 .5px rgba(10, 20, 40, .12);
}

#cmdbar, #island { display: none; }
[data-layout="island"] #dock, [data-layout="island"] #banners { display: none; }
[data-layout="island"] #cmdbar { display: block; position: absolute; left: var(--cb-inset); right: var(--cb-inset); bottom: var(--cb-inset); z-index: 4000; }
[data-layout="island"] #island { display: block; }
[data-layout="island"] #desktop { top: 0; bottom: var(--cb-reserve); }
[data-layout="island"][data-menus="top"] #desktop { top: 30px; }
[data-layout="island"] .win.is-max { border-radius: 0 0 var(--r-win) var(--r-win); }

.cb-inner {
  height: var(--cb-h); border-radius: var(--cb-r); padding: 0 8px;
  display: flex; align-items: center; gap: 10px;
  background: var(--cb-bg); border: 1px solid var(--cb-border); box-shadow: var(--cb-hi), var(--cb-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8);
  color: var(--text);
}
.no-glass .cb-inner { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-solid); }
/* equal side zones keep the tabs truly centred; the centre gives way first */
.cb-left, .cb-right { flex: 1 1 0; min-width: max-content; display: flex; align-items: center; gap: 6px; height: 100%; }
.cb-right { justify-content: flex-end; gap: 4px; }
.cb-tasks { position: relative; flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 4px; height: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 0 2px; }
.cb-tasks::-webkit-scrollbar { display: none; }

.cb-btn {
  height: 40px; border: 0; background: none; color: inherit; border-radius: 12px; padding: 0 10px;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: background .14s, color .14s, transform .1s;
}
.cb-btn:hover { background: var(--hover); }
.cb-btn:active { transform: scale(.97); }
.cb-btn.on { background: var(--tile-hover); }

.cb-start {
  width: 42px; padding: 0; justify-content: center; border-radius: 13px;
  color: color-mix(in srgb, var(--accent) 78%, var(--text));
  background: linear-gradient(150deg, rgba(var(--accent-rgb), .30), rgba(var(--accent-rgb), .10));
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .32), inset 0 1px 0 rgba(255, 255, 255, .14);
}
[data-theme="light"] .cb-start { color: color-mix(in srgb, var(--accent) 70%, #000); }
.cb-start .logo { --sun: #ffb27a; transition: transform .35s var(--spring); }
.cb-start:hover { background: linear-gradient(150deg, rgba(var(--accent-rgb), .42), rgba(var(--accent-rgb), .18)); }
.cb-start:hover .logo { transform: rotate(-30deg); }
.cb-start.on { background: var(--accent); color: var(--accent-fg); box-shadow: 0 4px 16px -4px rgba(var(--accent-rgb), .8); }

.cb-search {
  height: 38px; width: clamp(180px, 21vw, 300px); min-width: 0; border: 0; border-radius: 19px; padding: 0 6px 0 13px;
  display: flex; align-items: center; gap: 9px; background: var(--tile); color: var(--text-3);
  box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; text-align: left; transition: background .14s, box-shadow .14s;
}
.cb-search:hover { background: var(--tile-hover); color: var(--text-2); }
.cb-search-ph { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-kbd { font: 600 10.5px/1 var(--font); letter-spacing: .02em; padding: 5px 7px; border-radius: 7px; color: var(--text-2); background: var(--tile); box-shadow: inset 0 0 0 1px var(--line), inset 0 -1px 0 var(--line-2); white-space: nowrap; }

/* window tabs */
.cb-tab {
  position: relative; height: 40px; min-width: 44px; max-width: 200px; flex: 0 1 auto; border: 0; border-radius: 12px;
  padding: 0 12px 0 10px; display: flex; align-items: center; gap: 8px; background: none; color: var(--text-2);
  font-size: 12.5px; font-weight: 600; transition: background .16s, color .16s, opacity .2s, transform .25s var(--spring), max-width .3s var(--ease);
}
.cb-tab.new { transform: translateY(12px) scale(.9); opacity: 0; }
.cb-tab-ic { display: grid; flex: 0 0 auto; }
.cb-tab-ic .appicon { box-shadow: none !important; }
.cb-tab-ic .rt-badge { display: none; }
.cb-tab-t { min-width: 0; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-tab::after { /* state rail: short grey dash for open, long accent bar for the focused window */
  content: ''; position: absolute; left: 50%; bottom: 2px; width: 6px; height: 3px; margin-left: -3px; border-radius: 2px;
  background: var(--text-3); opacity: .7; transition: width .25s var(--ease), margin .25s var(--ease), background .2s, opacity .2s;
}
.cb-tab:hover { background: var(--hover); color: var(--text); }
.cb-tab.active { background: var(--tile-hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 rgba(255, 255, 255, .05); }
.cb-tab.active::after { width: 22px; margin-left: -11px; background: var(--accent); opacity: 1; box-shadow: 0 0 10px rgba(var(--accent-rgb), .9); }
.cb-tab.min { opacity: .58; }
.cb-tab.min .cb-tab-ic { filter: saturate(.5); }
.cb-tab.min::after { opacity: 0; }
.cb-tasks.crowded .cb-tab-t { max-width: 90px; }
.cb-tip {
  position: absolute; z-index: 7000; transform: translate(-50%, 4px); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 9px; pointer-events: none;
  background: var(--glass-strong); color: var(--text); box-shadow: var(--shadow-pop); border: 1px solid var(--glass-border);
  opacity: 0; transition: opacity .12s, transform .12s;
}
.cb-tip.on { opacity: 1; transform: translate(-50%, 0); }
.cb-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; padding: 0 8px; }
.cb-hint .logo { --sun: var(--text-3); }
.cb-hint .cb-kbd { padding: 3px 6px; color: var(--text-3); }

/* now-playing chip */
.cb-media { display: none; align-items: center; height: 38px; border-radius: 19px; padding: 0 3px 0 4px; background: var(--tile); box-shadow: inset 0 0 0 1px var(--line); margin-right: 4px; }
.cb-media.on { display: flex; }
.cb-media-main { display: flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--text); padding: 0 4px 0 0; height: 100%; min-width: 0; }
.cb-media-t { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.cb-art { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.cb-media-btn { width: 30px; height: 30px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--surface); padding: 0; }
.cb-media-btn:hover { filter: brightness(1.1); }

/* equaliser bars (now playing) */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq b { width: 2.5px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: 50% 100%; transform: scaleY(.3); }
.playing .eq b, .eq.playing b { animation: eq .9s ease-in-out infinite alternate; }
.eq b:nth-child(2) { animation-delay: -.35s !important; } .eq b:nth-child(3) { animation-delay: -.6s !important; } .eq b:nth-child(4) { animation-delay: -.15s !important; }
@keyframes eq { 0% { transform: scaleY(.25); } 50% { transform: scaleY(1); } 100% { transform: scaleY(.45); } }
.cb-art .eq { color: #fff; height: 11px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }

.cb-status { gap: 10px; padding: 0 12px; }
.cb-status .ic, .cb-status svg { display: inline; }
.cb-status .batt-pct { display: none; }
.cb-clock { flex-direction: column; align-items: flex-end; justify-content: center; gap: 1px; line-height: 1.15; padding: 0 12px; font-variant-numeric: tabular-nums; position: relative; }
.cb-clock b { font-size: 13px; font-weight: 700; }
.cb-clock small { font-size: 11.5px; color: var(--text-2); }
.cb-clock.has-notifs::after { content: ''; position: absolute; top: 5px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--cb-bg); }
.cb-desktop { width: 12px; height: 40px; border: 0; padding: 0; margin-left: 2px; border-radius: 6px; background: none; display: grid; place-items: center; }
.cb-desktop::after { content: ''; width: 3px; height: 20px; border-radius: 2px; background: var(--line-2); transition: background .15s, height .2s var(--ease); }
.cb-desktop:hover::after { background: var(--accent); height: 28px; }

@media (max-width: 1240px) {
  .cb-search { width: 40px; padding: 0; justify-content: center; }
  .cb-search .cb-search-ph, .cb-search .cb-kbd { display: none; }
  .cb-media-t { max-width: 70px; }
}
@media (max-width: 960px) { .cb-media-t { display: none; } .cb-hint { display: none; } }

/* launcher, quick settings and notifications rise out of the bar */
[data-layout="island"] #launcher { left: var(--cb-inset); bottom: calc(var(--cb-reserve) + 0px); transform-origin: 0 100%; }
[data-layout="island"] #control { top: auto; right: var(--cb-inset); bottom: var(--cb-reserve); transform-origin: 100% 100%; }
[data-layout="island"] #notifs { top: var(--cb-inset); right: var(--cb-inset); bottom: var(--cb-reserve); }
[data-layout="island"][data-menus="top"] #notifs { top: 40px; }
[data-layout="island"] .toast-pill { bottom: 92px; }

/* ---------- the island ---------- */
#island {
  position: absolute; top: 8px; left: 50%; z-index: 6600; width: 120px; height: 30px;
  transform: translateX(-50%); border-radius: 22px; overflow: hidden; color: #f4f6fb;
  background: rgba(10, 12, 18, .92); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6);
  box-shadow: 0 12px 34px -12px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: width .5s var(--spring), height .5s var(--spring), border-radius .4s var(--ease), opacity .25s, transform .4s var(--spring);
  cursor: default;
}
#island.idle { opacity: 0; transform: translate(-50%, -14px) scale(.7); pointer-events: none; }
#island.compact, #island.mini { border-radius: 17px; }
#island.mini { border-radius: 15px; }
#island.expanded { border-radius: 26px; }
#island.banner { border-radius: 24px; }
[data-menus="top"] #island { top: 3px; }
[data-menus="top"] #island.compact, [data-menus="top"] #island.mini { height: 24px !important; }
.is-inner { position: relative; }
.is-compact { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 4px; white-space: nowrap; }
[data-menus="top"] .is-compact { height: 24px; padding-left: 2px; }
[data-menus="top"] .is-compact .is-art { width: 20px; height: 20px; }
.is-art { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.is-art.big { width: 52px; height: 52px; border-radius: 14px; }
.is-art.big .ic { width: 22px; height: 22px; }
.is-ct { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; font-weight: 600; }
.is-compact .eq { color: color-mix(in srgb, var(--accent) 65%, #fff); }
#island.mini .is-ct { display: none; }
#island.mini .is-compact { justify-content: space-between; padding-right: 12px; }
#island:not(.idle):hover { box-shadow: 0 14px 36px -12px rgba(0, 0, 0, .75), inset 0 0 0 1px rgba(255, 255, 255, .16); }

.is-media-x { display: flex; align-items: center; gap: 12px; padding: 12px 14px 4px; width: 380px; }
.is-mt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.is-mt b, .is-mt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-mt b { font-size: 14px; }
.is-mt small { color: rgba(244, 246, 251, .62); font-size: 12.5px; }
.is-ctl { display: flex; justify-content: center; align-items: center; gap: 8px; width: 380px; padding: 2px 0 10px; }
.is-ctl button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: inherit; display: grid; place-items: center; padding: 0; }
.is-ctl button:hover { background: rgba(255, 255, 255, .12); }
.is-ctl .is-play { width: 42px; height: 42px; background: #fff; color: #0b0d12; }
.is-ctl .is-play:hover { background: #fff; filter: brightness(.92); }
.is-ctl button:last-child { position: absolute; right: 12px; top: 14px; width: 30px; height: 30px; color: rgba(255, 255, 255, .7); }

.is-banner { display: flex; align-items: center; gap: 12px; width: min(400px, calc(100vw - 24px)); padding: 12px 40px 12px 12px; }
.is-bn-ic { display: grid; flex: 0 0 auto; }
.is-bn-ic .appicon { box-shadow: none !important; }
.is-bn-ic .rt-badge { display: none; }
.is-bn-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.is-bn-top { display: flex; gap: 6px; align-items: baseline; font-size: 11.5px; color: rgba(244, 246, 251, .6); }
.is-bn-top b { font-weight: 600; }
.is-bn-title { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-bn-body { font-size: 12.5px; color: rgba(244, 246, 251, .75); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.is-x { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .8); }
.is-x:hover { background: rgba(255, 255, 255, .2); color: #fff; }
#island .is-inner > * { animation: is-in .35s .08s var(--ease) both; }
@keyframes is-in { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: none; } }
#island :focus-visible { outline-color: #fff; }

/* ---------------------------------------------------------------------
   Windows
   --------------------------------------------------------------------- */
#windows { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.win {
  position: absolute; pointer-events: auto; display: flex; flex-direction: column;
  min-width: 0; border-radius: var(--r-win); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-win-blur);
  transition: box-shadow .2s, opacity .2s var(--ease), transform .24s var(--ease);
  contain: layout;
}
.win.focused { box-shadow: var(--shadow-win); }
.win.opening { opacity: 0; transform: scale(.94) translateY(8px); }
.win.closing { opacity: 0; transform: scale(.95); pointer-events: none; transition-duration: .16s; }
.win.minimized { visibility: hidden; pointer-events: none; }
.win.animating { transition: left .24s var(--ease), top .24s var(--ease), width .24s var(--ease), height .24s var(--ease), border-radius .24s; }
.win.is-max { border-radius: 0; }
[data-layout="dock"] .win.is-max { border-radius: 0 0 10px 10px; }
.win.is-snapped { border-radius: 10px; }

.win-bar {
  position: relative; z-index: 2; height: 40px; flex: 0 0 auto; display: flex; align-items: center; gap: 4px; padding: 0 6px;
  background: var(--bar); -webkit-backdrop-filter: blur(30px) saturate(1.6); backdrop-filter: blur(30px) saturate(1.6);
  border-bottom: 1px solid var(--line);
}
.win:not(.focused) .win-bar { color: var(--text-2); }
/* app icon + title: also the button for the app menu (About / Settings / Hide / Quit) */
.win-title {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; height: 30px; padding: 0 9px 0 7px; margin: 0;
  border: 0; border-radius: 9px; background: none; color: inherit; font-size: 13px; font-weight: 600; text-align: left;
  transition: background .12s;
}
.win-title:hover { background: var(--hover); }
.win-title:active { background: var(--press); }
.win-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.win-title-icon { display: grid; }
.win-title-icon .appicon { box-shadow: none !important; }
.win-title-icon .rt-badge { display: none; }
.win-bar-extra { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; height: 100%; }
.win-bar-extra:empty { pointer-events: none; }
.win-body { position: relative; flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }

/* app menus inside the title bar (Settings → Appearance → App menus: In the window) */
.win-menus { display: flex; align-items: center; gap: 1px; flex: 0 0 auto; margin-right: 4px; }
.wm-menu, .wm-more { /* inherit the bar's colour so apps with tinted title bars stay readable */
  height: 28px; padding: 0 9px; border: 0; border-radius: 8px; background: none; color: inherit; opacity: .74;
  font-size: 12.5px; font-weight: 500; white-space: nowrap; transition: background .12s, opacity .12s;
}
.wm-menu:hover, .wm-more:hover { background: color-mix(in srgb, currentColor 12%, transparent); opacity: 1; }
.wm-more { display: none; width: 32px; padding: 0; place-items: center; }
.wm-menu.wm-app { opacity: 1; font-weight: 700; }
.win.menus-collapsed .wm-menu { display: none; }
.win.menus-collapsed .wm-more { display: grid; }
.win.menus-measure .win-bar-extra { flex: 0 0 auto !important; }
.win.menus-measure .win-bar-extra > * { flex-shrink: 0 !important; }
.win.menus-measure .win-title { flex-shrink: 0; }
.win.menus-measure .win-title-text { max-width: 160px; }
[data-menus="top"] .win-menus { display: none; }
.win:not(.focused) .wm-menu { opacity: .55; }

/* window buttons: order (right = min, max, close · left = close, min, max) */
.win-ctrl { display: flex; align-items: center; flex: 0 0 auto; order: 99; }
[data-buttons="left"] .win-ctrl { order: -1; }
.wc { padding: 0; border: 0; display: grid; place-items: center; flex: 0 0 auto; }
.wc-min { order: 1; } .wc-max { order: 2; } .wc-close { order: 3; }
[data-buttons="left"] .wc-close { order: 0; }

/* Pill (default) - three round monochrome buttons in one soft capsule */
[data-btnstyle="pill"] .win-ctrl { gap: 2px; padding: 2px; border-radius: 99px; background: color-mix(in srgb, currentColor 7%, transparent); margin: 0 2px; }
[data-btnstyle="pill"] .wc { width: 28px; height: 28px; border-radius: 50%; background: none; color: inherit; transition: background .12s, color .12s; }
[data-btnstyle="pill"] .wc .ic { opacity: .78; transition: opacity .12s; }
[data-btnstyle="pill"] .wc:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
[data-btnstyle="pill"] .wc:hover .ic { opacity: 1; }
[data-btnstyle="pill"] .wc:active { background: color-mix(in srgb, currentColor 22%, transparent); }
[data-btnstyle="pill"] .wc-close:hover, [data-btnstyle="pill"] .wc-close:focus-visible { background: #e5484d; color: #fff; }
[data-btnstyle="pill"] .win:not(.focused) .wc .ic { opacity: .5; }
[data-btnstyle="pill"] .win:not(.focused) .win-ctrl { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 12%, transparent); }

/* Dots - coloured lights */
[data-btnstyle="lights"] .win-ctrl { gap: 8px; padding: 0 8px; }
[data-btnstyle="lights"] .wc { width: 13px; height: 13px; border-radius: 50%; color: transparent; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .25); }
[data-btnstyle="lights"] .wc .ic { width: 8px; height: 8px; stroke-width: 3; }
[data-btnstyle="lights"] .wc-close { background: #ff5f57; }
[data-btnstyle="lights"] .wc-min { background: #febc2e; }
[data-btnstyle="lights"] .wc-max { background: #28c840; }
[data-btnstyle="lights"] .win-ctrl:hover .wc { color: rgba(0, 0, 0, .62); }
[data-btnstyle="lights"] .win:not(.focused) .win-ctrl:not(:hover) .wc { background: var(--line-2); box-shadow: none; }

/* Square - classic full-height rectangles */
[data-btnstyle="square"] .win-ctrl { align-self: stretch; height: auto; gap: 0; }
[data-btnstyle="square"][data-buttons="right"] .win-bar { padding-right: 0; }
[data-btnstyle="square"][data-buttons="left"] .win-bar { padding-left: 0; }
[data-btnstyle="square"] .wc { width: 46px; height: 100%; border-radius: 0; background: none; color: inherit; }
[data-btnstyle="square"] .wc .ic { width: 13px; height: 13px; opacity: .8; }
[data-btnstyle="square"] .wc:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
[data-btnstyle="square"] .wc:hover .ic { opacity: 1; }
[data-btnstyle="square"] .wc-close:hover { background: #e5484d; color: #fff; }

/* resize handles */
.rz { position: absolute; z-index: 5; }
.rz-n, .rz-s { left: 10px; right: 10px; height: 6px; cursor: ns-resize; }
.rz-n { top: 0; } .rz-s { bottom: 0; }
.rz-e, .rz-w { top: 10px; bottom: 10px; width: 6px; cursor: ew-resize; }
.rz-e { right: 0; } .rz-w { left: 0; }
.rz-ne, .rz-nw, .rz-se, .rz-sw { width: 14px; height: 14px; }
.rz-ne { top: 0; right: 0; cursor: nesw-resize; } .rz-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.rz-nw { top: 0; left: 0; cursor: nwse-resize; } .rz-se { bottom: 0; right: 0; cursor: nwse-resize; }
.win.is-max .rz { display: none; }
.wm-dragging, .wm-dragging * { cursor: grabbing !important; }
.wm-dragging iframe, .wm-dragging video { pointer-events: none; }
.wm-dragging .win { transition: none; }

/* snap preview + flyout */
.snap-preview {
  position: absolute; z-index: 5; border-radius: 16px; pointer-events: none; opacity: 0; transform: scale(.96);
  background: rgba(var(--accent-rgb), .16); border: 1.5px solid rgba(var(--accent-rgb), .55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: opacity .16s, transform .2s var(--ease), left .18s var(--ease), top .18s var(--ease), width .18s var(--ease), height .18s var(--ease);
}
.snap-preview.on { opacity: 1; transform: none; }
.snap-flyout { position: fixed; z-index: 7000; padding: 10px 12px 12px; border-radius: 16px; animation: fade-in .14s var(--ease); }
.sf-title { font-size: 11.5px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.sf-grid { display: grid; grid-template-columns: repeat(2, 92px); gap: 10px; }
.sf-layout { height: 58px; display: flex; gap: 3px; padding: 3px; border-radius: 9px; background: var(--tile); }
.sf-layout.quad { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.sf-zone { border: 0; border-radius: 5px; background: var(--tile-hover); padding: 0; min-width: 0; }
.sf-zone.w50 { flex: 1; } .sf-zone.w66 { flex: 2; } .sf-zone.w33 { flex: 1; }
.sf-zone:hover { background: var(--accent); }

/* overview */
.win.ov { transition: transform .38s var(--ease), box-shadow .2s; cursor: pointer !important; overflow: visible; }
.win.ov > *:not(.ov-label) { pointer-events: none; }
.win.ov .win-body, .win.ov .win-bar { border-radius: inherit; }
.win.ov:hover { box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .9), var(--shadow-win); }
.ov-label {
  position: absolute; left: 50%; top: calc(100% + 14px); translate: -50% 0; transform-origin: 50% 0;
  display: flex; align-items: center; gap: 8px; white-space: nowrap; padding: 6px 12px 6px 6px; border-radius: 12px;
  background: var(--glass-strong); color: var(--text); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-pop);
}

/* ---------------------------------------------------------------------
   Panels: launcher, control centre, notifications
   --------------------------------------------------------------------- */
.panel {
  position: absolute; z-index: 5000; opacity: 0; pointer-events: none; visibility: hidden;
  transform: translateY(10px) scale(.985); transform-origin: 50% 100%;
  transition: opacity .18s var(--ease), transform .26s var(--ease), visibility 0s .26s;
}
.panel.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .18s var(--ease), transform .26s var(--ease), visibility 0s; }
#launcher {
  left: calc(50% - min(380px, 48vw)); width: min(760px, 96vw); bottom: 98px; height: min(620px, calc(100vh - 140px));
  border-radius: var(--r-panel); padding: 0; display: grid; grid-template-columns: 200px minmax(0, 1fr); overflow: hidden;
  background: var(--glass-strong);
}
[data-layout="taskbar"] #launcher { bottom: 62px; }
[data-layout="island"] #launcher { width: min(760px, calc(100vw - 20px)); height: min(620px, calc(100vh - 96px)); }
[data-layout="island"][data-menus="top"] #launcher { height: min(620px, calc(100vh - 126px)); }
.ln-side { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px 12px; background: color-mix(in srgb, var(--text) 4%, transparent); border-right: 1px solid var(--line); min-height: 0; overflow-y: auto; }
.ln-side-label { font-size: 11.5px; font-weight: 700; color: var(--text-3); padding: 14px 10px 4px; }
.ln-side-fill { flex: 1; }
.ln-place { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px; border: 0; background: none; border-radius: 10px; color: var(--text); font-size: 13px; font-weight: 500; text-align: left; }
.ln-place:hover { background: var(--hover); }
.ln-place-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); flex: 0 0 auto; }
.ln-main { display: flex; flex-direction: column; gap: 12px; padding: 16px 16px 14px; min-height: 0; min-width: 0; }
.ln-grid-title { grid-column: 1 / -1; align-self: end; font-size: 12px; font-weight: 700; color: var(--text-2); padding: 6px 6px 2px; height: auto; }
.ln-search { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 22px; background: var(--tile); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); flex: 0 0 auto; }
.ln-search:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.ln-search input { flex: 1; border: 0; background: none; outline: none; font-size: 14.5px; color: var(--text); }
.ln-search input::placeholder { color: var(--text-3); }
.ln-chips { display: flex; gap: 6px; flex: 0 0 auto; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 0 2px; }
.ln-chips::-webkit-scrollbar { display: none; }
.ln-chips .chip { flex: 0 0 auto; height: 28px; padding: 0 11px; }
.ln-section-title { font-size: 13px; font-weight: 700; padding: 0 4px; display: flex; justify-content: space-between; }
.ln-apps { flex: 1; min-height: 120px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); grid-auto-rows: auto; gap: 2px; margin: 0 -6px; padding: 0 6px; align-content: start; }
.ln-apps .ln-app { height: 94px; }
.ln-app { border: 0; background: none; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--text); padding: 6px 2px; }
.ln-app span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-app:hover { background: var(--hover); }
.ln-empty { grid-column: 1 / -1; padding: 30px 10px; text-align: center; color: var(--text-2); }
.ln-recent { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ln-file { border: 0; background: none; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; text-align: left; min-width: 0; color: var(--text); }
.ln-file:hover { background: var(--hover); }
.file-glyph { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--tile); flex: 0 0 auto; }
.lf-text { min-width: 0; display: flex; flex-direction: column; }
.lf-text b, .lf-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-text b { font-weight: 600; font-size: 13px; }
.lf-text small { color: var(--text-3); font-size: 11.5px; }
.ln-user { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 6px; border-radius: 14px; color: var(--text); text-align: left; min-width: 0; }
.ln-user:hover { background: var(--hover); }
.ln-user .avatar { width: 38px; height: 38px; font-size: 16px; flex: 0 0 auto; }
.ln-user-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ln-user-t b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-user-t small { font-size: 11.5px; color: var(--text-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(140deg, var(--accent), #2b2a68); }
.ln-actions { display: flex; gap: 4px; }

#control {
  right: 8px; top: 40px; width: 360px; border-radius: var(--r-panel); padding: 14px; transform-origin: 100% 0;
  display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 140px); overflow-y: auto;
}
[data-layout="taskbar"] #control { top: auto; bottom: 62px; right: 10px; transform-origin: 100% 100%; }
.cc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cc-tile { border: 0; border-radius: var(--r-tile); background: var(--tile); color: var(--text); display: flex; align-items: center; gap: 10px; padding: 10px; text-align: left; min-width: 0; transition: background .15s; }
.cc-tile:hover { background: var(--tile-hover); }
.cc-tile.wide { grid-column: span 2; }
.cc-tile.sq { flex-direction: column; align-items: flex-start; justify-content: space-between; height: 76px; gap: 6px; }
.cc-tile.sq .cc-txt b { font-size: 12px; }
.cc-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--tile-hover); flex: 0 0 auto; transition: background .15s, color .15s; }
.cc-tile.on .cc-ic { background: var(--accent); color: var(--accent-fg); }
.cc-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cc-txt b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-txt small { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-mini .cc-tile { flex-direction: column; justify-content: center; gap: 6px; padding: 10px 4px; text-align: center; align-items: center; }
.cc-mini .cc-ic { background: none; width: auto; height: auto; }
.cc-mini .cc-txt b { font-size: 11.5px; font-weight: 500; }
.cc-mini .cc-tile.on { background: var(--accent); color: var(--accent-fg); }
.cc-slider { display: block; background: var(--tile); border-radius: var(--r-tile); padding: 10px 12px 12px; }
.cc-slider-label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.cc-slider-track { position: relative; display: block; height: 30px; border-radius: 15px; background: var(--tile-hover); overflow: hidden; }
.cc-slider-track::before { content: ''; position: absolute; inset: 0 auto 0 0; width: max(30px, var(--v)); background: #fff; border-radius: 15px; transition: width .05s; }
[data-theme="light"] .cc-slider-track::before { background: #fff; box-shadow: 0 0 0 1px var(--line-2); }
.cc-slider-ic { position: absolute; left: 8px; top: 7px; color: #1a1f2b; z-index: 1; pointer-events: none; }
.cc-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cc-media { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-tile); background: var(--tile); }
.cc-art { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--tile-hover); color: #fff; flex: 0 0 auto; }
.cc-media.empty .cc-art { color: var(--text-2); }
.cc-media-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cc-media-txt b, .cc-media-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-media-txt b { font-size: 13px; }
.cc-media-txt small { color: var(--text-2); font-size: 12px; }
.cc-media-btns { display: flex; align-items: center; }
.cc-foot { display: flex; justify-content: space-between; align-items: center; padding: 0 2px; font-size: 12.5px; color: var(--text-2); }
.cc-foot > div { display: flex; gap: 2px; }
.cc-batt { display: inline-flex; gap: 6px; align-items: center; }

#notifs {
  right: 8px; top: 40px; bottom: 98px; width: 360px; overflow-y: auto; overflow-x: hidden; transform-origin: 100% 0;
  display: flex; flex-direction: column; gap: 10px; padding: 2px; transform: translateX(24px);
  scrollbar-width: none;
}
#notifs::-webkit-scrollbar { display: none; }
#notifs.open { transform: none; }
[data-layout="taskbar"] #notifs { top: 10px; bottom: 62px; right: 10px; }
.nc-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: var(--r-panel); }
.nc-date { display: flex; flex-direction: column; line-height: 1.2; }
.nc-date b { font-size: 13px; color: var(--accent); }
.nc-date span { font-family: var(--font-display); font-size: 24px; font-weight: 400; }
.nc-list { display: flex; flex-direction: column; gap: 8px; }
.nc-list-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 8px; font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.nc-list-head .link { color: #fff; }
.nc-empty { display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: var(--r-tile); color: var(--text-2); font-size: 13px; }
#notifs .widget { flex: 0 0 auto; }
#notifs .glass { background: var(--glass-strong); } /* the scrolling list can't always blur what's behind it */

/* notification cards + banners */
.notif { position: relative; border-radius: 18px; padding: 10px 14px 12px; cursor: default; transition: transform .3s var(--ease), opacity .3s; }
.notif:hover .notif-x { opacity: 1; }
.notif-top { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-2); margin-bottom: 4px; }
.notif-top .appicon { box-shadow: none !important; }
.notif-top .rt-badge { display: none; }
.notif-app { font-weight: 600; }
.notif-time { margin-left: auto; padding-right: 14px; }
.notif-title { font-weight: 700; font-size: 13.5px; }
.notif-body { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.notif-x { position: absolute; top: -6px; left: -6px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass-strong); color: var(--text); display: grid; place-items: center; opacity: 0; transition: opacity .15s; padding: 0; box-shadow: var(--shadow-pop); }
.notif.out { opacity: 0; transform: translateX(40px); }
#banners { position: absolute; top: 42px; right: 10px; width: 350px; z-index: 6500; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
[data-layout="taskbar"] #banners { top: auto; bottom: 64px; flex-direction: column-reverse; }
#banners .notif { pointer-events: auto; animation: banner-in .45s var(--ease); }
@keyframes banner-in { from { opacity: 0; transform: translateX(60px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------
   Spotlight
   --------------------------------------------------------------------- */
#spotlight { position: absolute; inset: 0; z-index: 6000; display: none; }
#spotlight.open { display: block; }
.sp-box { position: absolute; left: 50%; top: 16vh; width: min(660px, 92vw); transform: translateX(-50%); border-radius: 20px; overflow: hidden; background: var(--glass-strong); animation: pop-in .18s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateX(-50%) scale(.97); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sp-input { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 20px; color: var(--text-2); }
#spotlight.has-q .sp-input { border-bottom: 1px solid var(--line); }
.sp-input input { flex: 1; border: 0; background: none; outline: none; font-size: 21px; font-weight: 400; color: var(--text); }
.sp-input input::placeholder { color: var(--text-3); }
.sp-results { max-height: 52vh; overflow-y: auto; padding: 4px 8px 10px; }
.sp-group { font-size: 11.5px; font-weight: 700; color: var(--text-3); padding: 10px 12px 4px; }
.sp-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 7px 12px; border: 0; background: none; border-radius: 10px; text-align: left; color: var(--text); }
.sp-item.sel { background: var(--accent); color: var(--accent-fg); }
.sp-item.sel .sp-text small { color: inherit; opacity: .8; }
.sp-glyph { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--tile); flex: 0 0 auto; }
.sp-item.sel .sp-glyph { background: rgba(255, 255, 255, .2); }
.sp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sp-text b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-text small { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-enter { opacity: 0; }
.sp-item.sel .sp-enter { opacity: .8; }
.sp-suggest { display: flex; gap: 6px; padding: 6px 4px 6px; flex-wrap: wrap; }
.sp-sapp { width: 92px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 0; background: none; border-radius: 14px; font-size: 12px; color: var(--text); }
.sp-sapp:hover { background: var(--hover); }

/* ---------------------------------------------------------------------
   Menus, dialogs, toasts
   --------------------------------------------------------------------- */
.menu {
  position: fixed; z-index: 8000; min-width: 220px; max-width: 320px; padding: 5px; border-radius: 12px;
  background: var(--glass-strong); animation: menu-in .12s var(--ease); font-size: 13px;
}
.menu.submenu { position: absolute; }
.menu.closing { opacity: 0; transition: opacity .1s; }
@keyframes menu-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.menu-item { width: 100%; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px 0 6px; border: 0; background: none; border-radius: 7px; color: var(--text); text-align: left; white-space: nowrap; }
.menu-item:hover:not(:disabled), .menu-item.has-sub:hover { background: var(--accent); color: var(--accent-fg); }
.menu-item:disabled { color: var(--text-3); }
.menu-item.danger:hover { background: #e5484d; color: #fff; }
.mi-icon { width: 18px; display: grid; place-items: center; opacity: .85; }
.mi-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.mi-kbd { font-size: 11.5px; opacity: .55; padding-left: 16px; }
.menu-sep { height: 1px; margin: 5px 8px; background: var(--line-2); }
.menu-header { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 700; color: var(--text-3); }

.modal-layer { position: absolute; inset: 0; z-index: 8500; display: grid; place-items: center; background: rgba(0, 0, 0, .28); animation: fade-in .16s; }
.modal-layer.closing { opacity: 0; transition: opacity .16s; }
.dialog { width: min(340px, 90vw); border-radius: 20px; padding: 22px 20px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; background: var(--glass-strong); animation: dialog-in .24s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.dialog-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: var(--accent-fg); background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); margin-bottom: 4px; }
.dialog-icon.danger { background: linear-gradient(150deg, #ff6b6b, #c0262d); color: #fff; }
.dialog-title { margin: 0; font-size: 15.5px; font-weight: 700; }
.dialog-msg { margin: 0; font-size: 13px; color: var(--text-2); white-space: pre-line; align-self: stretch; text-align: center; }
.dialog .input { width: 100%; margin-top: 4px; }
.dialog-actions { display: flex; gap: 8px; width: 100%; margin-top: 10px; }
.dialog-actions .btn { flex: 1; }

.toast-pill { position: absolute; z-index: 8800; left: 50%; bottom: 110px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 99px; font-size: 13px; font-weight: 500; background: var(--glass-strong); animation: toast-in .3s var(--ease); }
.toast-pill.out { opacity: 0; transform: translate(-50%, 10px); transition: all .3s; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translateX(-50%); } }
.shot-flash { position: absolute; inset: 0; z-index: 9900; background: #fff; pointer-events: none; animation: flash .55s ease-out forwards; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }

/* ---------------------------------------------------------------------
   App icons. Three looks, chosen in Settings → Appearance:
   Glass (default), Themed (follows accent), Classic (gradient tile)
   --------------------------------------------------------------------- */
.appicon {
  --s: 48px;
  position: relative; width: var(--s); height: var(--s); flex: 0 0 auto; border-radius: 26%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(150deg, var(--a), var(--b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -1px 2px rgba(0, 0, 0, .18), 0 2px 6px -1px rgba(0, 0, 0, .3);
}
.appicon::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(120% 80% at 20% 0%, rgba(255, 255, 255, .28), transparent 55%); pointer-events: none; }
.appicon > svg.appicon-glyph { width: 54%; height: 54%; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .25)); position: relative; }

/* Flat (default) - one solid colour, white symbol, no gloss or glow */
.icons-flat .appicon {
  color: #fff;
  background: color-mix(in srgb, var(--a) 40%, var(--b));
  box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.icons-flat .appicon::before { display: none; }
.icons-flat .appicon > svg.appicon-glyph { filter: none; width: 52%; height: 52%; }

/* Glass - frosted tile with a glowing, tinted symbol */
.icons-glass .appicon {
  color: color-mix(in srgb, var(--a) 22%, #fff);
  background:
    radial-gradient(70% 70% at 50% 60%, color-mix(in srgb, var(--a) 72%, transparent) 0%, color-mix(in srgb, var(--b) 40%, transparent) 52%, transparent 78%),
    linear-gradient(165deg, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .08) 52%, rgba(255, 255, 255, .14) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(1.8); backdrop-filter: blur(14px) saturate(1.8);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .20),
    inset 0 1.5px 0 rgba(255, 255, 255, .55),
    inset 0 -8px 16px -8px color-mix(in srgb, var(--b) 75%, transparent),
    0 8px 18px -8px rgba(0, 0, 0, .55);
}
.icons-glass .appicon::before { background: radial-gradient(110% 60% at 28% -8%, rgba(255, 255, 255, .55), transparent 58%); opacity: .75; }
.icons-glass .appicon > svg.appicon-glyph { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--a) 95%, transparent)) drop-shadow(0 1px 0 rgba(0, 0, 0, .3)); }
[data-theme="light"].icons-glass .appicon {
  color: color-mix(in srgb, var(--b) 80%, #000);
  background:
    radial-gradient(70% 70% at 50% 62%, color-mix(in srgb, var(--a) 62%, transparent) 0%, color-mix(in srgb, var(--b) 18%, transparent) 55%, transparent 78%),
    linear-gradient(165deg, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, .55) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), inset 0 -6px 14px -8px color-mix(in srgb, var(--a) 60%, transparent), 0 6px 14px -8px rgba(20, 30, 60, .45), 0 0 0 .5px rgba(0, 0, 0, .08);
}
[data-theme="light"].icons-glass .appicon > svg.appicon-glyph { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--a) 55%, transparent)); }

/* Themed - round tiles tinted by the system accent (dynamic colour) */
.icons-themed .appicon {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent), 0 4px 12px -6px rgba(0, 0, 0, .4);
  border-radius: 50%;
}
.icons-themed .appicon::before { display: none; }
.icons-themed .appicon > svg.appicon-glyph { filter: none; width: 50%; height: 50%; }

.rt-badge { position: absolute; right: -3px; bottom: -3px; width: 42%; height: 42%; max-width: 22px; max-height: 22px; min-width: 12px; min-height: 12px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 0 0 2px var(--surface); }
.rt-badge svg { width: 62%; height: 62%; }
.rt-android { background: #22a565; }
.rt-windows { background: #2f7cf6; }
.rt-linux { background: #e7a400; color: #1a1300; }

/* ---------------------------------------------------------------------
   Overlays: brightness, night light
   --------------------------------------------------------------------- */
#dim { position: absolute; inset: 0; z-index: 9800; pointer-events: none; background: #000; opacity: var(--dim, 0); }
#night { position: absolute; inset: 0; z-index: 9790; pointer-events: none; background: #ff9a3d; mix-blend-mode: multiply; opacity: 0; transition: opacity .8s; }
.night-light #night { opacity: .22; }

/* ---------------------------------------------------------------------
   Boot + lock + power
   --------------------------------------------------------------------- */
#boot { position: absolute; inset: 0; z-index: 9500; background: #04060c; color: #fff; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
#boot.show { display: flex; }
#boot.done { opacity: 0; transition: opacity .7s ease; }
.boot-logo { color: #e8fbf9; --sun: #ffb27a; }
.boot-logo circle:first-child { stroke-dasharray: 66; stroke-dashoffset: 66; animation: draw 1.2s .2s var(--ease) forwards; }
.boot-logo circle:last-child { transform-origin: 16px 16px; transform: scale(0); animation: sun 0.6s 1s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes sun { to { transform: scale(1); } }
.boot-name { font-family: var(--font-display); font-weight: 300; font-size: 26px; letter-spacing: .14em; opacity: 0; animation: fade-in .8s .9s forwards; }
.boot-bar { width: 150px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-top: 30px; }
.boot-bar i { display: block; height: 100%; width: 0; background: #fff; border-radius: 2px; animation: boot-fill var(--boot, 2.3s) var(--ease-io) forwards; }
@keyframes boot-fill { to { width: 100%; } }

#lock { position: absolute; inset: 0; z-index: 9000; display: none; color: #fff; overflow: hidden; }
#lock.show, #lock.hide { display: block; }
#lock.hide { transform: translateY(-100%); opacity: .4; transition: transform .7s var(--ease-io), opacity .7s; pointer-events: none; }
.lk-wall { position: absolute; inset: -30px; background: var(--wallpaper); transition: filter .5s var(--ease), transform .6s var(--ease); }
#lock.login .lk-wall { filter: blur(26px) brightness(.62) saturate(1.2); transform: scale(1.06); }
.lk-top { position: absolute; left: 0; right: 0; top: 9vh; display: flex; flex-direction: column; align-items: center; text-shadow: 0 2px 20px rgba(0, 0, 0, .25); transition: transform .5s var(--ease), opacity .4s; }
.lk-date { font-size: clamp(16px, 1.6vw, 21px); font-weight: 600; opacity: .92; }
.lk-time {
  font-family: var(--font-display); font-weight: 200; font-size: clamp(100px, 15vw, 196px); line-height: .95; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 30%, rgba(255, 255, 255, .78)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lk-widgets { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; justify-content: center; padding: 0 16px; }
.lk-w { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 500; background: rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); text-shadow: none; }
.lk-w .ic, .lk-w svg { display: inline; }
#lock.login .lk-top { transform: translateY(-3vh) scale(.62); opacity: .9; }
.lk-login { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -24%); display: flex; flex-direction: column; align-items: center; gap: 12px; opacity: 0; pointer-events: none; transition: opacity .35s, transform .45s var(--ease); }
#lock.login .lk-login { opacity: 1; pointer-events: auto; transform: translate(-50%, -10%); }
.lk-avatar { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-size: 40px; font-weight: 400; background: linear-gradient(140deg, var(--accent), #2b2a68); box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 0 0 2px rgba(255, 255, 255, .25); }
.lk-name { font-size: 20px; font-weight: 600; }
.lk-field { display: flex; align-items: center; width: 250px; height: 40px; border-radius: 20px; padding: 0 4px 0 16px; background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.lk-field:focus-within { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
.lk-field input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: #fff; font-size: 14px; }
.lk-field input::placeholder { color: rgba(255, 255, 255, .65); }
.lk-field button { width: 32px; height: 32px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .22); color: #fff; }
.lk-field button:hover { background: rgba(255, 255, 255, .35); }
.lk-hint { font-size: 12px; opacity: .7; }
.lk-bottom { position: absolute; left: 0; right: 0; bottom: 6vh; display: flex; justify-content: center; transition: opacity .3s; }
#lock.login .lk-bottom { opacity: 0; }
.lk-swipe { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; opacity: .85; animation: nudge 2.6s ease-in-out infinite; }
@keyframes nudge { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-6px); } }
.lk-corner { position: absolute; right: 22px; bottom: 22px; display: flex; gap: 8px; }
.lk-ic { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.lk-ic:hover { background: rgba(255, 255, 255, .26); }
.locked #topbar, .locked #dock, .locked #cmdbar, .locked #island, .locked #desktop, .locked #windows { visibility: hidden; }
.unlocking #desktop, .unlocking #windows, .unlocking #wallpaper { animation: unlock-in .8s var(--ease); }
.unlocking #dock, .unlocking #cmdbar { animation: dock-in .7s .15s var(--ease) both; }
.unlocking #topbar { animation: top-in .6s .1s var(--ease) both; }
@keyframes unlock-in { from { transform: scale(1.06); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes dock-in { from { transform: translateY(110%); } to { transform: none; } }
@keyframes top-in { from { transform: translateY(-100%); } to { transform: none; } }

#power-screen { position: absolute; inset: 0; z-index: 9700; background: #000; color: rgba(255, 255, 255, .8); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; opacity: 0; transition: opacity .6s; font-size: 14px; }
#power-screen.show { opacity: 1; }
.ps-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: #fff; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ps-on { width: 82px; height: 82px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: #fff; display: grid; place-items: center; transition: background .2s, box-shadow .2s; }
.ps-on:hover { background: rgba(255, 255, 255, .12); box-shadow: 0 0 40px rgba(var(--accent-rgb), .5); }
.ps-hint { font-size: 13px; opacity: .55; }

/* ---------------------------------------------------------------------
   Home grid (phone layout) + home bar
   --------------------------------------------------------------------- */
#home-grid, #home-bar { display: none; }

/* =====================================================================
   Phone layout (narrow screens): status bar, home grid, full-screen apps
   ===================================================================== */
[data-layout="mobile"] #topbar { height: 34px; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; color: #fff; padding: 0 14px; text-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
[data-layout="mobile"] .tb-left { display: none; }
[data-layout="mobile"] .tb-right { width: 100%; justify-content: space-between; }
[data-layout="mobile"] .tb-right > .tb-btn:first-child { display: none; }
[data-layout="mobile"] .tb-clock { order: -1; font-weight: 700; font-size: 14px; }
[data-layout="mobile"] .tbc-date, [data-layout="mobile"] .batt-pct { display: none; }
[data-layout="mobile"] #desktop { top: 34px; bottom: 0; overflow-y: auto; padding-bottom: 130px; }
[data-layout="mobile"] #desk-icons { display: none; }
[data-layout="mobile"] #widgets { position: static; padding: 14px 18px 0; grid-template-columns: 1fr 1fr; grid-auto-rows: auto; gap: 14px; }
[data-layout="mobile"] #widgets .widget { min-height: 150px; }
[data-layout="mobile"] .w-batt, [data-layout="mobile"] .w-photo, [data-layout="mobile"] .w-next { display: none; }
[data-layout="mobile"] #home-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 6px; padding: 22px 14px; }
.home-app { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; font-size: 11.5px; font-weight: 500; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.home-app span:last-child { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-layout="mobile"] #dock { bottom: 26px; }
[data-layout="mobile"] .dock-inner { height: 84px; padding: 12px 14px; border-radius: 32px; }
[data-layout="mobile"] .dock-sys, [data-layout="mobile"] .dock-sep, [data-layout="mobile"] .dock-only { display: none !important; }
[data-layout="mobile"] .dock-apps .dock-item:nth-child(n+5) { display: none; }
[data-layout="mobile"] .dock-item { --dsz: 58px; width: 64px; justify-content: center; }
[data-layout="mobile"] .dock-item::after { display: none; }
[data-layout="mobile"] .run-dot { display: none; }
[data-layout="mobile"] #windows { z-index: 4500; }
[data-layout="mobile"] .win { border-radius: 0 !important; }
[data-layout="mobile"] .win-ctrl .wc-max, [data-layout="mobile"] .win-ctrl .wc-min { display: none; }
[data-layout="mobile"] .rz { display: none; }
[data-layout="mobile"] #home-bar { display: flex; position: absolute; left: 0; right: 0; bottom: 0; height: 22px; z-index: 4600; justify-content: center; align-items: center; background: transparent; }
#home-bar button { width: 134px; height: 5px; border: 0; padding: 0; border-radius: 3px; background: rgba(255, 255, 255, .85); box-shadow: 0 0 6px rgba(0, 0, 0, .3); }
[data-layout="mobile"] #launcher { left: 8px; right: 8px; width: auto; bottom: 120px; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
[data-layout="mobile"] .ln-side { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
[data-layout="mobile"] .ln-side-label, [data-layout="mobile"] .ln-side-fill, [data-layout="mobile"] .ln-place span:last-child { display: none; }
[data-layout="mobile"] .ln-user { flex: 1; }
[data-layout="mobile"] .win-title-text { max-width: 52vw; }
[data-layout="mobile"] #control, [data-layout="mobile"] #notifs { left: 8px; right: 8px; width: auto; top: 38px; }
[data-layout="mobile"] #notifs { bottom: 30px; }
[data-layout="mobile"] #banners { left: 8px; right: 8px; width: auto; top: 38px; }
[data-layout="mobile"] .lk-corner { right: 50%; transform: translateX(50%); }

/* ---------------------------------------------------------------------
   Motion preferences
   --------------------------------------------------------------------- */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

/* the menu-bar button whose menu is open */
.menu-open { background: var(--tile-hover) !important; color: var(--text) !important; }
#topbar .menu-open { background: rgba(255, 255, 255, .18) !important; color: inherit !important; }

/* file picker (N.ui.pickFile) */
.pick-dialog { width: min(520px, 94vw); align-items: stretch; text-align: left; }
.pick-places { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-crumbs { font-size: 12px; color: var(--text-3); }
.pick-list { height: 260px; overflow-y: auto; border-radius: 12px; background: var(--tile); padding: 4px; display: flex; flex-direction: column; gap: 1px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; background: none; border-radius: 8px; text-align: left; color: var(--text); font-size: 13px; }
.pick-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row small { color: var(--text-3); font-size: 11.5px; }
.pick-row:hover { background: var(--hover); }
.pick-row.sel { background: var(--accent); color: var(--accent-fg); }
.pick-row.sel small { color: inherit; }
.pick-empty { padding: 30px; text-align: center; color: var(--text-3); font-size: 13px; }
.pick-name { width: 100%; }

/* box selection + renaming in place (desktop and Files) */
.marquee-box { position: fixed; z-index: 7500; pointer-events: none; border: 1px solid rgba(var(--accent-rgb), .9); background: rgba(var(--accent-rgb), .16); border-radius: 3px; }
.marquee-on { user-select: none; }
.inline-rename {
  display: block; width: 100%; min-width: 80px; resize: none; overflow: hidden; margin: 0; padding: 2px 4px;
  font: inherit; font-size: 12.5px; line-height: 1.3; text-align: center; color: var(--text);
  background: var(--surface); border: 0; border-radius: 4px; outline: 2px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.files-row .inline-rename, .renaming.files-name:not(.files-tile .files-name) .inline-rename { text-align: left; }
.desk-icon .inline-rename { width: 92px; }
.renaming { overflow: visible !important; -webkit-line-clamp: unset !important; display: block !important; text-shadow: none !important; }
.desk-icon.cut { opacity: .5; }
.desk-icon.drop-on { background: rgba(var(--accent-rgb), .3) !important; }
