/* ── Window ──────────────────────────────────────── */
.window {
  position: absolute;
  background: rgba(12, 12, 28, 0.82);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 0.5px rgba(255, 255, 255, 0.04) inset;
  min-width: 280px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s;
  animation: winOpen 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  z-index: 10;
}

.window.focused {
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.75), 0 0 0 1px var(--accent) inset;
  z-index: 100;
}

.window.minimized {
  display: none;
}

/* Titlebar */
.titlebar {
  height: var(--titlebar);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--glass-border);
  cursor: grab;
  flex-shrink: 0;
}

.titlebar:active {
  cursor: grabbing;
}

.titlebar .title {
  flex: 1;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}

/* Traffic lights */
.tl {
  display: flex;
  gap: 6px;
}

.tl button {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: filter 0.15s;
}

.tl button:hover {
  filter: brightness(1.25);
}

.tl .tl-close {
  background: var(--danger);
}

.tl .tl-min {
  background: var(--warn);
}

.tl .tl-max {
  background: var(--ok);
}

/* Window body */
.win-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Resize handle */
.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: se-resize;
  opacity: 0.3;
}

.resize-handle::after {
  content: '';
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
}
