/* ============================================================
   window.css — draggable/resizable window chrome
   ============================================================ */

.win {
  position:absolute; min-width:180px; min-height:120px;
  background:var(--frame);
  border:1px solid #003ca6; border-radius:8px 8px 0 0;
  box-shadow:var(--shadow); display:flex; flex-direction:column;
  padding:0 4px 4px; z-index:100;
}
.win.min { display:none; }
.win.max { border-radius:0; }

/* Title bar */
.win .titlebar {
  height:28px; flex:0 0 auto; display:flex; align-items:center; gap:6px;
  padding:0 4px 0 6px; border-radius:7px 7px 0 0; color:#fff; cursor:default;
  background:linear-gradient(180deg,var(--title-a2) 0%, var(--title-a1) 8%,
             var(--title-a3) 46%, var(--title-a1) 90%, #0348c8 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.45);
}
.win.inactive .titlebar {
  background:linear-gradient(180deg,var(--title-i2),var(--title-i1));
  color:#e8eefb;
}
.win .titlebar .tico { width:16px; height:16px; flex:0 0 auto; }
.win .titlebar .ttl {
  flex:1 1 auto; font-weight:700; font-size:12px; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; text-shadow:0 1px 2px rgba(0,0,0,.5);
}
.win .titlebar .caption { display:flex; gap:2px; }
.win .titlebar .cbtn {
  width:22px; height:22px; border:1px solid #ffffff8c; border-radius:3px; cursor:default;
  background:linear-gradient(180deg,#7db1f5,#2f6fe0); color:#fff;
  display:grid; place-content:center; box-shadow:inset 0 1px 0 rgba(255,255,255,.5);
  font-family:var(--mono); font-size:11px; line-height:1;
}
.win .titlebar .cbtn:hover { filter:brightness(1.12); }
.win .titlebar .cbtn:active { filter:brightness(.9); }
.win .titlebar .cbtn.close { background:linear-gradient(180deg,#f08a6a,#d5401f); }
.win.inactive .titlebar .cbtn { filter:saturate(.5) brightness(1.02); }

/* Body */
.win .win-body {
  flex:1 1 auto; background:var(--face); border-radius:0 0 5px 5px;
  overflow:hidden; display:flex; flex-direction:column; position:relative;
}

/* Menu bar (used by apps) */
.win .menubar {
  flex:0 0 auto; height:20px; display:flex; align-items:center; gap:2px;
  padding:0 4px; background:var(--face); border-bottom:1px solid #d6d2c2;
}
.win .menubar .mi { padding:2px 7px; border-radius:2px; }
.win .menubar .mi:hover { background:var(--sel); color:#fff; }

/* Resize handles */
.win .rz { position:absolute; z-index:2; }
.rz.n{top:-2px;left:6px;right:6px;height:5px;cursor:ns-resize}
.rz.s{bottom:-2px;left:6px;right:6px;height:5px;cursor:ns-resize}
.rz.e{right:-2px;top:6px;bottom:6px;width:5px;cursor:ew-resize}
.rz.w{left:-2px;top:6px;bottom:6px;width:5px;cursor:ew-resize}
.rz.ne{top:-2px;right:-2px;width:10px;height:10px;cursor:nesw-resize}
.rz.nw{top:-2px;left:-2px;width:10px;height:10px;cursor:nwse-resize}
.rz.se{bottom:-2px;right:-2px;width:12px;height:12px;cursor:nwse-resize}
.rz.sw{bottom:-2px;left:-2px;width:10px;height:10px;cursor:nesw-resize}
.win.max .rz { display:none; }

/* Move/resize live preview cleanliness */
.win.dragging, .win.resizing { user-select:none; }

/* build 1783239820 */
