/* Shared chrome: precise symbols live inside larger, forgiving hit targets. */
.app-window {
  border-radius: 13px;
  transform-origin: center;
  transition:
    box-shadow 0.18s ease,
    opacity 0.2s ease,
    transform 0.24s ease;
}
.windowbar {
  height: 44px;
  flex-basis: 44px;
  padding: 0 10px;
  background: var(--toolbar);
}
.traffic-lights {
  display: flex;
  gap: 0;
  height: 24px;
  align-items: center;
}
.traffic {
  position: relative;
  display: grid;
  place-items: center;
  width: 20px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent !important;
  flex-shrink: 0;
  cursor: default;
}
.traffic::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  border-radius: 50%;
  background: #c8c8cd;
  box-shadow: inset 0 0 0 0.6px #00000018;
  transition:
    background 0.12s,
    filter 0.12s,
    box-shadow 0.12s;
}
.focused .traffic.close::before,
.traffic-lights:hover .traffic.close::before {
  background: #ff5f57;
}
.focused .traffic.minimize::before,
.traffic-lights:hover .traffic.minimize::before {
  background: #febc2e;
}
.focused .traffic.maximize::before,
.traffic-lights:hover .traffic.maximize::before {
  background: #28c840;
}
.traffic > svg {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 9px;
  height: 9px;
  fill: none;
  stroke: #0009;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
}
.traffic-lights:hover .traffic > svg,
.traffic:focus-visible > svg {
  opacity: 1;
}
.traffic:active::before {
  filter: brightness(0.82);
  box-shadow: inset 0 0 0 1px #0002;
}
.traffic .traffic-restore {
  display: none;
}
.maximized .traffic .traffic-expand {
  display: none;
}
.maximized .traffic .traffic-restore {
  display: block;
}
.traffic:focus-visible {
  outline: 2px solid #007aff80;
  outline-offset: 0;
  border-radius: 7px;
}
.app-window:not(.focused) .windowbar {
  filter: saturate(0.6);
}
.app-window.is-closing {
  pointer-events: none;
}
.app-window.integrated-toolbar .window-title {
  display: none;
}
.integrated-toolbar .app-content {
  overflow: visible;
}
.integrated-toolbar .app-content > .app-toolbar {
  position: absolute;
  top: -44px;
  left: 79px;
  right: 0;
  min-height: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 6px 12px 6px 5px;
  z-index: 2;
  border-radius: 0 13px 0 0;
}
.integrated-toolbar .app-content > .split-app,
.integrated-toolbar .app-content > .notes-app,
.integrated-toolbar .app-content > .calendar-app {
  border-radius: 0 0 13px 13px;
  overflow: hidden;
}
.integrated-toolbar .app-toolbar .search-field {
  max-width: 175px;
}
.icon-button {
  transition:
    background-color 0.12s,
    color 0.12s,
    transform 0.12s;
}
.icon-button:active {
  transform: scale(0.93);
}
.mac-button {
  transition:
    background-color 0.12s,
    filter 0.12s,
    transform 0.12s;
}
.mac-button:active {
  transform: translateY(0.5px);
}
.context-menu {
  animation: menu-appear 0.12s ease-out;
  transform-origin: top center;
}
@keyframes menu-appear {
  from {
    opacity: 0;
    transform: translateY(-3px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.resize-n,
.resize-s {
  height: 7px;
}
.resize-w,
.resize-e {
  width: 7px;
}
.resize-ne,
.resize-nw,
.resize-se,
.resize-sw {
  width: 14px;
  height: 14px;
}
.qq-close,
.qq-menu {
  border-radius: 50%;
  transition: background 0.12s;
}
.qq-close:hover,
.qq-menu:hover {
  background: #ffffff10;
}
.qq-close:active,
.qq-menu:active {
  background: #ffffff20;
}
/* Dock items keep stable hit slots; only their artwork moves during magnification. */
.dock-glass {
  position: relative;
  background: none;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.dock-glass::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--dock-spread, 0px) / -2);
  right: calc(var(--dock-spread, 0px) / -2);
  border-radius: 22px;
  background: #ffffff35;
  border: 1px solid #ffffff55;
  box-shadow:
    inset 0 1px #ffffff50,
    0 8px 30px #0004;
  backdrop-filter: blur(28px) saturate(170%);
  transition:
    left 0.14s,
    right 0.14s;
  pointer-events: none;
}
.dock-item {
  margin: 0;
  z-index: 1;
  transition: none;
}
.dock-item > .app-icon,
.dock-item > .apps-grid-icon {
  transform: translateX(var(--shift-x, 0px))
    translateY(calc((1 - var(--scale)) * 19px)) scale(var(--scale));
  transition: transform 0.14s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.dock-label {
  translate: var(--shift-x, 0px) 0;
}
.dock-separator {
  z-index: 1;
}
#desktop-files {
  inset: 0;
  display: block;
  pointer-events: none;
}
.desktop-file {
  position: absolute;
  width: 84px;
  min-height: 85px;
  pointer-events: auto;
  touch-action: none;
  padding: 5px 3px;
  gap: 5px;
}
.desktop-file.selected {
  background: #ffffff13;
}
.desktop-file.selected > span {
  background: #1672cc;
}
.desktop-file.dragging {
  opacity: 0.8;
  z-index: 5;
  filter: drop-shadow(0 7px 8px #0005);
}
.desktop-file > .app-icon {
  width: 54px;
  height: 54px;
}
.desktop-file > svg {
  width: 58px;
  height: 58px;
}
.desktop-file > span {
  max-width: 94px;
  font-size: 11px;
  white-space: normal;
  line-height: 1.35;
  text-align: center;
}
.panel-overview {
  left: 50%;
  right: auto;
  top: 16vh;
  transform: translateX(-50%);
  width: 680px;
  max-height: 65vh;
  overflow: auto;
  padding: 22px;
}
.panel-overview > header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}
.panel-overview small {
  color: var(--muted);
}
.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.overview-grid > button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 8px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 7px;
  background: var(--surface);
}
.overview-grid .app-icon {
  width: 48px;
  height: 48px;
}
.overview-grid b {
  font-size: 12px;
}
.overview-grid span {
  font-size: 10px;
  color: var(--muted);
}
.overview-grid > button:hover {
  box-shadow: 0 0 0 2px var(--accent);
}
