.win {
  position: absolute; min-width: 280px; min-height: 160px;
  pointer-events: auto;
  background: var(--win-a);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--win-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 40px var(--shadow);
  display: flex; flex-direction: column;
  animation: win-open .18s ease-out;
}

.win.closing { animation: win-close .16s ease-in forwards; }

@keyframes win-open {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes win-close {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(.96); }
}

@media (prefers-reduced-motion: reduce) {
  .win { animation: none !important; }
}

.win.focused {
  border-color: var(--accent);
  box-shadow: 0 0 24px 4px var(--glow), 0 18px 40px var(--shadow2);
}
.win.maximized {
  border-radius: 0;
}
.win.maximized .win-titlebar, .win.maximized .win-body { border-radius: 0; }

.win-titlebar {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 10px;
  background: var(--surface2-a);
  border-radius: 9px 9px 0 0;
  cursor: grab; flex-shrink: 0;
}

.win-titlebar:active { cursor: grabbing; }

.win-title {
  flex: 1; text-align: center;
  font-size: .72rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.wbtn {
  width: 14px; height: 14px; border-radius: 50%;
  border: none; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: rgba(0,0,0,.55); font-size: 11px; font-weight: 700; line-height: 1;
  flex-shrink: 0;
}

.wbtn:hover { color: rgba(0,0,0,.85); }
.wbtn.min { background: var(--yellow); }
.wbtn.max { background: var(--green-dot); }
.wbtn.close { background: var(--red); }

.win:not(.focused) .wbtn {
  filter: grayscale(.85);
  opacity: .75;
}

.win-body {
  flex: 1; overflow: auto;
  background: var(--term-bg-a);
  border-radius: 0 0 9px 9px;
  user-select: text;
  padding: 12px;
}

.win-body.no-pad { padding: 0; }
