.window-ui {
  position: absolute;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.16),
    0 8px 24px rgba(15, 23, 42, 0.08);
}

.window-ui--maximized {
  border-radius: 22px;
}

.window-ui--minimized {
  overflow: visible;
  border: none;
  background: transparent;
  box-shadow: none;
}

.window-ui--dragging,
.window-ui--resizing {
  cursor: grabbing;
}

.window-ui__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(241, 245, 249, 0.96) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.window-ui__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.window-ui__title-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.window-ui__title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-ui__subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(71, 85, 105, 0.82);
  font-size: 12px;
}

.window-ui__controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.window-ui__controls--minimized {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.window-ui__control.ant-btn {
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  touch-action: manipulation;
  font-size: 11px;
}

.window-ui__control--layout.ant-btn {
  color: #0f766e;
  background: rgba(20, 184, 166, 0.14);
  border-color: rgba(13, 148, 136, 0.16);
}

.window-ui__control--minimize.ant-btn {
  color: #c77d15;
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(245, 158, 11, 0.2);
}

.window-ui__control--close.ant-btn {
  color: #c2410c;
  background: rgba(251, 146, 60, 0.16);
  border-color: rgba(249, 115, 22, 0.18);
}

.window-ui__control--maximize.ant-btn {
  color: #165dff;
  background: rgba(22, 93, 255, 0.12);
  border-color: rgba(22, 93, 255, 0.16);
}

.window-ui__body {
  flex: 1;
  min-height: 0;
  padding: 18px;
  overflow: auto;
  touch-action: auto;
}

.window-ui--compact {
  border-radius: 0;
}

.window-ui--compact .window-ui__header {
  min-height: 34px;
  gap: 6px;
  padding: 4px 6px 4px 10px;
}

.window-ui--compact .window-ui__title-copy {
  gap: 0;
}

.window-ui--compact .window-ui__title-text.ant-typography {
  font-size: 13px;
  line-height: 1.2;
}

.window-ui--compact .window-ui__controls {
  gap: 3px;
}

.window-ui--compact .window-ui__control.ant-btn {
  width: 18px;
  min-width: 18px;
  height: 18px;
  font-size: 10px;
}

.window-ui--compact .window-ui__body {
  padding: 0;
}

.window-ui__body--preserved {
  position: fixed;
  top: -200vh;
  left: -200vw;
  width: 1px;
  height: 1px;
  min-width: 1px;
  min-height: 1px;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0;
  pointer-events: none;
}

.window-ui__minimized-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.window-ui__minimized-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.96), rgba(219, 234, 254, 0.94) 56%, rgba(59, 130, 246, 0.84));
  box-shadow:
    0 18px 32px rgba(37, 99, 235, 0.26),
    inset 0 0 0 1px rgba(255, 255, 255, 0.58);
  color: #0f172a;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.window-ui__minimized-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 0 0 1px rgba(147, 197, 253, 0.7),
    0 8px 16px rgba(15, 23, 42, 0.12);
  font-size: 15px;
  font-weight: 700;
}

.window-ui__minimized-menu {
  position: absolute;
  top: 100%;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 208px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.14),
    0 6px 18px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.window-ui__minimized-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.window-ui__minimized-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.window-ui__resize-handle {
  position: absolute;
  z-index: 2;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.window-ui__resize-handle--n,
.window-ui__resize-handle--s {
  left: 8px;
  right: 8px;
  height: 28px;
}

.window-ui__resize-handle--n {
  top: -14px;
  cursor: ns-resize;
}

.window-ui__resize-handle--s {
  bottom: -14px;
  cursor: ns-resize;
}

.window-ui__resize-handle--e,
.window-ui__resize-handle--w {
  top: 8px;
  bottom: 8px;
  width: 28px;
}

.window-ui__resize-handle--e {
  right: -14px;
  cursor: ew-resize;
}

.window-ui__resize-handle--w {
  left: -14px;
  cursor: ew-resize;
}

.window-ui__resize-handle--ne,
.window-ui__resize-handle--nw,
.window-ui__resize-handle--se,
.window-ui__resize-handle--sw {
  width: 34px;
  height: 34px;
}

.window-ui__resize-handle--ne {
  top: -14px;
  right: -14px;
  cursor: nesw-resize;
}

.window-ui__resize-handle--nw {
  top: -14px;
  left: -14px;
  cursor: nwse-resize;
}

.window-ui__resize-handle--se {
  right: -14px;
  bottom: -14px;
  cursor: nwse-resize;
}

.window-ui__resize-handle--sw {
  left: -14px;
  bottom: -14px;
  cursor: nesw-resize;
}

.window-ui__resize-grip {
  display: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.14);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.window-ui-sample {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.window-ui-sample__actions {
  align-items: center;
}

.window-ui-sample__stage {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(22, 93, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #eff6ff 0%, #f8fafc 48%, #ffffff 100%);
}

.window-ui-sample__desktop {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.5;
  pointer-events: none;
}

.window-ui-sample__footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(71, 85, 105, 0.84);
  font-size: 12px;
}

@media (width <= 768px) {
  .window-ui {
    border-radius: 20px;
  }

  .window-ui--mobile {
    max-width: 100%;
  }

  .window-ui--mobile .window-ui__header {
    min-height: 54px;
    padding: 12px 14px;
  }

  .window-ui--mobile .window-ui__body {
    padding: 16px;
  }

  .window-ui--mobile .window-ui__control.ant-btn {
    width: 32px;
    min-width: 32px;
    height: 32px;
  }

  .window-ui--mobile .window-ui__resize-handle {
    z-index: 3;
  }

  .window-ui--mobile .window-ui__resize-handle--n,
  .window-ui--mobile .window-ui__resize-handle--s {
    left: 14px;
    right: 14px;
    height: 40px;
  }

  .window-ui--mobile .window-ui__resize-handle--n {
    top: -20px;
  }

  .window-ui--mobile .window-ui__resize-handle--s {
    bottom: -20px;
  }

  .window-ui--mobile .window-ui__resize-handle--e,
  .window-ui--mobile .window-ui__resize-handle--w {
    top: 14px;
    bottom: 14px;
    width: 40px;
  }

  .window-ui--mobile .window-ui__resize-handle--e {
    right: -20px;
  }

  .window-ui--mobile .window-ui__resize-handle--w {
    left: -20px;
  }

  .window-ui--mobile .window-ui__resize-handle--ne,
  .window-ui--mobile .window-ui__resize-handle--nw,
  .window-ui--mobile .window-ui__resize-handle--se,
  .window-ui--mobile .window-ui__resize-handle--sw {
    width: 48px;
    height: 48px;
  }

  .window-ui--mobile .window-ui__resize-handle--ne {
    top: -20px;
    right: -20px;
  }

  .window-ui--mobile .window-ui__resize-handle--nw {
    top: -20px;
    left: -20px;
  }

  .window-ui--mobile .window-ui__resize-handle--se {
    right: -20px;
    bottom: -20px;
  }

  .window-ui--mobile .window-ui__resize-handle--sw {
    left: -20px;
    bottom: -20px;
  }

  .window-ui--mobile .window-ui__resize-grip {
    display: block;
  }

  .window-ui--mobile .window-ui__resize-handle--n .window-ui__resize-grip,
  .window-ui--mobile .window-ui__resize-handle--s .window-ui__resize-grip {
    width: 56px;
    height: 6px;
  }

  .window-ui--mobile .window-ui__resize-handle--e .window-ui__resize-grip,
  .window-ui--mobile .window-ui__resize-handle--w .window-ui__resize-grip {
    width: 6px;
    height: 56px;
  }

  .window-ui--mobile .window-ui__resize-handle--ne .window-ui__resize-grip,
  .window-ui--mobile .window-ui__resize-handle--nw .window-ui__resize-grip,
  .window-ui--mobile .window-ui__resize-handle--se .window-ui__resize-grip,
  .window-ui--mobile .window-ui__resize-handle--sw .window-ui__resize-grip {
    width: 18px;
    height: 18px;
  }

  .window-ui-sample__stage {
    min-height: 620px;
    border-radius: 24px;
  }

  .window-ui-sample__footer {
    flex-direction: column;
  }
}
