/* Isolated dock finish: Liquid Glass shell and stable macOS-style magnification. */
.desktop-shell .dock-area {
  width: max-content !important;
  max-width: calc(100vw - 24px) !important;
}

.desktop-shell .dock {
  box-sizing: border-box;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  min-height: 84px;
  padding: 10px 14px;
  overflow: visible !important;
  isolation: isolate;
  border: 1px solid rgba(246, 251, 255, .48) !important;
  border-radius: 29px;
  background:
    radial-gradient(130% 150% at 12% -24%, rgba(255,255,255,.30), transparent 54%),
    radial-gradient(100% 130% at 96% 120%, rgba(130,195,255,.13), transparent 66%),
    linear-gradient(145deg, rgba(255,255,255,.15), rgba(255,255,255,.035) 54%, rgba(200,228,255,.075)),
    rgba(203, 224, 247, .075) !important;
  box-shadow:
    0 24px 58px rgba(0,0,0,.30),
    0 3px 12px rgba(0,0,0,.12),
    inset 0 1.4px 0 rgba(255,255,255,.70),
    inset 0 -1px 0 rgba(0,0,0,.17),
    inset 1px 0 0 rgba(255,255,255,.20),
    inset -1px 0 0 rgba(166,211,255,.15) !important;
  -webkit-backdrop-filter: blur(28px) saturate(195%) contrast(1.07) !important;
  backdrop-filter: blur(28px) saturate(195%) contrast(1.07) !important;
}

.desktop-shell .dock > canvas.comet-optical-glass {
  position: absolute !important;
  inset: 0;
  z-index: 0 !important;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
}

.desktop-shell .dock::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(112deg, rgba(255,255,255,.20), transparent 24% 66%, rgba(168,215,255,.08)),
    radial-gradient(115% 80% at 12% -8%, rgba(255,255,255,.16), transparent 60%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
  opacity: .9;
}

.desktop-shell .dock::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 4;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(116deg, transparent 18%, rgba(255,255,255,.11) 34%, transparent 52%);
  opacity: .72;
}

.desktop-shell .dock > :not(canvas.comet-optical-glass) {
  position: relative;
  z-index: 2;
}

/* Let each icon's magnification z-index interact with its neighbours. */
.desktop-shell .dock > .dock-apps { z-index: auto; }

.desktop-shell .dock-apps {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.desktop-shell .dock .dock-app {
  --dock-scale: 1;
  --dock-lift: 0px;
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 16px;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  transform: translate3d(0, var(--dock-lift), 0) scale(var(--dock-scale));
  transform-origin: center bottom;
  transition: transform .18s cubic-bezier(.2,.75,.25,1), filter .18s ease;
  will-change: transform;
  cursor: pointer;
}

.desktop-shell .dock .dock-app:hover {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: translate3d(0, var(--dock-lift), 0) scale(var(--dock-scale));
}

.desktop-shell .dock .dock-app:active {
  filter: brightness(1.08);
}

.desktop-shell .dock .dock-app:focus-visible {
  outline: 2px solid rgba(255,255,255,.88);
  outline-offset: 3px;
}

.desktop-shell .dock .dock-app img,
.desktop-shell .dock .dock-app svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.27));
}

.desktop-shell .dock .dock-divider {
  flex: 0 0 1px;
  height: 43px;
  margin: 0 3px;
  background: rgba(246,250,255,.42);
  box-shadow: 0 0 8px rgba(255,255,255,.16);
}

.desktop-shell .dock .comet-search {
  flex: 0 0 240px;
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  height: 46px;
  border: 1px solid rgba(245,250,255,.32) !important;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.15), rgba(255,255,255,.035)),
    rgba(16,31,49,.20) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.30),
    inset 0 -1px 0 rgba(0,0,0,.12) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
}

.desktop-shell .dock .comet-search button {
  flex: 0 0 26px;
}

@media (max-width: 850px) {
  .desktop-shell .dock-area { max-width: calc(100vw - 20px) !important; }
  .desktop-shell .dock { min-height: 74px; padding: 8px 10px; gap: 8px; }
  .desktop-shell .dock .dock-app {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
  }
  .desktop-shell .dock .comet-search {
    flex-basis: 180px;
    width: 180px;
    min-width: 180px;
    max-width: 180px;
  }
}

@media (max-width: 620px) {
  .desktop-shell .dock-area { max-width: calc(100vw - 16px) !important; }
  .desktop-shell .dock { min-height: 61px; padding: 6px 7px; gap: 5px; border-radius: 23px; }
  .desktop-shell .dock .dock-app {
    flex-basis: 39px;
    width: 39px;
    height: 39px;
  }
  .desktop-shell .dock-apps { gap: 3px; }
  .desktop-shell .dock .dock-divider { height: 29px; margin: 0 1px; }
  .desktop-shell .dock .comet-search {
    flex: 1 1 88px;
    width: auto;
    min-width: 88px;
    max-width: 120px;
    height: 38px;
    padding-inline: 7px;
  }
  .desktop-shell .dock .comet-search input { font-size: 9px; }
}

@media (max-width: 390px) {
  .desktop-shell .dock { gap: 3px; padding: 5px 6px; }
  .desktop-shell .dock .dock-app {
    flex-basis: 31px;
    width: 31px;
    height: 31px;
  }
  .desktop-shell .dock .comet-search {
    flex-basis: 70px;
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    padding-inline: 5px;
  }
}

@media (hover: none), (pointer: coarse) {
  .desktop-shell .dock .dock-app {
    transform: none !important;
    transition: filter .16s ease;
    will-change: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .desktop-shell .dock .dock-app {
    transform: none !important;
    transition: none !important;
    will-change: auto;
  }
}

body.reduce-motion .desktop-shell .dock .dock-app {
  transform: none !important;
  transition: none !important;
  will-change: auto;
}


/* Final dock sizing correction: keep all six launchers identical,
   including the AI-collapsed state handled by legacy dock rules. */
.desktop-shell .dock {
  --dock-icon-size: 60px;
  --dock-icon-gap: 8px;
}

.desktop-shell .dock-area .dock .dock-app,
.desktop-shell .dock-area .dock .dock-apps > .dock-app,
.desktop-shell .dock-area .dock > #startMenuButton,
.desktop-shell .dock-area .dock > #dockBinButton {
  box-sizing: border-box !important;
  flex: 0 0 var(--dock-icon-size) !important;
  width: var(--dock-icon-size) !important;
  min-width: var(--dock-icon-size) !important;
  max-width: var(--dock-icon-size) !important;
  height: var(--dock-icon-size) !important;
  min-height: var(--dock-icon-size) !important;
  max-height: var(--dock-icon-size) !important;
  padding: 0 !important;
  margin: 0 !important;
}

.desktop-shell .dock-area:has(.comet-search.comet-collapsed) .dock .dock-app,
.desktop-shell .dock-area:has(.comet-search.comet-collapsed) .dock .dock-apps > .dock-app,
.desktop-shell .dock-area:has(.comet-search.comet-collapsed) .dock > #startMenuButton,
.desktop-shell .dock-area:has(.comet-search.comet-collapsed) .dock > #dockBinButton {
  flex: 0 0 var(--dock-icon-size) !important;
  width: var(--dock-icon-size) !important;
  min-width: var(--dock-icon-size) !important;
  max-width: var(--dock-icon-size) !important;
  height: var(--dock-icon-size) !important;
  min-height: var(--dock-icon-size) !important;
  max-height: var(--dock-icon-size) !important;
  transform: translate3d(0, var(--dock-lift, 0px), 0) scale(var(--dock-scale, 1)) !important;
}

.desktop-shell .dock .dock-app img,
.desktop-shell .dock .dock-app svg {
  box-sizing: border-box;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  display: block;
}

@media (max-width: 850px) {
  .desktop-shell .dock .comet-search {
    flex-basis: 180px;
    width: 180px;
    min-width: 180px;
    max-width: 180px;
  }
}

@media (max-width: 620px) {
  .desktop-shell .dock {
    --dock-icon-size: 42px;
  }
}

@media (max-width: 390px) {
  .desktop-shell .dock {
    --dock-icon-size: 36px;
  }
}

/* Keep the hover transform owned by the magnification script, not old hover rules. */
.desktop-shell .dock .dock-app:hover {
  transform: translate3d(0, var(--dock-lift, 0px), 0) scale(var(--dock-scale, 1)) !important;
}



/* Dock settings popover: a compact Liquid Glass panel that opens above the dock. */
.desktop-shell .dock-settings-panel[hidden] {
  display: none !important;
}

.desktop-shell .dock-settings-panel {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 15px);
  z-index: 50;
  box-sizing: border-box;
  width: min(306px, calc(100vw - 24px));
  padding: 15px;
  border: 1px solid rgba(246,251,255,.48);
  border-radius: 22px;
  color: rgba(255,255,255,.96);
  background:
    radial-gradient(130% 115% at 8% -12%, rgba(255,255,255,.24), transparent 58%),
    linear-gradient(145deg, rgba(255,255,255,.15), rgba(255,255,255,.045) 60%, rgba(160,205,255,.09)),
    rgba(15,29,48,.74);
  box-shadow:
    0 22px 55px rgba(0,0,0,.34),
    0 3px 12px rgba(0,0,0,.16),
    inset 0 1px 0 rgba(255,255,255,.56),
    inset 0 -1px 0 rgba(0,0,0,.17);
  -webkit-backdrop-filter: blur(30px) saturate(190%) contrast(1.05);
  backdrop-filter: blur(30px) saturate(190%) contrast(1.05);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 10px) scale(.97);
  transform-origin: center bottom;
  transition: opacity .18s ease, transform .22s cubic-bezier(.2,.75,.25,1), visibility .18s ease;
}

.desktop-shell .dock-settings-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.desktop-shell .dock-settings-panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(118deg, rgba(255,255,255,.12), transparent 42%, rgba(150,205,255,.07));
}

.desktop-shell .dock-settings-panel > * {
  position: relative;
  z-index: 1;
}

.desktop-shell .dock-settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.desktop-shell .dock-settings-heading strong {
  font-family: Manrope, "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -.01em;
}

.desktop-shell .dock-settings-close {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%;
  color: white;
  background: rgba(255,255,255,.10);
  cursor: pointer;
}

.desktop-shell .dock-settings-close:hover {
  background: rgba(255,255,255,.20);
}

.desktop-shell .dock-settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.07);
  font-size: 12px;
  font-weight: 650;
}

.desktop-shell .dock-settings-toggle-row input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #b8ddff;
  cursor: pointer;
}

.desktop-shell .dock-settings-control {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}

.desktop-shell .dock-settings-control[aria-disabled="true"] {
  opacity: .42;
}

.desktop-shell .dock-settings-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: rgba(255,255,255,.88);
}

.desktop-shell .dock-settings-label output {
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,.72);
}

.desktop-shell .dock-settings-control input[type="range"] {
  width: 100%;
  height: 18px;
  margin: 0;
  accent-color: #d7edff;
  cursor: pointer;
}

.desktop-shell .dock-settings-hint {
  margin: 11px 1px 0;
  color: rgba(255,255,255,.58);
  font-size: 10px;
  line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
  .desktop-shell .dock-settings-panel {
    transition: none !important;
    transform: translate(-50%, 0);
  }
}
