/* =====================================================================
   WINDOWS – shared chrome for the main window and the app windows:
   gel title bar, glossy controls, open/close motion.
   ===================================================================== */
.win {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--chrome-border);
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-window);
  overflow: hidden;
  font-family: var(--chrome-font);
}

.win[hidden] {
  display: none !important;
}

/* glossy two-tone gel bar */
.win__bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--titlebar-h);
  padding: 0 6px 0 10px;
  color: var(--white);
  font-size: var(--fs-13);
  font-weight: 700;
  letter-spacing: .01em;
  text-shadow: var(--text-shadow-chrome);
  background: var(--gel-titlebar);
  border-bottom: 1px solid var(--chrome-bar-edge);
  user-select: none;
  touch-action: none;
}

.win.is-inactive .win__bar {
  filter: saturate(.45) brightness(1.08);
}

.win__icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.win__title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win__controls {
  display: flex;
  gap: 3px;
}

.ctl {
  width: 24px;
  height: 22px;
  border-radius: var(--radius-control);
  border: 1px solid var(--overlay-white-75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--gel-ctl);
  box-shadow: var(--shadow-ctl);
}

.ctl svg {
  width: 12px;
  height: 12px;
  stroke: var(--white);
  stroke-width: 2.2;
  fill: none;
  filter: var(--drop-glyph);
}

.ctl:hover {
  filter: brightness(1.12);
}

.ctl:active {
  filter: brightness(.92);
  transform: translateY(1px);
}

.ctl--close {
  background: var(--gel-ctl-close);
}

.ctl[disabled] {
  opacity: .55;
}

.win__body {
  flex: 1;
  min-height: 0;
  font-family: var(--content-font);
}

/* open / close animation – scales up from the icon that opened it */
.win.app {
  opacity: 0;
  transform: scale(.92);
  transition: opacity var(--dur-open-fade) ease, transform var(--dur-open) var(--ease-open);
}

.win.app.is-open {
  opacity: 1;
  transform: scale(1);
}

.win.app.is-closing {
  opacity: 0;
  transform: scale(.94);
  transition: opacity var(--dur-close) ease, transform var(--dur-close) ease;
}

.win.is-dragging {
  cursor: var(--cursor-move);
}

.win.is-dragging .win__bar {
  cursor: var(--cursor-move);
}

.win.is-max {
  border-radius: 0;
}
