:root {
  --bg-1: #120f2f;
  --bg-2: #1f3f59;
  --bg-3: #0f7d72;
  --bg-4: #ffad5c;
  --text: #f5fbff;
  --muted: #d6e3f7;
  --panel: rgba(8, 12, 24, 0.86);
  --panel-border: rgba(255, 255, 255, 0.2);
  --glass: rgba(255, 255, 255, 0.1);
  --glass-strong: rgba(255, 255, 255, 0.2);
  --accent: #ffe28a;
  --ok: #75d19b;
  --danger: #f38b8b;
  --shadow-window: 0 26px 54px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --font-title: "Bahnschrift", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: "Franklin Gothic Medium", "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-body);
  user-select: none;
}

body {
  background:
    radial-gradient(1100px 680px at 8% 12%, color-mix(in srgb, var(--bg-4) 32%, transparent), transparent 60%),
    radial-gradient(900px 520px at 92% 16%, color-mix(in srgb, #4ce0c1 25%, transparent), transparent 62%),
    radial-gradient(1200px 800px at 64% 90%, color-mix(in srgb, #6e9dff 30%, transparent), transparent 68%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3));
  position: relative;
}

#wallpaper-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.08) 0.6px, transparent 0.7px),
    linear-gradient(transparent 24px, rgba(255, 255, 255, 0.03) 25px),
    linear-gradient(90deg, transparent 24px, rgba(255, 255, 255, 0.03) 25px);
  background-size: 7px 7px, 25px 25px, 25px 25px;
  mix-blend-mode: soft-light;
  opacity: 0.44;
  z-index: 0;
}

#desktop {
  position: absolute;
  inset: 0 0 58px;
  padding: 16px 20px;
  display: grid;
  align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px;
  overflow: auto;
  scrollbar-width: thin;
  z-index: 1;
}

.desktop-icon {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(5px);
  color: var(--text);
  min-height: 98px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: default;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.2;
  animation: icon-in 260ms ease both;
  animation-delay: calc(var(--icon-order, 0) * 28ms);
}

@keyframes icon-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.desktop-icon:hover,
.desktop-icon:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.38);
  outline: none;
}

.desktop-icon.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 226, 138, 0.52);
}

.desktop-app-icon,
.desktop-app-fallback {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  flex: 0 0 auto;
}

.desktop-app-icon {
  object-fit: cover;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.9), rgba(224, 236, 255, 0.7));
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.24);
}

.desktop-app-fallback {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(226, 235, 248, 0.74));
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.2);
  position: relative;
}

.desktop-app-fallback::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 4px;
  background: rgba(17, 35, 65, 0.28);
}

#windows-layer,
#window-layer {
  position: absolute;
  inset: 0;
  padding-bottom: 58px;
  z-index: 2;
  pointer-events: none;
}

.app-window {
  position: absolute;
  width: min(860px, 74vw);
  height: min(620px, 70vh);
  min-width: 260px;
  min-height: 200px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(9, 16, 30, 0.98), rgba(16, 26, 46, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-window);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  animation: window-in 190ms ease-out;
}

.app-window.active {
  border-color: rgba(255, 226, 138, 0.6);
}

@keyframes window-in {
  from {
    transform: translateY(10px) scale(0.985);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.app-window.maximized {
  width: calc(100vw - 16px) !important;
  height: calc(100vh - 74px) !important;
  left: 8px !important;
  top: 8px !important;
  border-radius: 10px;
}

.titlebar {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 10px;
  background: linear-gradient(180deg, rgba(42, 62, 96, 0.93), rgba(19, 31, 55, 0.89));
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  cursor: grab;
  touch-action: none;
  font-family: var(--font-title);
}

.titlebar:active {
  cursor: grabbing;
}

.title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  letter-spacing: 0.3px;
  min-width: 0;
}

.window-app-icon,
.window-app-fallback {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  flex: 0 0 auto;
}

.window-app-icon {
  object-fit: cover;
  background: rgba(255, 255, 255, 0.95);
}

.window-app-fallback {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(198, 215, 247, 0.94));
  position: relative;
}

.window-app-fallback::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 2px;
  background: rgba(17, 35, 65, 0.32);
}

.title-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-controls {
  display: flex;
  gap: 6px;
}

.window-controls button {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  color: #0f1e36;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-weight: 700;
  transition: transform 120ms ease, filter 120ms ease;
}

.window-controls button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.window-controls .max {
  background: var(--ok);
}

.window-controls .close {
  background: var(--danger);
}

.app-window .window-content {
  flex: 1;
  background: #ffffff;
  position: relative;
}

.app-window .window-content iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

.desktop-widget {
  position: absolute;
  width: 320px;
  height: 700px;
  pointer-events: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.desktop-widget[hidden] {
  display: none;
}

.webamp-host {
  position: relative;
  width: 320px;
  height: 700px;
  margin: 0;
}

.weather-widget {
  width: 380px;
  height: 560px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(8, 14, 28, 0.92);
  box-shadow: 0 24px 42px rgba(0, 0, 0, 0.4);
}

.links-widget {
  width: 900px;
  height: 560px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(8, 14, 28, 0.92);
  box-shadow: 0 24px 42px rgba(0, 0, 0, 0.4);
  position: absolute;
}

#links-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
  background: #0f172a;
}

#links-frame[hidden] {
  display: none !important;
}

#links-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  background: linear-gradient(160deg, rgba(16, 26, 46, 0.94), rgba(8, 14, 28, 0.96));
  color: #eef6ff;
}

#links-fallback[hidden] {
  display: none;
}

#links-fallback p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
  color: #d6e3f7;
}

#links-open-external {
  justify-self: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #f4fbff;
  padding: 8px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}

#links-open-external:hover {
  background: rgba(255, 255, 255, 0.2);
}

#briefsky-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #0f172a;
}

.app-window .window-fallback {
  position: absolute;
  inset: auto 12px 12px auto;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.97);
  color: #1b2a48;
  font-size: 0.76rem;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: none;
}

.app-window.loading .window-fallback {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.app-window .window-resize {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 16px;
  height: 16px;
  border: none;
  background:
    linear-gradient(135deg, transparent 36%, rgba(255, 255, 255, 0.2) 37%, rgba(255, 255, 255, 0.2) 45%, transparent 46%),
    linear-gradient(135deg, transparent 56%, rgba(255, 255, 255, 0.3) 57%, rgba(255, 255, 255, 0.3) 65%, transparent 66%);
  cursor: nwse-resize;
  z-index: 3;
}

#taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58px;
  background: linear-gradient(180deg, rgba(8, 11, 24, 0.92), rgba(5, 8, 16, 0.96));
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  backdrop-filter: blur(9px);
  z-index: 2147482000;
}

#start-btn {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: linear-gradient(145deg, #ffe08a, #ffab4e);
  color: #2a1b00;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.94rem;
  min-height: 40px;
  padding: 10px 14px;
  cursor: pointer;
  min-width: 88px;
  letter-spacing: 0.2px;
}

#task-strip {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

#task-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#task-buttons::-webkit-scrollbar {
  display: none;
}

.task-scroll-btn {
  width: 28px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #e9f3ff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 0.92rem;
  line-height: 1;
}

#task-strip[data-scrollable="true"] .task-scroll-btn {
  display: inline-flex;
}

.task-scroll-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.task-scroll-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.task-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  border-radius: 10px;
  min-height: 40px;
  padding: 7px 10px;
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
  width: 102px;
  min-width: 102px;
  max-width: 102px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.task-btn > span:last-child {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}

#task-buttons.compact {
  gap: 6px;
}

#task-buttons.compact .task-btn {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  padding: 6px;
  justify-content: center;
}

#task-buttons.compact .task-btn > span:last-child {
  display: none;
}

.task-btn.active {
  border-color: var(--accent);
  background: rgba(255, 226, 138, 0.22);
  color: #fffbe9;
}

.task-icon,
.task-fallback {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex: 0 0 auto;
}

.task-icon {
  object-fit: cover;
  background: rgba(255, 255, 255, 0.96);
}

.task-fallback {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(198, 215, 247, 0.94));
  position: relative;
}

.task-fallback::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 2px;
  background: rgba(17, 35, 65, 0.3);
}

#speaker-btn,
#music-btn,
#weather-btn,
#links-btn {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

#speaker-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #e9f3ff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#music-btn img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

#weather-btn img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

#links-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #e9f3ff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#speaker-btn:hover,
#music-btn:hover,
#weather-btn:hover,
#links-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

#speaker-btn.active,
#music-btn.active,
#weather-btn.active,
#links-btn.active {
  border-color: var(--accent);
  background: rgba(255, 226, 138, 0.22);
}

#volume-panel {
  position: fixed;
  width: 176px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(23, 36, 64, 0.98), rgba(8, 14, 28, 0.99));
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
  padding: 10px 12px;
  z-index: 2147483200;
}

#volume-panel[hidden] {
  display: none;
}

#volume-range {
  width: 100%;
  margin: 0;
}

#volume-value {
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--muted);
  text-align: right;
}

#clock {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  height: 40px;
  padding: 7px 12px;
  min-width: 112px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-body);
  cursor: pointer;
}

#clock:hover {
  background: rgba(255, 255, 255, 0.14);
}

#clock:focus-visible {
  outline: 2px solid rgba(255, 226, 138, 0.85);
  outline-offset: 1px;
}

#clock-calendar {
  position: absolute;
  right: 8px;
  bottom: 66px;
  width: min(332px, calc(100vw - 16px));
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(160deg, rgba(23, 36, 64, 0.98), rgba(8, 14, 28, 0.99));
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.36);
  padding: 10px;
  z-index: 2147483100;
}

#clock-calendar[hidden] {
  display: none;
}

.calendar-head {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.calendar-month {
  text-align: center;
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: #f4fbff;
  letter-spacing: 0.3px;
  text-transform: capitalize;
}

.calendar-nav {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #eef6ff;
  cursor: pointer;
  line-height: 1;
}

.calendar-nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.calendar-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
}

.calendar-grid th,
.calendar-grid td {
  text-align: center;
  border-radius: 7px;
  padding: 4px 0;
  font-size: 0.74rem;
}

.calendar-grid th {
  color: #d6e3f7;
  font-weight: 700;
}

.calendar-grid .cw-col {
  color: #95b4d4;
  width: 30px;
}

.calendar-week {
  color: #95b4d4;
  background: rgba(255, 255, 255, 0.06);
}

.calendar-day {
  background: rgba(255, 255, 255, 0.08);
  color: #eef6ff;
  cursor: pointer;
  position: relative;
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.16);
}

.calendar-day.has-events {
  box-shadow: inset 0 0 0 1px rgba(117, 209, 155, 0.55);
}

.calendar-day.has-events::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: #75d19b;
}

.calendar-day.selected {
  box-shadow: inset 0 0 0 1px rgba(255, 226, 138, 0.95);
}

.calendar-day.other-month {
  color: rgba(214, 227, 247, 0.55);
  background: rgba(255, 255, 255, 0.04);
}

.calendar-day.weekend {
  background: rgba(243, 139, 139, 0.2);
  color: #ffe1e1;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 1px rgba(255, 226, 138, 0.85);
  background: rgba(255, 226, 138, 0.2);
}

#calendar-events {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  gap: 6px;
}

#calendar-events[hidden] {
  display: none;
}

#calendar-events-date {
  font-size: 0.76rem;
  color: #d6e3f7;
}

#calendar-events-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  max-height: 118px;
  overflow: auto;
}

#calendar-events-list li {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 7px;
}

.calendar-event-summary {
  font-size: 0.78rem;
  color: #f5fbff;
}

.calendar-event-meta {
  margin-top: 2px;
  font-size: 0.71rem;
  color: #c8d8ef;
  white-space: pre-line;
}

#start-menu {
  position: absolute;
  left: 8px;
  bottom: 66px;
  width: min(300px, calc(100vw - 16px));
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(160deg, rgba(23, 36, 64, 0.97), rgba(8, 14, 28, 0.98));
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.36);
  padding: 12px;
  z-index: 2147483000;
  display: none;
}

#start-menu.open {
  display: block;
}

.menu-head {
  margin: 0 0 10px;
  font-family: var(--font-title);
  font-size: 0.94rem;
  color: #f5fbff;
  letter-spacing: 0.3px;
}

.menu-search {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3fbff;
  padding: 8px 10px;
  margin-top: 10px;
  margin-bottom: 0;
  outline: none;
}

.menu-search::placeholder {
  color: rgba(227, 238, 255, 0.75);
}

.menu-search:focus {
  border-color: rgba(255, 226, 138, 0.7);
  box-shadow: 0 0 0 2px rgba(255, 226, 138, 0.2);
}

.menu-apps button {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #eef6ff;
  font-size: 0.9rem;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.menu-apps button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.34);
}

.menu-apps {
  display: grid;
  gap: 7px;
  max-height: min(46vh, 360px);
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 226, 138, 0.65) rgba(255, 255, 255, 0.08);
}

.menu-apps::-webkit-scrollbar {
  width: 10px;
}

.menu-apps::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.menu-apps::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 226, 138, 0.82), rgba(255, 171, 78, 0.82));
  border-radius: 999px;
  border: 2px solid rgba(16, 26, 44, 0.94);
}

.menu-apps::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 238, 174, 0.95), rgba(255, 186, 102, 0.95));
}

.menu-category {
  display: grid;
  gap: 6px;
}

.menu-category-title {
  margin: 2px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.55px;
  text-transform: uppercase;
  color: rgba(214, 227, 247, 0.78);
  font-family: var(--font-title);
  font-weight: 700;
}

.menu-category-list {
  display: grid;
  gap: 7px;
}

.menu-apps button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.start-app-icon,
.start-app-fallback {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  flex: 0 0 auto;
}

.start-app-icon {
  object-fit: cover;
  background: rgba(255, 255, 255, 0.92);
}

.start-app-fallback {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(198, 215, 247, 0.94));
  position: relative;
}

.start-app-fallback::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 2px;
  background: rgba(17, 35, 65, 0.3);
}

.start-app-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-empty {
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 920px) {
  #desktop {
    inset: 0 0 64px;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    padding: 12px 10px;
  }

  .app-window {
    width: calc(100vw - 16px) !important;
    height: calc(100vh - 96px) !important;
    min-width: 240px;
    left: 8px !important;
    top: 8px !important;
  }

  .desktop-widget {
    width: min(320px, calc(100vw - 16px));
    height: min(700px, calc(100vh - 96px));
  }

  .app-window.maximized {
    width: calc(100vw - 16px) !important;
    height: calc(100vh - 96px) !important;
  }

  #taskbar {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto auto auto;
    grid-template-areas:
      "start tasks music weather links clock speaker";
    gap: 6px;
    height: 58px;
  }

  #start-btn {
    grid-area: start;
    padding: 7px 12px;
  }

  #clock {
    grid-area: clock;
    justify-self: end;
  }

  #speaker-btn {
    grid-area: speaker;
    justify-self: end;
  }

  #music-btn {
    grid-area: music;
    justify-self: end;
  }

  #weather-btn {
    grid-area: weather;
    justify-self: end;
  }

  #links-btn {
    grid-area: links;
    justify-self: end;
  }

  #task-strip {
    grid-area: tasks;
  }
}

@media (max-width: 700px) {
  #desktop {
    inset: 0 0 64px;
  }

  #taskbar {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto auto auto;
    grid-template-areas:
      "start tasks music weather links clock speaker";
    height: 58px;
    gap: 4px;
    padding: 6px;
  }

  #start-btn {
    min-width: 66px;
    min-height: 36px;
    font-size: 0.88rem;
    padding: 7px 10px;
  }

  #task-strip {
    gap: 4px;
  }

  #task-buttons {
    gap: 6px;
  }

  .task-scroll-btn {
    width: 24px;
    height: 36px;
    border-radius: 9px;
  }

  .task-btn {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    min-height: 36px;
    padding: 6px 8px;
    font-size: 0.74rem;
  }

  #task-buttons.compact .task-btn {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    padding: 6px;
  }

  #speaker-btn,
  #music-btn,
  #weather-btn,
  #links-btn {
    width: 36px;
    height: 36px;
  }

  #clock {
    height: 36px;
    min-width: 78px;
    padding: 6px 8px;
    font-size: 0.74rem;
  }
}

@media (max-width: 540px) {
  .task-btn {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    padding: 6px;
    justify-content: center;
  }

  .task-btn > span:last-child {
    display: none;
  }
}
