/* Caelestia-inspired desktop shell for body[data-layout="os"].
 *
 * The structure follows the Caelestia Quickshell modules kept under
 * reference-ui/shell-qml: a floating bar (logo, workspaces, active window,
 * clock, status cluster), a tabbed dashboard over the bar, and rounded
 * surface-container cards with generous radii instead of hard borders.
 *
 * Everything here is opt-in: the bar and dashboard only render for the
 * "Windows desktop" layout, so the default site chrome is untouched. */

:root {
  --cs-surface: rgba(16, 19, 28, 0.72);
  --cs-surface-2: rgba(26, 30, 42, 0.78);
  --cs-surface-3: rgba(38, 43, 58, 0.72);
  --cs-line: rgba(255, 255, 255, 0.14);
  --cs-line-soft: rgba(255, 255, 255, 0.08);
  --cs-text: #eef1fa;
  --cs-muted: #a7b0c8;
  --cs-radius: 22px;
  --cs-radius-lg: 28px;
  --cs-blur: blur(34px) saturate(170%);
}

/* ---------- top bar ---------- */

.cs-topbar {
  display: none;
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 325;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 20px);
  height: 46px;
  padding: 5px 8px;
  border: 1px solid var(--cs-line);
  border-radius: 999px;
  color: var(--cs-text);
  background: var(--cs-surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: var(--cs-blur);
  -webkit-backdrop-filter: var(--cs-blur);
}

body[data-layout="os"] .cs-topbar {
  display: flex;
}

body.vm-desktop-active .cs-topbar,
body.vm-desktop-active .cs-dashboard {
  display: none !important;
}

.cs-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.cs-group-center {
  flex: 1;
  justify-content: center;
}

.cs-logo,
.cs-tray,
.cs-icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: var(--cs-text);
  background: transparent;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.cs-logo:hover,
.cs-tray:hover,
.cs-icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.cs-logo:active,
.cs-tray:active,
.cs-icon-btn:active {
  transform: scale(0.94);
}

.cs-logo img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* Workspaces: one dot per open window. */
.cs-workspaces {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  min-width: 0;
}

.cs-workspace {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.cs-workspace[data-active="true"] {
  width: 20px;
  background: var(--accent2, #c8c8ce);
}

.cs-workspace:hover {
  background: rgba(255, 255, 255, 0.45);
}

.cs-workspace[data-active="true"]:hover {
  background: var(--accent2, #c8c8ce);
}

.cs-active-window {
  max-width: 180px;
  overflow: hidden;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--cs-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-clock-btn {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  color: var(--cs-text);
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition: background 0.16s ease;
}

.cs-clock-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.cs-clock-time {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cs-clock-date {
  font-size: 11.5px;
  color: var(--cs-muted);
}

.cs-status {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--cs-muted);
  font-variant-numeric: tabular-nums;
}

.cs-status svg {
  width: 15px;
  height: 15px;
}

/* ---------- dashboard ---------- */

.cs-dashboard {
  display: none;
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 330;
  width: min(880px, calc(100vw - 24px));
  max-height: calc(100vh - 160px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-radius-lg);
  color: var(--cs-text);
  background: rgba(13, 16, 24, 0.86);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: var(--cs-blur);
  -webkit-backdrop-filter: var(--cs-blur);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

body[data-layout="os"] .cs-dashboard[data-cs-open="true"] {
  display: block;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cs-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.cs-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cs-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--accent, #0a84ff), var(--accent2, #c8c8ce));
  font-size: 16px;
  font-weight: 800;
  color: #10131c;
}

.cs-user-copy {
  min-width: 0;
}

.cs-user-copy strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.cs-user-copy small {
  font-size: 11.5px;
  color: var(--cs-muted);
}

.cs-big-clock {
  text-align: right;
}

.cs-big-clock strong {
  display: block;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cs-big-clock span {
  font-size: 11.5px;
  color: var(--cs-muted);
}

.cs-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.cs-tab {
  flex: 1;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--cs-muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.cs-tab:hover {
  color: var(--cs-text);
}

.cs-tab[aria-selected="true"] {
  color: #10131c;
  background: var(--accent2, #c8c8ce);
}

.cs-panel[hidden] {
  display: none !important;
}

.cs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 12px;
}

.cs-card {
  padding: 16px;
  border: 1px solid var(--cs-line-soft);
  border-radius: var(--cs-radius);
  background: var(--cs-surface-2);
}

.cs-card h3 {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cs-muted);
}

.cs-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--cs-muted);
}

.cs-card-wide {
  grid-column: 1 / -1;
}

/* Month grid */
.cs-calendar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cs-calendar-head b {
  font-size: 14px;
}

.cs-calendar-head span {
  font-size: 11.5px;
  color: var(--cs-muted);
}

.cs-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.cs-calendar-grid span {
  display: grid;
  place-items: center;
  height: 26px;
  border-radius: 999px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--cs-muted);
}

.cs-calendar-grid span[data-weekday="true"] {
  height: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.42);
}

.cs-calendar-grid span[data-today="true"] {
  color: #10131c;
  font-weight: 800;
  background: var(--accent2, #c8c8ce);
}

/* Quick actions */
.cs-actions {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.cs-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--cs-line-soft);
  border-radius: 14px;
  color: var(--cs-text);
  background: var(--cs-surface-3);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.16s ease, transform 0.16s ease;
}

.cs-action:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateX(2px);
}

.cs-action span:last-child {
  color: var(--cs-muted);
}

/* Media panel */
.cs-media {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cs-media-art {
  display: grid;
  place-items: center;
  flex: none;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(140deg, rgba(10,132,255, 0.55), rgba(226,226,226, 0.45));
  color: rgba(255, 255, 255, 0.85);
}

.cs-media-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cs-media-copy {
  min-width: 0;
}

.cs-media-title {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-media-meta {
  margin: 2px 0 10px;
  font-size: 12px;
  color: var(--cs-muted);
}

.cs-media-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--cs-muted);
}

.cs-media-state i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
}

.cs-media-state[data-playing="true"] i {
  background: #7ee2a8;
  box-shadow: 0 0 10px rgba(126, 226, 168, 0.7);
}

.cs-media-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.cs-media-actions .cs-icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--cs-line-soft);
  background: var(--cs-surface-3);
  font-size: 11px;
  line-height: 1;
}

.cs-media-actions .cs-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Resource meters */
.cs-meters {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.cs-meter {
  display: grid;
  gap: 5px;
}

.cs-meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
}

.cs-meter-head span:first-child {
  color: var(--cs-muted);
}

.cs-meter-head span:last-child {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cs-meter-bar {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.cs-meter-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent, #0a84ff), var(--accent2, #c8c8ce));
  transition: width 0.3s ease;
}

/* ---------- app windows ---------- */

.os-window {
  position: fixed;
  display: flex;
  flex-direction: column;
  width: min(1000px, calc(100vw - 160px));
  height: min(680px, calc(100vh - 200px));
  overflow: hidden;
  border: 1px solid var(--cs-line);
  border-radius: 20px;
  color: var(--cs-text);
  background: rgba(14, 17, 26, 0.92);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: var(--cs-blur);
  -webkit-backdrop-filter: var(--cs-blur);
}

.os-window[hidden] {
  display: none !important;
}

.os-window.maximized {
  border-radius: 0;
}

.os-window-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--cs-line-soft);
  background: rgba(255, 255, 255, 0.05);
  cursor: grab;
  user-select: none;
}

.os-window-titlebar:active {
  cursor: grabbing;
}

.os-window-controls {
  display: flex;
  gap: 6px;
}

.os-win-btn {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--cs-text);
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}


.os-window-title {
  flex: 1;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-window-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: rgba(8, 10, 16, 0.55);
}

.os-window-body > .view {
  height: 100%;
  overflow: auto;
  padding: 18px;
}

/* ---------- launcher (start menu) restyle ---------- */

body[data-layout="os"] .os-start-menu {
  border-radius: 26px;
  border-color: var(--cs-line);
  background: rgba(16, 19, 28, 0.9);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: var(--cs-blur);
  -webkit-backdrop-filter: var(--cs-blur);
}

body[data-layout="os"] .os-start-search {
  height: 40px;
  border-radius: 999px;
  border-color: var(--cs-line);
  background: rgba(255, 255, 255, 0.07);
}

body[data-layout="os"] .os-start-search button {
  color: var(--cs-muted);
}

body[data-layout="os"] .os-pinned a {
  border-radius: 14px;
}

body[data-layout="os"] .os-workspace-actions button {
  border-radius: 999px;
}

body[data-layout="os"] .os-start-footer {
  border-radius: 0 0 18px 18px;
}

/* Keep the desktop widgets clear of the new bar. */
body[data-layout="os"] #v-home:not([hidden]) .os-desktop-widgets {
  top: 76px;
}

/* ==========================================================================
 * v2 — "Abyss slate" restyle
 *
 * The first pass read like a rounded template: everything was a pill on the
 * same flat glass. This pass gives the desktop shell its own identity:
 *   - one deep slate palette with an aurora edge instead of neutral grey
 *   - rounded rectangles (18-24px) for chrome, pills only for controls
 *   - a saturated accent cap on the focused surface, quiet everywhere else
 *   - a real desktop surface: app icons on the left, widgets on the right
 * ========================================================================== */

:root {
  --cs-surface: rgba(15, 18, 28, 0.68);
  --cs-surface-2: rgba(24, 28, 41, 0.7);
  --cs-surface-3: rgba(255, 255, 255, 0.07);
  --cs-line: rgba(255, 255, 255, 0.1);
  --cs-line-soft: rgba(255, 255, 255, 0.07);
  --cs-edge: linear-gradient(140deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.04) 46%, rgba(255, 255, 255, 0.16));
  --cs-text: #f2f4fb;
  --cs-muted: #9aa3bb;
  --cs-radius: 20px;
  --cs-radius-lg: 26px;
  --cs-blur: blur(30px) saturate(165%);
  --cs-shadow: 0 26px 70px rgba(0, 0, 0, 0.55), 0 2px 0 rgba(255, 255, 255, 0.06) inset;
  --cs-accent: var(--accent2, #c8c8ce);
}

/* Shared glass edge: a 1px gradient ring drawn with a mask so it follows the
 * element's own radius. */
.cs-topbar,
.cs-dashboard,
.os-window,
body[data-layout="os"] .os-taskbar,
body[data-layout="os"] .os-start-menu {
  position: fixed;
  isolation: isolate;
}

.cs-topbar::before,
.cs-dashboard::before,
.os-window::before,
body[data-layout="os"] .os-taskbar::before,
body[data-layout="os"] .os-start-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: var(--cs-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}

/* A single aurora bloom sits behind the bar and tints every surface below. */
body[data-layout="os"]::before {
  content: "";
  position: fixed;
  inset: -10vh -10vw auto;
  height: 70vh;
  z-index: 0;
  background:
    radial-gradient(46% 60% at 26% 6%, color-mix(in srgb, var(--cs-accent) 34%, transparent), transparent 70%),
    radial-gradient(38% 52% at 78% 0%, rgba(76,141,255, 0.22), transparent 72%);
  filter: blur(18px);
  pointer-events: none;
}

/* The home view is the desktop surface in this layout. */
body[data-layout="os"] #v-home {
  position: relative;
  isolation: isolate;
}

body[data-layout="os"] #v-home::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70% 50% at 50% 110%, rgba(0, 0, 0, 0.55), transparent 70%),
    linear-gradient(180deg, rgba(6, 8, 14, 0.25), rgba(6, 8, 14, 0.6));
  pointer-events: none;
}

/* ---------- bar v2 ---------- */

.cs-topbar {
  top: 14px;
  height: 54px;
  padding: 7px 9px;
  gap: 8px;
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(34, 39, 56, 0.66), rgba(11, 13, 21, 0.82));
  box-shadow: var(--cs-shadow);
}

.cs-logo,
.cs-tray,
.cs-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--cs-text);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07) inset;
}

.cs-logo:hover,
.cs-tray:hover,
.cs-icon-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}

.cs-logo img {
  width: 21px;
  height: 21px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.cs-workspaces {
  gap: 4px;
  padding: 0 8px;
  height: 26px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.24);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.cs-workspace {
  width: 7px;
  height: 7px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.24);
}

.cs-workspace[data-active="true"] {
  width: 22px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cs-accent) 70%, #fff), var(--cs-accent));
  box-shadow: 0 0 14px color-mix(in srgb, var(--cs-accent) 45%, transparent);
}

.cs-active-window {
  max-width: 200px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: rgba(255, 255, 255, 0.62);
}

.cs-active-window::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--cs-accent);
  vertical-align: middle;
  box-shadow: 0 0 8px color-mix(in srgb, var(--cs-accent) 60%, transparent);
}

.cs-clock-btn {
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07) inset;
}

.cs-clock-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cs-clock-time {
  font-size: 13.5px;
  letter-spacing: 0.01em;
}

.cs-clock-date {
  color: rgba(255, 255, 255, 0.48);
}

.cs-status {
  padding: 0 10px;
  height: 30px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

/* ---------- dashboard v2 ---------- */

.cs-dashboard {
  top: 78px;
  width: min(940px, calc(100vw - 24px));
  padding: 20px;
  border-radius: 26px;
  background: linear-gradient(170deg, rgba(22, 26, 39, 0.9), rgba(9, 11, 18, 0.94));
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.62), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  transform: translateX(-50%) translateY(-10px) scale(0.985);
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}

body[data-layout="os"] .cs-dashboard[data-cs-open="true"] {
  transform: translateX(-50%) translateY(0) scale(1);
}

.cs-dashboard::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 170px;
  border-radius: inherit;
  background: radial-gradient(60% 100% at 50% 0%, color-mix(in srgb, var(--cs-accent) 16%, transparent), transparent 72%);
  pointer-events: none;
  z-index: -1;
}

.cs-user .cs-avatar {
  border-radius: 14px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--cs-accent) 80%, #fff), color-mix(in srgb, var(--accent, #0a84ff) 70%, #0b0d14));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.cs-tabs {
  gap: 3px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.cs-tab {
  border-radius: 11px;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.cs-tab[aria-selected="true"] {
  color: #0a0c13;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cs-accent) 86%, #fff), var(--cs-accent));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--cs-accent) 30%, transparent);
}

.cs-card {
  padding: 16px 17px;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 14px 34px rgba(0, 0, 0, 0.28);
}

.cs-action {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07) inset;
}

.cs-action:hover {
  background: color-mix(in srgb, var(--cs-accent) 18%, rgba(255, 255, 255, 0.05));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cs-accent) 34%, transparent) inset;
  transform: translateX(3px);
}

/* ---------- windows v2 ---------- */

.os-window {
  border-radius: 22px;
  background: linear-gradient(170deg, rgba(20, 24, 36, 0.94), rgba(9, 11, 18, 0.96));
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.68), 0 1px 0 rgba(255, 255, 255, 0.07) inset;
  transition: box-shadow 0.2s ease;
}

.os-window:focus-within {
  box-shadow: 0 44px 120px rgba(0, 0, 0, 0.7), 0 0 0 1px color-mix(in srgb, var(--cs-accent) 26%, transparent), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.os-window.maximized {
  border-radius: 0;
}

.os-window-titlebar {
  height: 40px;
  padding: 0 12px;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015));
}

.os-window-controls {
  gap: 7px;
}

/* Traffic lights: a 12px dot centred over a 22px hit target. The dot is
 * absolutely positioned so the glyph sits on top of it instead of becoming a
 * second grid row, which pushed the row height around and looked broken on
 * hover. The button itself never paints a background. */
.os-window-controls {
  gap: 8px;
}

.os-win-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: transparent;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
}

.os-win-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.os-win-btn.close::before { background: #ef6a5f; }
.os-win-btn.minimize::before { background: #e8bf5a; }
.os-win-btn.maximize::before { background: #61c46f; }

.os-win-btn:hover,
.os-win-btn.close:hover,
.os-win-btn.minimize:hover,
.os-win-btn.maximize:hover,
.os-win-btn:focus-visible {
  background: transparent;
  outline: none;
}

.os-win-btn:hover::before {
  filter: brightness(1.12);
  transform: scale(1.08);
}

.os-win-btn:focus-visible::before {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cs-accent) 45%, transparent);
}

.os-window-controls:hover .os-win-btn {
  color: rgba(0, 0, 0, 0.5);
  font-size: 9px;
  font-weight: 800;
}

.os-win-btn:active::before {
  transform: scale(0.92);
}

.os-window-title {
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
}

.os-window-body {
  background: rgba(6, 8, 13, 0.6);
}

.os-window-body > .view {
  padding: 20px;
}

/* ---------- dock v2 ---------- */

body[data-layout="os"] .os-taskbar {
  bottom: 18px;
  z-index: 312;
  gap: 7px;
  min-height: 64px;
  padding: 9px 12px;
  border-radius: 20px;
  background: linear-gradient(175deg, rgba(30, 35, 50, 0.72), rgba(11, 13, 21, 0.86));
  box-shadow: var(--cs-shadow);
  backdrop-filter: var(--cs-blur);
  -webkit-backdrop-filter: var(--cs-blur);
}

body[data-layout="os"] .os-start-button,
body[data-layout="os"] .os-taskbar-app,
body[data-layout="os"] .os-taskbar-tray {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07) inset;
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

body[data-layout="os"] .os-taskbar-tray {
  width: 40px;
}

body[data-layout="os"] .os-start-button:hover,
body[data-layout="os"] .os-taskbar-app:hover,
body[data-layout="os"] .os-taskbar-tray:hover,
body[data-layout="os"] .os-taskbar-app:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset, 0 10px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(-3px);
}

body[data-layout="os"] .os-start-button[aria-expanded="true"] {
  background: color-mix(in srgb, var(--cs-accent) 26%, rgba(255, 255, 255, 0.06));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cs-accent) 40%, transparent) inset;
}

body[data-layout="os"] .os-taskbar-app[data-active="true"] {
  background: color-mix(in srgb, var(--cs-accent) 22%, rgba(255, 255, 255, 0.06));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cs-accent) 42%, transparent) inset;
}

body[data-layout="os"] .os-taskbar-app[data-running="true"]::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--cs-accent);
  transform: translateX(-50%);
  box-shadow: 0 0 8px color-mix(in srgb, var(--cs-accent) 70%, transparent);
}

body[data-layout="os"] .os-taskbar-app::before,
body[data-layout="os"] .os-taskbar-tray::before {
  content: attr(aria-label);
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  padding: 5px 9px;
  border-radius: 8px;
  color: var(--cs-text);
  background: rgba(8, 10, 16, 0.94);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 4px) scale(0.96);
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: none;
  z-index: 2;
}

body[data-layout="os"] .os-taskbar-app:hover::before,
body[data-layout="os"] .os-taskbar-tray:hover::before {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  transition-delay: 0.25s;
}

body[data-layout="os"] .os-mark i {
  background: var(--cs-accent);
  border-radius: 1px;
}

body[data-layout="os"] .os-clock {
  min-width: 66px;
  padding: 0 10px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.72);
}

/* ---------- start menu v2 ---------- */

body[data-layout="os"] .os-start-menu {
  bottom: 96px;
  width: min(620px, calc(100vw - 28px));
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(170deg, rgba(26, 30, 44, 0.94), rgba(10, 12, 19, 0.97));
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.66), 0 1px 0 rgba(255, 255, 255, 0.07) inset;
  backdrop-filter: var(--cs-blur);
  -webkit-backdrop-filter: var(--cs-blur);
}

body[data-layout="os"] .os-start-search {
  height: 44px;
  padding: 0 8px 0 16px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

body[data-layout="os"] .os-start-search:focus-within {
  border-color: color-mix(in srgb, var(--cs-accent) 45%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cs-accent) 16%, transparent);
}

body[data-layout="os"] .os-pinned {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

body[data-layout="os"] .os-pinned a {
  gap: 9px;
  padding: 14px 6px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px transparent inset;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

body[data-layout="os"] .os-pinned a:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

body[data-layout="os"] .os-pinned img,
body[data-layout="os"] .os-pin-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--cs-accent);
  background: rgba(255, 255, 255, 0.06);
}

body[data-layout="os"] .os-start-heading {
  margin-top: 4px;
}

body[data-layout="os"] .os-workspace-actions {
  border-top-color: rgba(255, 255, 255, 0.08);
}

body[data-layout="os"] .os-workspace-actions button {
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

body[data-layout="os"] .os-workspace-actions button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

body[data-layout="os"] .os-start-footer {
  margin: 0 -20px -20px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 0 0 24px 24px;
}

/* ---------- desktop surface ---------- */

/* Only the Windows desktop layout owns the shortcut grid. */
.os-icons {
  display: none;
}

/* slipstream.css hides every #v-home child except .hero for the search-first
 * home; the desktop surface is exactly what should remain visible here. */
body[data-layout="os"] #v-home > .os-icons {
  display: grid !important;
}

body[data-layout="os"] #v-home > .os-desktop-widgets {
  display: flex !important;
}

body[data-layout="os"] #v-home > .os-brand {
  display: flex !important;
}

body[data-layout="os"] .os-icons {
  position: absolute;
  top: 84px;
  left: 22px;
  z-index: 2;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(5, 98px);
  gap: 4px 2px;
  max-height: calc(100vh - 220px);
}

body[data-layout="os"] .os-icon {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  width: 94px;
  padding: 10px 6px 8px;
  border: 0;
  border-radius: 16px;
  color: var(--cs-text);
  background: transparent;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

body[data-layout="os"] .os-icon:hover,
body[data-layout="os"] .os-icon:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transform: translateY(-2px);
  outline: none;
}

body[data-layout="os"] .os-icon:active {
  transform: scale(0.96);
}

body[data-layout="os"] .os-icon-glyph {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  color: #f4f7ff;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 12px 26px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body[data-layout="os"] .os-icon[data-tone="accent"] .os-icon-glyph {
  background: linear-gradient(160deg, color-mix(in srgb, var(--cs-accent) 78%, #fff), color-mix(in srgb, var(--cs-accent) 55%, #0b0d14));
  color: #0a0c13;
}

body[data-layout="os"] .os-icon[data-tone="warm"] .os-icon-glyph {
  background: linear-gradient(160deg, rgba(255, 172, 120, 0.85), rgba(196, 96, 92, 0.55));
  color: #1a0d0a;
}

body[data-layout="os"] .os-icon img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

/* ---------- widgets v2 ---------- */

body[data-layout="os"] #v-home:not([hidden]) .os-desktop-widgets {
  top: 84px;
  right: 22px;
  left: auto;
  width: 272px;
  gap: 12px;
  z-index: 3;
}

.os-widget {
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.02)), rgba(10, 12, 20, 0.62);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42), 0 1px 0 rgba(255, 255, 255, 0.07) inset;
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
}

.os-widget > small:first-child {
  display: block;
  margin-bottom: 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.os-clock-widget strong {
  display: block;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.os-clock-widget #os-desktop-date {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.6);
}

.os-weather-widget #os-weather-city-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
}

.os-weather-widget .os-weather-form {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.os-weather-widget .os-weather-form input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  color: var(--cs-text);
  background: rgba(0, 0, 0, 0.32);
  font: inherit;
  font-size: 12px;
}

.os-weather-widget .os-weather-form input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--cs-accent) 45%, transparent);
}

.os-weather-widget .os-weather-form button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: #0b0d14;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cs-accent) 86%, #fff), var(--cs-accent));
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.os-weather-widget .btn.outline {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 9px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 600 !important;
}

.os-media-widget .os-media-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.os-media-widget .os-media-art {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.85);
  background: linear-gradient(150deg, color-mix(in srgb, var(--cs-accent) 62%, transparent), rgba(10,132,255, 0.5));
}

.os-media-widget .os-media-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.os-media-widget .os-media-text {
  min-width: 0;
  flex: 1;
}

.os-media-widget .os-media-title {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-media-widget .os-media-meta {
  overflow: hidden;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.52);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-media-widget .os-media-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  color: #0b0d14;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cs-accent) 86%, #fff), var(--cs-accent));
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.os-media-widget .os-media-toggle:active {
  transform: scale(0.94);
}

@media (max-width: 980px) {
  body[data-layout="os"] #v-home > .os-desktop-widgets {
    display: none !important;
  }
}

@media (max-width: 820px) {
  body[data-layout="os"] .os-icons {
    top: 76px;
    left: 10px;
    grid-template-rows: repeat(4, 92px);
  }

  body[data-layout="os"] .os-icon {
    width: 84px;
    font-size: 11px;
  }

  .cs-topbar {
    height: 48px;
    padding: 5px 7px;
  }

  .cs-dashboard {
    top: 68px;
    padding: 14px;
    border-radius: 20px;
  }

  .cs-active-window,
  .cs-clock-date {
    display: none;
  }

  .cs-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .os-window {
    width: calc(100vw - 24px);
    height: calc(100vh - 170px);
  }
}

/* ==========================================================================
 * v3 — aura
 *
 * The desktop should feel alive before anything is open: drifting colour,
 * a light that follows the pointer, colour-coded apps and motion that
 * settles instead of popping. All motion is CSS-only, transform/opacity,
 * and disabled under prefers-reduced-motion.
 * ========================================================================== */

@keyframes cs-aurora {
  0%   { transform: translate3d(-3%, -2%, 0) scale(1); opacity: 0.85; }
  50%  { transform: translate3d(2%, 3%, 0) scale(1.1); opacity: 1; }
  100% { transform: translate3d(5%, -1%, 0) scale(1.04); opacity: 0.9; }
}

@keyframes cs-bar-in {
  from { opacity: 0; transform: translate(-50%, -14px) scale(0.98); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes cs-dock-in {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cs-icon-in {
  from { opacity: 0; transform: translateY(12px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}

@keyframes cs-widget-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: none; }
}

@keyframes cs-window-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

@keyframes cs-dot-breathe {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 0.9; }
}

@keyframes cs-sheen {
  from { transform: translateX(-120%) skewX(-18deg); }
  to   { transform: translateX(240%) skewX(-18deg); }
}

/* ---- ambient wallpaper ---- */

body[data-layout="os"]::before {
  animation: cs-aurora 26s ease-in-out infinite alternate;
  transform-origin: 40% 0%;
  will-change: transform, opacity;
  background:
    radial-gradient(42% 54% at 24% 4%, color-mix(in srgb, var(--cs-accent) 46%, transparent), transparent 70%),
    radial-gradient(34% 46% at 76% -4%, rgba(76,141,255, 0.34), transparent 72%),
    radial-gradient(30% 40% at 52% 2%, rgba(56, 200, 214, 0.2), transparent 70%);
}

/* Pointer light. A fixed-size layer that is only moved (transform, written as
   an inline style by os-shell.mjs), never re-styled through a root CSS
   variable: a custom property on :root invalidated styles for the whole
   document on every mouse move, which halved the frame rate while the pointer
   was in motion. Hidden outside the desktop layout. */
.cs-pointer-light {
  display: none;
}

body[data-layout="os"] .cs-pointer-light {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 920px;
  height: 920px;
  margin: -460px 0 0 -460px;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    closest-side circle at 50% 50%,
    color-mix(in srgb, var(--cs-accent) 15%, transparent),
    transparent 64%
  );
  opacity: 0.85;
  will-change: transform;
  transform: translate3d(62vw, 26vh, 0);
}

body[data-layout="os"] .cs-topbar {
  animation: cs-bar-in 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

body[data-layout="os"] .os-taskbar {
  animation: cs-dock-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) 0.05s both;
}

body[data-layout="os"] .os-desktop-widgets .os-widget {
  animation: cs-widget-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

body[data-layout="os"] .os-desktop-widgets .os-widget:nth-child(2) {
  animation-delay: 0.08s;
}

body[data-layout="os"] .os-desktop-widgets .os-widget:nth-child(3) {
  animation-delay: 0.16s;
}

/* A soft top highlight sells the glass. No overflow clipping here: the dock
 * tooltips and hovered tiles need to escape the surface. */
.cs-topbar::after,
body[data-layout="os"] .os-taskbar::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 52%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 86%);
  pointer-events: none;
  z-index: -1;
}

/* ---- brand watermark ---- */

body[data-layout="os"] .os-brand {
  position: absolute;
  left: 32px;
  bottom: 104px;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 14px;
  pointer-events: none;
  user-select: none;
}

body[data-layout="os"] .os-brand strong {
  font-size: clamp(48px, 7vw, 92px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.9;
  color: transparent;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.03) 72%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 18px 42px rgba(0, 0, 0, 0.45));
}

body[data-layout="os"] .os-brand span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.52em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--cs-accent) 62%, transparent);
}

/* ---- colour-coded icons ---- */

body[data-layout="os"] .os-icon {
  animation: cs-icon-in 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 55ms + 120ms);
}

body[data-layout="os"] .os-icon-glyph {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.18s ease;
}

/* A soft corner sheen + floor shade. The old version was a hard-edged band
 * across the top half, which cut straight through the glyph and made every
 * icon look unfinished. This sits behind the art instead. */
body[data-layout="os"] .os-icon-glyph::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 92% at 20% -4%, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.16));
  pointer-events: none;
}

body[data-layout="os"] .os-icon-glyph svg {
  position: relative;
  z-index: 1;
  width: 27px;
  height: 27px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

body[data-layout="os"] .os-icon:hover .os-icon-glyph {
  transform: translateY(-2px) scale(1.06);
}

body[data-layout="os"] .os-icon[data-tone="violet"] .os-icon-glyph {
  background: linear-gradient(155deg, #a68bff, #0a84ff 72%);
  color: #f6f2ff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22) inset, 0 14px 30px rgba(10,132,255, 0.45);
}

body[data-layout="os"] .os-icon[data-tone="cyan"] .os-icon-glyph {
  background: linear-gradient(155deg, #7ce8e2, #169fb4 74%);
  color: #04252b;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28) inset, 0 14px 30px rgba(22, 159, 180, 0.42);
}

body[data-layout="os"] .os-icon[data-tone="blue"] .os-icon-glyph {
  background: linear-gradient(155deg, #7fb8ff, #2f62d8 74%);
  color: #061a3a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24) inset, 0 14px 30px rgba(47, 98, 216, 0.42);
}

body[data-layout="os"] .os-icon[data-tone="amber"] .os-icon-glyph {
  background: linear-gradient(155deg, #ffc479, #e06a3c 74%);
  color: #2a1206;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.26) inset, 0 14px 30px rgba(224, 106, 60, 0.4);
}

body[data-layout="os"] .os-icon[data-tone="green"] .os-icon-glyph {
  background: linear-gradient(155deg, #8ff0b4, #22a06b 74%);
  color: #05231a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24) inset, 0 14px 30px rgba(34, 160, 107, 0.4);
}

body[data-layout="os"] .os-icon[data-tone="pink"] .os-icon-glyph {
  background: linear-gradient(155deg, #ff9ed6, #0a84ff 74%);
  color: #2c0621;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24) inset, 0 14px 30px rgba(10,132,255, 0.4);
}

body[data-layout="os"] .os-icon[data-tone="slate"] .os-icon-glyph {
  background: linear-gradient(155deg, #c3cbdd, #5a6785 76%);
  color: #10192b;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset, 0 14px 30px rgba(30, 42, 68, 0.45);
}

body[data-layout="os"] .os-icon:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ---- dock personality ---- */

body[data-layout="os"] .os-taskbar-app:hover,
body[data-layout="os"] .os-taskbar-tray:hover {
  transform: translateY(-9px) scale(1.14);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cs-accent) 40%, transparent) inset, 0 16px 32px rgba(0, 0, 0, 0.45);
  z-index: 3;
}

body[data-layout="os"] .os-taskbar-app:active {
  transform: translateY(-4px) scale(1.04);
}

body[data-layout="os"] .os-taskbar-app[data-active="true"] {
  background: linear-gradient(160deg, color-mix(in srgb, var(--cs-accent) 34%, rgba(255, 255, 255, 0.06)), color-mix(in srgb, var(--cs-accent) 12%, rgba(255, 255, 255, 0.04)));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cs-accent) 45%, transparent) inset, 0 10px 22px rgba(0, 0, 0, 0.35);
}

body[data-layout="os"] .os-taskbar-app[data-running="true"]::after {
  animation: cs-dot-breathe 3.4s ease-in-out infinite;
}

body[data-layout="os"] .os-start-button::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  background: radial-gradient(circle, color-mix(in srgb, var(--cs-accent) 32%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: -1;
}

body[data-layout="os"] .os-start-button:hover::after,
body[data-layout="os"] .os-start-button[aria-expanded="true"]::after {
  opacity: 1;
}

/* ---- bar / dashboard accents ---- */

body[data-layout="os"] .cs-logo {
  background: linear-gradient(155deg, color-mix(in srgb, var(--cs-accent) 34%, rgba(255, 255, 255, 0.08)), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cs-accent) 34%, transparent) inset, 0 0 18px color-mix(in srgb, var(--cs-accent) 22%, transparent);
}

body[data-layout="os"] .cs-clock-time {
  background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.72));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body[data-layout="os"] #cs-dashboard-btn[aria-expanded="true"] {
  background: color-mix(in srgb, var(--cs-accent) 30%, rgba(255, 255, 255, 0.06));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cs-accent) 45%, transparent) inset;
  color: #0a0c13;
}

body[data-layout="os"] .cs-dashboard[data-cs-open="true"] {
  box-shadow:
    0 44px 120px rgba(0, 0, 0, 0.66),
    0 0 0 1px color-mix(in srgb, var(--cs-accent) 24%, transparent),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

/* ---- windows ---- */

body[data-layout="os"] .os-window {
  animation: cs-window-in 0.26s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

body[data-layout="os"] .os-window:focus-within::before {
  background: linear-gradient(150deg, color-mix(in srgb, var(--cs-accent) 70%, #fff), transparent 40%, color-mix(in srgb, var(--cs-accent) 40%, transparent));
  opacity: 0.9;
}

body[data-layout="os"] .os-window-titlebar {
  position: relative;
  overflow: hidden;
}

body[data-layout="os"] .os-window-titlebar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  pointer-events: none;
}

body[data-layout="os"] .os-window:hover .os-window-titlebar::after {
  opacity: 1;
  animation: cs-sheen 1.4s ease-in-out;
}

/* ---- widgets ---- */

body[data-layout="os"] .os-widget {
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.22s ease;
}

body[data-layout="os"] .os-widget::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(70% 100% at 20% 0%, rgba(255, 255, 255, 0.12), transparent 68%);
  pointer-events: none;
}

body[data-layout="os"] .os-widget:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px color-mix(in srgb, var(--cs-accent) 22%, transparent) inset;
}

body[data-layout="os"] .os-clock-widget strong {
  background: linear-gradient(170deg, #ffffff 10%, rgba(255, 255, 255, 0.66));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.4));
}

body[data-layout="os"] .cs-meter-bar i {
  background: linear-gradient(90deg, color-mix(in srgb, var(--cs-accent) 45%, #fff), var(--cs-accent));
  box-shadow: 0 0 12px color-mix(in srgb, var(--cs-accent) 45%, transparent);
}

/* ---- accessibility & small screens ---- */

@media (prefers-reduced-motion: reduce) {
  body[data-layout="os"]::before,
  body[data-layout="os"] .cs-topbar,
  body[data-layout="os"] .os-taskbar,
  body[data-layout="os"] .os-icon,
  body[data-layout="os"] .os-widget,
  body[data-layout="os"] .os-window,
  body[data-layout="os"] .os-taskbar-app[data-running="true"]::after {
    animation: none !important;
  }
}

@media (max-width: 820px) {
  body[data-layout="os"] .os-brand {
    display: none;
  }

  body[data-layout="os"] #v-home::before {
    background: radial-gradient(340px circle at 70% 18%, color-mix(in srgb, var(--cs-accent) 12%, transparent), transparent 66%);
  }
}

/* ==========================================================================
 * v4 — floating islands
 *
 * The single full-width capsule read as a website header. The bar keeps its
 * position and behaviour but becomes three separate glass islands: identity
 * and open windows on the left, a clock as the focal point, system + controls
 * on the right. Nothing inside them is boxed twice.
 * ========================================================================== */

body[data-layout="os"] .cs-topbar {
  top: 12px;
  height: auto;
  padding: 0;
  gap: 10px;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body[data-layout="os"] .cs-topbar::before,
body[data-layout="os"] .cs-topbar::after {
  display: none;
}

body[data-layout="os"] .cs-group {
  position: relative;
  isolation: isolate;
  height: 46px;
  padding: 0 8px;
  gap: 6px;
  border-radius: 15px;
  background: linear-gradient(165deg, rgba(38, 43, 60, 0.66), rgba(9, 11, 18, 0.86));
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.46), 0 1px 0 rgba(255, 255, 255, 0.07) inset;
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.2s ease;
}

body[data-layout="os"] .cs-group::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.03) 46%, rgba(255, 255, 255, 0.12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

body[data-layout="os"] .cs-group:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.09) inset;
}

body[data-layout="os"] .cs-group-left {
  padding-left: 7px;
  padding-right: 12px;
}

body[data-layout="os"] .cs-group-right {
  padding-left: 14px;
  padding-right: 6px;
  gap: 3px;
}

/* The clock island is the one piece that gets to be loud. */
body[data-layout="os"] .cs-group-center {
  height: 50px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(170deg, rgba(44, 49, 68, 0.72), rgba(10, 12, 20, 0.9));
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.5),
    0 0 0 1px color-mix(in srgb, var(--cs-accent) 16%, transparent) inset,
    0 0 30px color-mix(in srgb, var(--cs-accent) 12%, transparent);
}

body[data-layout="os"] .cs-clock-btn {
  align-items: center;
  gap: 10px;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  white-space: nowrap;
}

body[data-layout="os"] .cs-clock-btn:hover {
  background: none;
}

body[data-layout="os"] .cs-clock-btn:active {
  transform: none;
}

body[data-layout="os"] .cs-clock-time {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

body[data-layout="os"] .cs-clock-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

body[data-layout="os"] .cs-clock-date::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--cs-accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--cs-accent) 60%, transparent);
}

/* Inside islands the controls are flat: one glass surface, not two. */
body[data-layout="os"] .cs-topbar .cs-logo,
body[data-layout="os"] .cs-topbar .cs-icon-btn,
body[data-layout="os"] .cs-topbar .cs-tray {
  background: transparent;
  box-shadow: none;
}

body[data-layout="os"] .cs-topbar .cs-logo {
  background: color-mix(in srgb, var(--cs-accent) 20%, rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cs-accent) 26%, transparent) inset;
}

body[data-layout="os"] .cs-topbar .cs-logo:hover,
body[data-layout="os"] .cs-topbar .cs-icon-btn:hover,
body[data-layout="os"] .cs-topbar .cs-tray:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

body[data-layout="os"] .cs-topbar .cs-workspaces {
  height: auto;
  padding: 0 4px;
  gap: 5px;
  background: transparent;
  box-shadow: none;
}

body[data-layout="os"] .cs-topbar .cs-status {
  height: auto;
  padding: 0;
  background: none;
  box-shadow: none;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

body[data-layout="os"] .cs-topbar .cs-active-window {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

body[data-layout="os"] .cs-topbar .cs-active-window::before {
  width: 4px;
  height: 4px;
  margin-right: 6px;
}

@media (max-width: 820px) {
  body[data-layout="os"] .cs-topbar {
    top: 8px;
    gap: 6px;
  }

  body[data-layout="os"] .cs-group {
    height: 42px;
    padding: 0 6px;
    border-radius: 13px;
  }

  body[data-layout="os"] .cs-group-center {
    height: 44px;
    padding: 0 16px;
    border-radius: 999px;
  }

  body[data-layout="os"] .cs-clock-time {
    font-size: 14px;
  }

  body[data-layout="os"] .cs-clock-date {
    display: none;
  }
}

/* ---------- quick settings: brightness + volume ---------- */

/* The desktop dimmer: a black veil above every surface, never clickable. */
.cs-dimmer {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.cs-quick {
  display: none;
  position: fixed;
  top: 66px;
  right: 16px;
  z-index: 331;
  width: 274px;
  max-width: calc(100vw - 24px);
  padding: 14px 15px 12px;
  border: 1px solid var(--cs-line);
  border-radius: 18px;
  color: var(--cs-text);
  background: rgba(13, 16, 24, 0.9);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: var(--cs-blur);
  -webkit-backdrop-filter: var(--cs-blur);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

body[data-layout="os"] .cs-quick[data-cs-open="true"] {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.cs-quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.cs-quick-head b {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.cs-quick-reset {
  padding: 4px 9px;
  border: 0;
  border-radius: 8px;
  color: var(--cs-muted);
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}

.cs-quick-reset:hover {
  color: var(--cs-text);
  background: rgba(255, 255, 255, 0.14);
}

.cs-quick-row {
  display: grid;
  grid-template-columns: 20px 1fr 38px;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
}

.cs-quick-ico {
  display: grid;
  place-items: center;
  color: var(--cs-muted);
}

.cs-quick-ico svg {
  width: 16px;
  height: 16px;
}

.cs-quick-val {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--cs-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cs-quick input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.cs-quick input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--cs-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cs-accent) 22%, transparent);
}

.cs-quick input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 999px;
  background: var(--cs-accent);
}

.cs-quick input[type="range"]:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.cs-quick-note {
  margin: 6px 2px 0;
  font-size: 10.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.42);
}

/* ==========================================================================
 * v5 — left rail desktop
 *
 * The floating top bar, the shortcut grid and the widget cards all competed
 * with the wallpaper, so the desktop is a single vertical rail on the left
 * with the clock in the bottom-right corner and a keyboard hint in the
 * bottom-left. Every element the shell and the window manager talk to keeps
 * its id and classes — only the placement changed.
 * ========================================================================== */

body[data-layout="os"] .cs-topbar,
body[data-layout="os"] #v-home > .os-desktop-widgets,
body[data-layout="os"] #v-home > .os-brand,
body[data-layout="os"] #v-home > .os-icons {
  display: none !important;
}

/* The dashboard used to drop down from the bar; with the bar gone it opens
 * from the top edge instead. */
body[data-layout="os"] .cs-dashboard {
  top: 18px;
  max-height: calc(100vh - 110px);
}

/* ---- the rail ---- */

/* Views opened by URL (Games, Apps, VMs, …) paint on the wallpaper instead of
 * inside a window, so they start clear of the rail. Views moved into a window
 * keep the window's own padding and are unaffected. */
body[data-layout="os"] #app {
  padding-left: clamp(74px, 6.6vw, 90px);
}

body[data-layout="os"] .os-taskbar {
  position: fixed;
  inset: 0 auto 0 14px;
  z-index: 312;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 46px;
  height: min(756px, calc(100dvh - 40px));
  margin-block: auto;
  padding: 12px 5px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 15px;
  background: rgba(9, 11, 15, 0.72);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  animation: none;
}

body[data-layout="os"] .os-taskbar::after {
  height: 34%;
}

body[data-layout="os"] .os-rail-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
}

body[data-layout="os"] .os-rail-bottom {
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* Only when the window is too short to hold every entry (under 776px, when
   the 737px of content no longer fits) does the rail scroll; taller windows
   keep overflow visible so the hover labels beside it are not clipped. */
@media (max-height: 776px), (max-width: 620px) {
  body[data-layout="os"] .os-taskbar {
    overflow-y: auto;
    scrollbar-width: none;
  }

  body[data-layout="os"] .os-taskbar::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}

/* ---- rail buttons ---- */

body[data-layout="os"] .os-start-button,
body[data-layout="os"] .os-taskbar-app,
body[data-layout="os"] .os-taskbar-tray,
body[data-layout="os"] .os-rail-app {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  color: rgba(228, 235, 246, 0.66);
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

body[data-layout="os"] .os-rail-app svg,
body[data-layout="os"] .os-taskbar-app svg,
body[data-layout="os"] .os-taskbar-tray svg {
  width: 17px;
  height: 17px;
}

body[data-layout="os"] .os-start-button:hover,
body[data-layout="os"] .os-taskbar-app:hover,
body[data-layout="os"] .os-taskbar-tray:hover,
body[data-layout="os"] .os-rail-app:hover,
body[data-layout="os"] .os-start-button:focus-visible,
body[data-layout="os"] .os-taskbar-app:focus-visible,
body[data-layout="os"] .os-taskbar-tray:focus-visible,
body[data-layout="os"] .os-rail-app:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  transform: none;
  outline: none;
}

body[data-layout="os"] .os-start-button[aria-expanded="true"],
body[data-layout="os"] .os-taskbar-app[data-active="true"],
body[data-layout="os"] .os-taskbar-app[data-running="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* A running app keeps the indicator dot, but on the rail's edge. */
body[data-layout="os"] .os-taskbar-app[data-running="true"]::after {
  top: 50%;
  bottom: auto;
  left: -7px;
  width: 4px;
  height: 4px;
  transform: translateY(-50%);
  box-shadow: none;
}

/* Tooltips now open to the right of the rail instead of above the dock. */
body[data-layout="os"] .os-taskbar-app::before,
body[data-layout="os"] .os-taskbar-tray::before,
body[data-layout="os"] .os-rail-app::before {
  content: attr(aria-label);
  position: absolute;
  top: 50%;
  bottom: auto;
  left: calc(100% + 12px);
  padding: 5px 9px;
  border-radius: 8px;
  color: #f2f6ff;
  background: rgba(8, 10, 16, 0.94);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-4px, -50%) scale(0.97);
  transform-origin: left center;
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: none;
  z-index: 3;
}

body[data-layout="os"] .os-taskbar-app:hover::before,
body[data-layout="os"] .os-taskbar-tray:hover::before,
body[data-layout="os"] .os-rail-app:hover::before {
  opacity: 1;
  transform: translate(0, -50%) scale(1);
  transition-delay: 0.2s;
}

/* ---- open windows ----
 *
 * The old dock listed every window; the rail is too narrow for a chip strip,
 * and anything drawn beside it sits underneath an open window (the shell's
 * layer is below the window layer). Re-opening an app from the rail or the
 * launcher focuses and un-minimises its window, so the chips are dropped.
 */

body[data-layout="os"] .os-running,
body[data-layout="os"] .os-running[hidden] {
  display: none;
}

/* ---- the clock ---- */

body[data-layout="os"] .os-clock {
  position: fixed;
  right: 48px;
  bottom: 44px;
  z-index: 311;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
  padding: 0;
  margin: 0;
  white-space: normal;
  line-height: 1;
  text-align: right;
  color: #fff;
  pointer-events: none;
}

body[data-layout="os"] .os-clock-time {
  font-size: clamp(52px, 6.4vw, 92px);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  color: #b8e4f6;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

body[data-layout="os"] .os-clock-date {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f4fbff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

/* The rail floats over a maximised window, so the app's own content keeps the
   rail's safe area (the same 74px the page uses); only the window surface and
   its titlebar run underneath the glass. */
.os-window.maximized .os-window-body > .view,
.os-window.maximized .os-window-body.os-app {
  padding-left: 78px;
}

/* The chat skin sizes itself against the viewport (100dvh) and forces its own
   padding, so inside a window it was taller than the window and its sidebar
   slid under the floating rail. In a window it fills the window instead. */
.os-window .os-window-body > #v-chat[data-chat-layout="zen-browser"].community-chat-page {
  height: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
}

/* The window already has a titlebar and traffic lights, so the skin's fake
   browser bar and its abyss.chat address pill are a second, empty frame. The
   sidebar keeps its back/forward/refresh buttons; the frame drops away and the
   panels meet the window's edges instead of floating as cards inside it. */
.os-window-body > #v-chat[data-chat-layout="zen-browser"] .zen-dots,
.os-window-body > #v-chat[data-chat-layout="zen-browser"] .zen-url-pill,
.os-window-body > #v-chat[data-chat-layout="zen-browser"] .zen-url-find {
  display: none !important;
}

.os-window-body > #v-chat[data-chat-layout="zen-browser"] .community-chat-layout {
  gap: 0 !important;
}

.os-window-body > #v-chat[data-chat-layout="zen-browser"] .zen-sidebar {
  border-radius: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  border-left: 0 !important;
}

.os-window-body > #v-chat[data-chat-layout="zen-browser"] .community-chat-main {
  border-radius: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  border-right: 0 !important;
}

.os-window-body > #v-chat[data-chat-layout="zen-browser"] .community-chat-members {
  border-radius: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  border-right: 0 !important;
}

/* "MEMBERS — 0 / Loading members…" sat there forever while signed out. */
.os-window-body > #v-chat[data-chat-layout="zen-browser"]:not(.zen-members-open) .community-chat-members:has(.chat-member-empty) {
  display: none !important;
}

.os-window.maximized .os-window-body > #v-chat[data-chat-layout="zen-browser"].community-chat-page {
  padding-left: 88px !important;
}

/* The skin pins the channel header to 54px and stacks the title, the status
   pill and the sign-in link inside it, so the last one spilled into the
   message list, and at window widths the header actions ran into the pill.
   In a window the heading's wrappers flatten into the header row, which then
   wraps: one line for the channel, one for the actions when it gets narrow. */
.os-window-body > #v-chat[data-chat-layout="zen-browser"] .community-chat-header {
  height: auto !important;
  min-height: 54px !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px 12px !important;
  padding: 9px 16px 9px 54px !important;
}

.os-window-body > #v-chat[data-chat-layout="zen-browser"] .chat-heading-main,
.os-window-body > #v-chat[data-chat-layout="zen-browser"] .chat-heading-main > div {
  display: contents !important;
}

.os-window-body > #v-chat[data-chat-layout="zen-browser"] #community-chat-title {
  flex: 0 0 auto !important;
}

/* The pill repeats what the sign-in button says, and it is what squeezed the
   header out at window widths. Inside a window the button carries the message. */
.os-window-body > #v-chat[data-chat-layout="zen-browser"] #community-chat-status {
  display: none !important;
}

/* The layout switch and the "back to Abyss home" link are page chrome; in a
   window they point at the desktop behind the window. */
.os-window-body > #v-chat[data-chat-layout="zen-browser"] #zen-layout-toggle,
.os-window-body > #v-chat[data-chat-layout="zen-browser"] .chat-header-actions > a[href="#home"] {
  display: none !important;
}

.os-window-body > #v-chat[data-chat-layout="zen-browser"] #chat-signin-action {
  flex: 0 0 auto !important;
  margin-top: 0 !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 12px !important;
  font-size: 11.5px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.os-window-body > #v-chat[data-chat-layout="zen-browser"] .chat-header-actions {
  flex: 0 0 auto !important;
  margin-left: auto !important;
}

/* Immersive: a maximised window covers the viewport, so the desktop's fixed
   widgets would be painted over its content. They step aside; the rail is
   chrome and stays on top, glass, over the window. */
body[data-layout="os"].os-immersive .os-clock,
body[data-layout="os"].os-immersive .os-desktop-brand,
body[data-layout="os"].os-immersive .os-hint,
body[data-layout="os"].os-immersive .whats-new {
  display: none;
}

/* ---- corner labels ---- */

body[data-layout="os"] .os-desktop-brand {
  position: fixed;
  left: 20px;
  top: 17px;
  z-index: 311;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  user-select: none;
}

body[data-layout="os"] .os-hint {
  position: fixed;
  left: 74px;
  bottom: 42px;
  z-index: 311;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(12, 15, 21, 0.55);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

body[data-layout="os"] .os-hint:hover {
  color: #fff;
  background: rgba(26, 30, 40, 0.7);
}

body[data-layout="os"] .os-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
}

/* Outside the desktop layout the clock and the rail have no place in the
 * document flow, so their holders stay hidden. */
body:not([data-layout="os"]) .os-hint,
body:not([data-layout="os"]) .os-desktop-brand,
body:not([data-layout="os"]) .os-dock-extras {
  display: none;
}

/* ---- panels that used to hang off the bar ---- */

/* Caelestia's launcher is a sheet pinned to the bottom edge that slides up
 * (launcher/Wrapper.qml animates bottomMargin), with the search bar as its
 * last row (launcher/Content.qml anchors SearchBar to the bottom). */
body[data-layout="os"] .os-start-menu {
  left: 50%;
  top: auto;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  width: min(640px, calc(100vw - 40px));
  max-height: min(78vh, 680px);
  overflow: hidden;
  padding: 0;
  border-radius: 28px 28px 0 0;
  animation: os-launcher-up var(--anim-spatial) var(--curve-spatial) both;
}

/* Launcher Wrapper.qml: offsetScale 1 -> 0 with Anim {} (500ms, spatial).
 * The travel is implicitHeight + 5 and opacity tracks 1 - offsetScale. */
@keyframes os-launcher-up {
  from { transform: translate(-50%, calc(100% + 5px)); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes os-launcher-down {
  from { transform: translate(-50%, 0); opacity: 1; }
  to { transform: translate(-50%, calc(100% + 5px)); opacity: 0; }
}

body[data-layout="os"] .os-start-menu.is-closing {
  animation: os-launcher-down var(--anim-spatial) var(--curve-spatial) both;
}

body[data-layout="os"] .os-launcher-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  opacity: 1;
  transition: opacity var(--anim-effects) var(--curve-effects);
  padding: 18px 22px 12px;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 16px), transparent);
}

/* ContentList.qml swaps its state with a 200ms fade out, swap, 200ms fade in. */
body[data-layout="os"] .os-launcher-body.is-switching {
  opacity: 0;
  pointer-events: none;
}

body[data-layout="os"] .os-start-search {
  flex: 0 0 auto;
  margin: 0 22px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 16px rgba(8, 10, 14, 0.35);
}

/* The footer is a row inside the scrolling body now, not a bar welded to the
 * old panel edge. */
body[data-layout="os"] .os-start-footer {
  margin: 16px 0 0;
  padding: 12px 0;
  border-top: 1px solid var(--m3-outline-variant);
  background: transparent;
  border-radius: 0;
}

.os-launcher-scrim {
  position: fixed;
  inset: 0;
  z-index: 318;
  background: rgba(6, 8, 12, 0.45);
  backdrop-filter: blur(10px) saturate(110%);
  -webkit-backdrop-filter: blur(10px) saturate(110%);
  animation: os-scrim-in var(--anim-effects) var(--curve-effects) both;
}

.os-launcher-scrim[hidden] {
  display: none;
}

@keyframes os-scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

body[data-layout="os"] .whats-new {
  top: 16px;
  right: 18px;
  bottom: auto;
}

body[data-layout="os"] .whats-new-panel {
  top: calc(100% + 8px);
  bottom: auto;
}

/* ---- smaller screens ---- */

@media (max-width: 860px) {
  body[data-layout="os"] .os-hint,
  body[data-layout="os"] .os-running {
    display: none;
  }

  body[data-layout="os"] .os-desktop-brand {
    left: 18px;
    top: 14px;
  }
}

@media (max-width: 620px) {
  body[data-layout="os"] .os-taskbar {
    left: 8px;
    width: 54px;
    /* Use the height the screen has: a flat 620px cap cut the last entries off. */
    height: calc(100dvh - 32px);
    max-height: 760px;
    padding: 10px 6px;
  }

  body[data-layout="os"] .os-start-button,
  body[data-layout="os"] .os-taskbar-app,
  body[data-layout="os"] .os-taskbar-tray,
  body[data-layout="os"] .os-rail-app {
    width: 38px;
    height: 38px;
  }

  body[data-layout="os"] .os-clock {
    right: 18px;
    bottom: 18px;
  }

  body[data-layout="os"] .os-clock-time {
    font-size: clamp(36px, 11vw, 54px);
  }

  body[data-layout="os"] .os-start-menu {
    left: 74px;
    width: calc(100vw - 90px);
  }
}

@media (max-height: 660px) {
  body[data-layout="os"] .os-rail-group {
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-layout="os"] .os-taskbar,
  body[data-layout="os"] .os-taskbar-app::before,
  body[data-layout="os"] .os-taskbar-tray::before,
  body[data-layout="os"] .os-rail-app::before {
    animation: none;
    transition: none;
  }
}

/* ==========================================================================
 * v6 — Caelestia
 *
 * The shell under reference-ui/shell-qml is Caelestia: a Material 3 desktop
 * whose bar is a vertical column of entries (logo, workspaces, active-window
 * title, tray, status, power), with a desktop clock painted on the wallpaper,
 * an on-screen display for volume changes and a session screen. This section
 * brings that language to the web shell:
 *
 *   - material colour roles, taken from a dark scheme with a cyan tertiary;
 *   - Material Symbols instead of hand-drawn glyphs;
 *   - the bar's workspace dots and the rotated active-window title;
 *   - the desktop clock as HH:MM | MONTH / day / weekday;
 *   - bar popouts, the OSD and the lock surface.
 * ========================================================================== */

body[data-layout="os"] {
  --m3-surface: #0b0e13;
  --m3-surface-container: rgba(20, 23, 30, 0.86);
  --m3-surface-high: rgba(30, 34, 43, 0.92);
  --m3-on-surface: #e6edf5;
  --m3-on-surface-variant: #9fadbd;
  --m3-primary: #cfe8f7;
  --m3-secondary: #b5c9d8;
  --m3-tertiary: #7fd4ef;
  --m3-error: #ffb4ab;
  --m3-outline: rgba(255, 255, 255, 0.12);
  --m3-radius: 22px;
  --m3-blur: blur(24px) saturate(150%);

  /* Anim tokens from Caelestia's plugin/src/Caelestia/Config/tokens.hpp.
   * Every surface (launcher, popouts, OSD, dashboard) is driven by the same
   * `Behavior on offsetScale { Anim {} }`, which is DefaultSpatial. */
  --anim-small: 200ms;
  --anim-normal: 400ms;
  --anim-large: 600ms;
  --anim-fast-spatial: 350ms;
  --anim-spatial: 500ms;
  --anim-slow-spatial: 650ms;
  --anim-fast-effects: 150ms;
  --anim-effects: 200ms;
  --anim-slow-effects: 300ms;
  --curve-spatial: cubic-bezier(0.38, 1.21, 0.22, 1);
  --curve-fast-spatial: cubic-bezier(0.42, 1.67, 0.21, 0.9);
  --curve-slow-spatial: cubic-bezier(0.39, 1.29, 0.35, 0.98);
  --curve-effects: cubic-bezier(0.34, 0.8, 0.34, 1);
  --curve-fast-effects: cubic-bezier(0.31, 0.94, 0.34, 1);
  --curve-standard: cubic-bezier(0.2, 0, 0, 1);
}

.msr {
  font-family: "Material Symbols Rounded", "Segoe UI Symbol", system-ui, sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* ---- the bar ---- */

body[data-layout="os"] .os-taskbar {
  width: 52px;
  padding: 14px 7px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--m3-radius);
  /* Glass rather than a solid bar: a maximised window sits underneath it, and
     the blur keeps the rail's own icons readable over whatever is behind. */
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.1), rgba(10, 13, 19, 0.34) 55%, rgba(10, 13, 19, 0.46));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(30px) saturate(175%);
  -webkit-backdrop-filter: blur(30px) saturate(175%);
  gap: 6px;
}

body[data-layout="os"] .os-rail-top {
  gap: 10px;
}

body[data-layout="os"] .os-rail-bottom {
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--m3-outline);
}

body[data-layout="os"] .os-start-button,
body[data-layout="os"] .os-taskbar-app,
body[data-layout="os"] .os-taskbar-tray,
body[data-layout="os"] .os-rail-app {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--m3-on-surface-variant);
}

body[data-layout="os"] .os-start-button .msr,
body[data-layout="os"] .os-taskbar-app .msr,
body[data-layout="os"] .os-taskbar-tray .msr,
body[data-layout="os"] .os-rail-app .msr {
  font-size: 21px;
}

body[data-layout="os"] .os-start-button:hover,
body[data-layout="os"] .os-taskbar-app:hover,
body[data-layout="os"] .os-taskbar-tray:hover,
body[data-layout="os"] .os-rail-app:hover,
body[data-layout="os"] .os-start-button:focus-visible,
body[data-layout="os"] .os-taskbar-app:focus-visible,
body[data-layout="os"] .os-taskbar-tray:focus-visible,
body[data-layout="os"] .os-rail-app:focus-visible {
  color: var(--m3-on-surface);
  background: rgba(255, 255, 255, 0.1);
}

body[data-layout="os"] .os-start-button[aria-expanded="true"],
body[data-layout="os"] .os-taskbar-app[data-active="true"],
body[data-layout="os"] .os-taskbar-app[data-running="true"],
body[data-layout="os"] .os-rail-app[aria-expanded="true"] {
  color: var(--m3-primary);
  background: rgba(207, 232, 247, 0.14);
}

body[data-layout="os"] .os-rail-power {
  color: var(--m3-error);
}

body[data-layout="os"] .os-rail-power:hover {
  color: #ffd7d2;
  background: rgba(255, 180, 171, 0.16);
}

/* ---- workspaces: one dot per open window ---- */

body[data-layout="os"] .os-rail-workspaces {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-height: 0;
  padding: 14px 0;
}

body[data-layout="os"] .os-rail-workspaces:empty {
  display: none;
}

body[data-layout="os"] .os-rail-ws {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: height 0.18s ease, background 0.18s ease;
}

body[data-layout="os"] .os-rail-ws[data-minimized="true"] {
  background: rgba(255, 255, 255, 0.12);
}

body[data-layout="os"] .os-rail-ws[aria-current="true"] {
  height: 20px;
  background: var(--m3-primary);
}

/* ---- active window title, set along the bar like Caelestia's ActiveWindow ---- */

body[data-layout="os"] .os-rail-active {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  margin: 4px 0;
  color: var(--m3-primary);
}

body[data-layout="os"] .os-rail-active-icon {
  font-size: 18px;
  color: var(--m3-primary);
}

body[data-layout="os"] .os-rail-active-title {
  writing-mode: vertical-rl;
  max-height: 32vh;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--m3-primary);
  opacity: 0.85;
}

/* ---- the desktop clock: HH:MM with the date set beside it ---- */

body[data-layout="os"] .os-clock {
  right: 44px;
  bottom: 40px;
  flex-direction: row;
  align-items: flex-end;
  gap: 18px;
  color: var(--m3-on-surface);
}

body[data-layout="os"] .os-clock-time {
  display: inline-flex;
  align-items: baseline;
  font-size: clamp(52px, 6.2vw, 88px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.86;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 6px 34px rgba(0, 0, 0, 0.35);
}

body[data-layout="os"] .os-clock-time b {
  font-weight: inherit;
  color: var(--m3-primary);
}

body[data-layout="os"] .os-clock-time b#os-clock-minute {
  color: var(--m3-secondary);
}

body[data-layout="os"] .os-clock-colon {
  color: var(--m3-tertiary);
  opacity: 0.8;
  margin: 0 0.04em;
}

body[data-layout="os"] .os-clock-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding-left: 18px;
  border-left: 3px solid var(--m3-primary);
  line-height: 1.05;
}

body[data-layout="os"] .os-clock-month {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: var(--m3-secondary);
}

body[data-layout="os"] .os-clock-day {
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--m3-primary);
}

body[data-layout="os"] .os-clock-weekday {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--m3-secondary);
}

/* the old single date line is gone; keep the row from wrapping */
body[data-layout="os"] .os-clock-date {
  display: none;
}

/* Dashboard Wrapper.qml is the same offsetScale sheet as the launcher, only
 * dropping from the top edge instead of the bottom (topMargin = -(height+5)).
 * It stays mounted and slides, so both directions animate. */
body[data-layout="os"] .cs-dashboard {
  display: block;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(calc(-100% - 84px));
  transition: transform var(--anim-spatial) var(--curve-spatial), opacity var(--anim-spatial) var(--curve-spatial);
}

body[data-layout="os"] .cs-dashboard[data-cs-open="true"] {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ---- bar popouts ---- */

.os-popout {
  position: fixed;
  left: 78px;
  z-index: 315;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 236px;
  padding: 14px 15px 16px;
  border: 1px solid var(--m3-outline);
  border-radius: var(--m3-radius);
  color: var(--m3-on-surface);
  background: var(--m3-surface-container);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.5);
  backdrop-filter: var(--m3-blur);
  -webkit-backdrop-filter: var(--m3-blur);
  animation: os-popout-in var(--anim-spatial) var(--curve-spatial) both;
}

.os-popout[hidden] {
  display: none;
}

/* Popouts share the launcher's offsetScale motion: Anim {} => 500ms. */
@keyframes os-popout-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}

.os-popout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--m3-secondary);
}

.os-popout-head #os-popout-close {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: var(--m3-on-surface-variant);
  font-family: "Material Symbols Rounded", sans-serif;
  font-size: 16px;
}

.os-popout-head #os-popout-close:hover {
  color: var(--m3-on-surface);
  background: rgba(255, 255, 255, 0.1);
}

.os-popout-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.os-popout-row > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-popout-row .msr {
  font-size: 18px;
  color: var(--m3-on-surface-variant);
}

.os-popout-row b {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--m3-on-surface);
}

.os-popout input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.os-popout input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--m3-primary);
}

.os-popout input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 999px;
  background: var(--m3-primary);
}

.os-popout-note {
  font-size: 11px;
  color: var(--m3-on-surface-variant);
}

.os-popout-meter {
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--m3-outline);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.os-popout-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--m3-tertiary), var(--m3-primary));
}

.os-popout-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--m3-on-surface);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
}

.os-popout-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.os-popout-link-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.os-popout-item {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.os-popout-item time {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--m3-on-surface-variant);
}

.os-popout-item b {
  font-size: 12px;
  font-weight: 600;
  color: var(--m3-on-surface);
}

.os-popout-item p {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--m3-on-surface-variant);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.os-rail-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--m3-tertiary);
  box-shadow: 0 0 0 2px var(--m3-surface-container);
}

.os-rail-badge[hidden] {
  display: none;
}

/* Audio and network share one rail entry: the speaker glyph with the network
   state as a small corner indicator, opening a single popout for both. */
body[data-layout="os"] .os-rail-app .os-rail-av-net {
  position: absolute;
  right: 2px;
  bottom: 3px;
  font-size: 12px;
  line-height: 1;
  color: var(--m3-tertiary);
  pointer-events: none;
}

body[data-layout="os"] .os-rail-app .os-rail-av-net.is-off {
  color: var(--m3-error);
}

/* ---- audio visualiser, painted under the clock like Visualiser.qml ---- */

.os-visualiser {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 310;
  width: min(46vw, 620px);
  height: 64px;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--anim-effects) var(--curve-effects);
}

/* ---- on-screen display ---- */

.os-osd {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 316;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  padding: 14px 18px;
  border-radius: 999px;
  color: var(--m3-on-surface);
  background: var(--m3-surface-container);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.5);
  backdrop-filter: var(--m3-blur);
  -webkit-backdrop-filter: var(--m3-blur);
  animation: os-osd-in var(--anim-spatial) var(--curve-spatial) both;
}

/* OSD Wrapper.qml: same offsetScale slide (implicitWidth + 5), Anim {} . */
@keyframes os-osd-in {
  from { transform: translate(-50%, calc(100% + 5px)); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.os-osd[hidden] {
  display: none;
}

.os-osd .msr {
  font-size: 20px;
  color: var(--m3-primary);
}

.os-osd-track {
  flex: 1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.os-osd-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--m3-tertiary), var(--m3-primary));
  transition: width var(--anim-fast-effects) var(--curve-fast-effects);
}

.os-osd-value {
  min-width: 34px;
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--m3-secondary);
}

/* ---- session / lock ---- */

.os-lock {
  position: fixed;
  inset: 0;
  z-index: 322;
  display: grid;
  place-content: center;
  gap: 18px;
  justify-items: center;
  color: var(--m3-on-surface);
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(26px) saturate(120%);
  -webkit-backdrop-filter: blur(26px) saturate(120%);
  cursor: pointer;
}

.os-lock[hidden] {
  display: none;
}

/* LockSurface.qml fades the background out with Anim.StandardLarge (600ms) on
 * unlock, after the content has already scaled away. */
.os-lock.is-unlocking {
  animation: os-lock-out var(--anim-large) var(--curve-standard) both;
  pointer-events: none;
}

@keyframes os-lock-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.os-lock-clock {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.os-lock-clock strong {
  font-size: clamp(64px, 9vw, 128px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--m3-primary);
  font-variant-numeric: tabular-nums;
}

.os-lock-clock span {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--m3-secondary);
}

.os-lock-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--m3-on-surface-variant);
}

.os-lock-hint .msr {
  font-size: 16px;
}

/* ---- launcher tabs ---- */

body[data-layout="os"] .os-start-tabs {
  display: flex;
  gap: 6px;
  margin: 10px 0 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

body[data-layout="os"] .os-start-tab {
  flex: 1;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  color: var(--m3-on-surface-variant);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

body[data-layout="os"] .os-start-tab[aria-selected="true"] {
  color: var(--m3-surface);
  background: var(--m3-primary);
}

body[data-layout="os"] .os-launcher-panel[hidden] {
  display: none;
}

.os-launcher-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 8px;
  font-size: 12px;
  color: var(--m3-on-surface-variant);
}

.os-launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}

.os-launcher-swatch {
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--m3-on-surface);
  font: inherit;
  font-size: 10.5px;
  text-align: left;
  cursor: pointer;
}

.os-launcher-swatch span {
  height: 46px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
}

.os-launcher-swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--m3-primary) inset;
}

/* keep the apps tab's own sections out of the way while a picker is open */
body[data-layout="os"] .os-start-menu[data-tab="wallpapers"] .os-start-heading,
body[data-layout="os"] .os-start-menu[data-tab="wallpapers"] .os-pinned,
body[data-layout="os"] .os-start-menu[data-tab="wallpapers"] .os-workspace-actions,
body[data-layout="os"] .os-start-menu[data-tab="wallpapers"] .os-start-heading,
body[data-layout="os"] .os-start-menu[data-tab="wallpapers"] .os-pinned,
body[data-layout="os"] .os-start-menu[data-tab="wallpapers"] .os-workspace-actions,
body[data-layout="os"] .os-start-menu[data-tab="wallpapers"] #os-start-apps {
  display: none;
}

/* ---- smaller screens ---- */

@media (max-width: 900px) {
  body[data-layout="os"] .os-rail-active-title {
    display: none;
  }

  body[data-layout="os"] .os-clock {
    gap: 12px;
    right: 22px;
    bottom: 26px;
  }

  body[data-layout="os"] .os-clock-meta {
    padding-left: 12px;
  }
}

@media (max-width: 640px) {
  body[data-layout="os"] .os-clock-meta {
    display: none;
  }

  .os-popout {
    left: 68px;
    width: 208px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .os-popout,
  .os-lock,
  .os-osd,
  .os-start-menu,
  .os-launcher-scrim,
  .os-launcher-body,
  .os-visualiser,
  body[data-layout="os"] .cs-dashboard {
    animation: none;
    transition: none;
  }
}
